diff options
author | Michael Valenta | 2005-03-21 15:19:49 +0000 |
---|---|---|
committer | Michael Valenta | 2005-03-21 15:19:49 +0000 |
commit | 881b44d0c439a5f3cf2359888ea5e370061cd87d (patch) | |
tree | da235d2ae191080c9cb94cd1a5996403abc6abbe /bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java | |
parent | 07168238457bbd675afb6d9cb77f169388a1ab6c (diff) | |
download | eclipse.platform.team-881b44d0c439a5f3cf2359888ea5e370061cd87d.tar.gz eclipse.platform.team-881b44d0c439a5f3cf2359888ea5e370061cd87d.tar.xz eclipse.platform.team-881b44d0c439a5f3cf2359888ea5e370061cd87d.zip |
Bug 88456 Should avoid explicit checks for [I]FileEditorInput
Diffstat (limited to 'bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java')
-rw-r--r-- | bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java index 6571f6ca0..df59b0c2b 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java @@ -12,6 +12,8 @@ package org.eclipse.team.internal.ccvs.ui.actions; import java.lang.reflect.InvocationTargetException; import java.util.*; + +import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.*; import org.eclipse.jface.action.IAction; @@ -38,6 +40,7 @@ import org.eclipse.ui.*; import org.eclipse.ui.actions.RetargetAction; import org.eclipse.ui.commands.*; import org.eclipse.ui.ide.IDE; +import org.eclipse.ui.ide.ResourceUtil; /** * CVSAction is the common superclass for all CVS actions. It provides @@ -610,9 +613,10 @@ abstract public class CVSAction extends TeamAction implements IEditorActionDeleg // If the action is run from within an editor, try and find the // file for the given editor. if(part != null && part instanceof IEditorPart) { - Object input = ((IEditorPart)part).getEditorInput(); - if(input instanceof IFileEditorInput) { - selectionChanged((IAction)null, new StructuredSelection(((IFileEditorInput)input).getFile())); + IEditorInput input = ((IEditorPart)part).getEditorInput(); + IFile file = ResourceUtil.getFile(input); + if(file != null) { + selectionChanged((IAction)null, new StructuredSelection(file)); } } else { // Fallback is to prime the action with the selection |