Class ResourceNavigator
- java.lang.Object
-
- org.eclipse.core.commands.common.EventManager
-
- org.eclipse.ui.part.WorkbenchPart
-
- org.eclipse.ui.part.ViewPart
-
- org.eclipse.ui.views.navigator.ResourceNavigator
-
- All Implemented Interfaces:
IAdaptable,IExecutableExtension,IPersistable,IViewPart,IWorkbenchPart,IWorkbenchPart2,IWorkbenchPart3,ISetSelectionTarget,IWorkbenchPartOrientation,IResourceNavigator
@Deprecated public class ResourceNavigator extends ViewPart implements ISetSelectionTarget, IResourceNavigator
Deprecated.as of 3.5, use the Common Navigator Framework classes insteadImplements the Resource Navigator view.- Restriction:
- This class is not intended to be subclassed by clients.
- Restriction:
- This class is not intended to be referenced by clients. Planned to be deleted, please see Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=549953
- Restriction:
- This class is not intended to be instantiated by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static StringNAVIGATOR_VIEW_HELP_IDDeprecated.No longer used but preserved to avoid an api change.-
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
-
-
Constructor Summary
Constructors Constructor Description ResourceNavigator()Deprecated.Constructs a new resource navigator view.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected FrameListcreateFrameList()Deprecated.Creates the frame source and frame list, and connects them.voidcreatePartControl(Composite parent)Deprecated.Creates the SWT controls for this workbench part.protected TreeViewercreateViewer(Composite parent)Deprecated.Creates the viewer.voiddispose()Deprecated.TheWorkbenchPartimplementation of thisIWorkbenchPartmethod disposes the title image loaded bysetInitializationData.protected voideditorActivated(IEditorPart editor)Deprecated.An editor has been activated.protected voidfillContextMenu(IMenuManager menu)Deprecated.Called when the context menu is about to open.protected ResourceNavigatorActionGroupgetActionGroup()Deprecated.Returns the action group.<T> TgetAdapter(Class<T> adapter)Deprecated.Returns an object which is an instance of the given class associated with this object.ResourceComparatorgetComparator()Deprecated.Returns the comparator.FrameListgetFrameList()Deprecated.Returns the frame list for this navigator.protected StringgetHelpContextId()Deprecated.Returns the help context id to use for this view.protected IAdaptablegetInitialInput()Deprecated.Returns the initial input for the viewer.ResourcePatternFiltergetPatternFilter()Deprecated.Returns the pattern filter for this view.AbstractUIPlugingetPlugin()Deprecated.Returns the navigator's plugin.ShellgetShell()Deprecated.use getViewSite().getShell()protected IShowInSourcegetShowInSource()Deprecated.Returns theIShowInSourcefor this view.protected IShowInTargetgetShowInTarget()Deprecated.Returns theIShowInTargetfor this view.protected static ObjectgetSingleElement(ISelection s)Deprecated.Returns the selected element if the selection consists of a single element only.ResourceSortergetSorter()Deprecated.as of 3.3, usegetComparator()protected StringgetStatusLineMessage(IStructuredSelection selection)Deprecated.Returns the message to show in the status line.TreeViewergetTreeViewer()Deprecated.Returns the tree viewer which shows the resource hierarchy.TreeViewergetViewer()Deprecated.Returns the resource viewer which shows the resource hierarchy.IWorkingSetgetWorkingSet()Deprecated.Returns the working set for this view.protected voidhandleDoubleClick(DoubleClickEvent event)Deprecated.Handles a double-click event from the viewer.protected voidhandleKeyPressed(KeyEvent event)Deprecated.Handles a key press event from the viewer.protected voidhandleKeyReleased(KeyEvent event)Deprecated.Handles a key release in the viewer.protected voidhandleOpen(ISelection selection)Deprecated.Handles an open event from the viewer.protected voidhandleOpen(OpenEvent event)Deprecated.As of 3.5, replaced byhandleOpen(ISelection)protected voidhandleSelectionChanged(SelectionChangedEvent event)Deprecated.Handles a selection changed event from the viewer.voidinit(IViewSite site, IMemento memento)Deprecated.Initializes this view with the given view site.protected voidinitContentProvider(TreeViewer viewer)Deprecated.Sets the content provider for the viewer.protected voidinitContextMenu()Deprecated.Initializes and registers the context menu.protected voidinitDragAndDrop()Deprecated.Adds drag and drop support to the navigator.protected voidinitFilters(TreeViewer viewer)Deprecated.Adds the filters to the viewer.protected voidinitLabelProvider(TreeViewer viewer)Deprecated.Sets the label provider for the viewer.protected voidinitListeners(TreeViewer viewer)Deprecated.Adds the listeners to the viewer.protected voidinitResourceComparator()Deprecated.Initializes the comparator.protected voidinitResourceSorter()Deprecated.as of 3.3, useinitResourceComparator()insteadprotected voidinitWorkingSetFilter()Deprecated.Restores the working set filter from the persistence store.booleanisLinkingEnabled()Deprecated.Returns whether the navigator selection automatically tracks the active editor.protected voidlinkToEditor(ISelection selection)Deprecated.Brings the corresponding editor to top if the selected resource is open.protected voidlinkToEditor(IStructuredSelection selection)Deprecated.As of 3.5, replaced bylinkToEditor(ISelection)protected voidmakeActions()Deprecated.Creates the action group, which encapsulates all actions for the view.protected voidrestoreState(IMemento memento)Deprecated.Restores the state of the receiver to the state described in the specified memento.voidsaveState(IMemento memento)Deprecated.Saves the object state within a memento.voidselectReveal(ISelection selection)Deprecated.Selects and reveals the specified elements.protected voidsetActionGroup(ResourceNavigatorActionGroup actionGroup)Deprecated.Sets the action group.voidsetComparator(ResourceComparator comparator)Deprecated.Sets the resource comparatorvoidsetFiltersPreference(String[] patterns)Deprecated.Saves the filters defined as strings inpatternsin the preference store.voidsetFocus()Deprecated.Asks this part to take focus within the workbench.voidsetLabelDecorator(ILabelDecorator decorator)Deprecated.use the decorators extension point instead; see IWorkbench.getDecoratorManager()voidsetLinkingEnabled(boolean enabled)Deprecated.Sets whether this navigator's selection automatically tracks the active editor.voidsetSorter(ResourceSorter sorter)Deprecated.as of 3.3, usesetComparator(ResourceComparator)voidsetWorkingSet(IWorkingSet workingSet)Deprecated.Sets the working set for this view, ornullto clear it.protected voidupdateActionBars(IStructuredSelection selection)Deprecated.Updates the action bar actions.protected voidupdateStatusLine(IStructuredSelection selection)Deprecated.Updates the message shown in the status line.voidupdateTitle()Deprecated.Updates the title text and title tool tip.-
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, setContentDescription, setInitializationData, setPartName
-
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
-
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.ui.IViewPart
getViewSite, init
-
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
-
-
-
-
Field Detail
-
NAVIGATOR_VIEW_HELP_ID
@Deprecated public static final String NAVIGATOR_VIEW_HELP_ID
Deprecated.No longer used but preserved to avoid an api change.- See Also:
- Constant Field Values
-
-
Method Detail
-
createPartControl
public void createPartControl(Composite parent)
Deprecated.Description copied from interface:IWorkbenchPartCreates the SWT controls for this workbench part.Clients should not call this method (the workbench calls this method when it needs to, which may be never).
For implementors this is a multi-step process:
- Create one or more controls within the parent.
- Set the parent layout as needed.
- Register any global actions with the site's
IActionBars. - Register any context menus with the site.
- Register a selection provider with the site, to make it available to the
workbench's
ISelectionService(optional).
- Specified by:
createPartControlin interfaceIWorkbenchPart- Specified by:
createPartControlin classWorkbenchPart- Parameters:
parent- the parent control
-
getHelpContextId
protected String getHelpContextId()
Deprecated.Returns the help context id to use for this view.- Since:
- 2.0
-
initContextMenu
protected void initContextMenu()
Deprecated.Initializes and registers the context menu.- Since:
- 2.0
-
createViewer
protected TreeViewer createViewer(Composite parent)
Deprecated.Creates the viewer.- Parameters:
parent- the parent composite- Since:
- 2.0
-
initContentProvider
protected void initContentProvider(TreeViewer viewer)
Deprecated.Sets the content provider for the viewer.- Parameters:
viewer- the viewer- Since:
- 2.0
-
initLabelProvider
protected void initLabelProvider(TreeViewer viewer)
Deprecated.Sets the label provider for the viewer.- Parameters:
viewer- the viewer- Since:
- 2.0
-
initFilters
protected void initFilters(TreeViewer viewer)
Deprecated.Adds the filters to the viewer.- Parameters:
viewer- the viewer- Since:
- 2.0
-
initListeners
protected void initListeners(TreeViewer viewer)
Deprecated.Adds the listeners to the viewer.- Parameters:
viewer- the viewer- Since:
- 2.0
-
dispose
public void dispose()
Deprecated.Description copied from class:WorkbenchPartTheWorkbenchPartimplementation of thisIWorkbenchPartmethod disposes the title image loaded bysetInitializationData. Subclasses may extend.- Specified by:
disposein interfaceIWorkbenchPart- Overrides:
disposein classWorkbenchPart
-
editorActivated
protected void editorActivated(IEditorPart editor)
Deprecated.An editor has been activated. Sets the selection in this navigator to be the editor's input, if linking is enabled.- Parameters:
editor- the active editor- Since:
- 2.0
-
fillContextMenu
protected void fillContextMenu(IMenuManager menu)
Deprecated.Called when the context menu is about to open. Delegates to the action group using the viewer's selection as the action context.- Since:
- 2.0
-
getFrameList
public FrameList getFrameList()
Deprecated.Description copied from interface:IResourceNavigatorReturns the frame list for this navigator.- Specified by:
getFrameListin interfaceIResourceNavigator- Returns:
- the list of frames maintained by the resource navigator
-
getInitialInput
protected IAdaptable getInitialInput()
Deprecated.Returns the initial input for the viewer. Tries to convert the page input to a resource, either directly or via IAdaptable. If the resource is a container, it uses that. If the resource is a file, it uses its parent folder. If a resource could not be obtained, it uses the workspace root.- Since:
- 2.0
-
getPatternFilter
public ResourcePatternFilter getPatternFilter()
Deprecated.Returns the pattern filter for this view.- Specified by:
getPatternFilterin interfaceIResourceNavigator- Returns:
- the pattern filter
- Since:
- 2.0
-
getWorkingSet
public IWorkingSet getWorkingSet()
Deprecated.Returns the working set for this view.- Specified by:
getWorkingSetin interfaceIResourceNavigator- Returns:
- the working set
- Since:
- 2.0
-
getPlugin
public AbstractUIPlugin getPlugin()
Deprecated.Returns the navigator's plugin.- Returns:
- the UI plugin for this bundle
-
getSorter
@Deprecated public ResourceSorter getSorter()
Deprecated.as of 3.3, usegetComparator()Return the sorter. If a comparator was set usingsetComparator(ResourceComparator), this method will returnnull.- Specified by:
getSorterin interfaceIResourceNavigator- Returns:
- the resource navigator's sorter
- Since:
- 2.0
-
getComparator
public ResourceComparator getComparator()
Deprecated.Returns the comparator. If a sorter was set usingsetSorter(ResourceSorter), this method will returnnull.- Specified by:
getComparatorin interfaceIResourceNavigator- Returns:
- the
ResourceComparator - Since:
- 3.3
-
getViewer
public TreeViewer getViewer()
Deprecated.Returns the resource viewer which shows the resource hierarchy.- Specified by:
getViewerin interfaceIResourceNavigator- Returns:
- the resource navigator's tree viewer
- Since:
- 2.0
-
getTreeViewer
public TreeViewer getTreeViewer()
Deprecated.Returns the tree viewer which shows the resource hierarchy.- Returns:
- the tree viewer
- Since:
- 2.0
-
getShell
@Deprecated public Shell getShell()
Deprecated.use getViewSite().getShell()Returns the shell to use for opening dialogs. Used in this class, and in the actions.- Returns:
- the shell
-
getStatusLineMessage
protected String getStatusLineMessage(IStructuredSelection selection)
Deprecated.Returns the message to show in the status line.- Parameters:
selection- the current selection- Returns:
- the status line message
- Since:
- 2.0
-
handleOpen
@Deprecated protected void handleOpen(OpenEvent event)
Deprecated.As of 3.5, replaced byhandleOpen(ISelection)Handles an open event from the viewer. Opens an editor on the selected file.- Parameters:
event- the open event- Since:
- 2.0
-
handleOpen
protected void handleOpen(ISelection selection)
Deprecated.Handles an open event from the viewer. Opens an editor on the selected file.- Parameters:
selection- the selection- Since:
- 3.5
-
handleDoubleClick
protected void handleDoubleClick(DoubleClickEvent event)
Deprecated.Handles a double-click event from the viewer. Expands or collapses a folder when double-clicked.- Parameters:
event- the double-click event- Since:
- 2.0
-
handleSelectionChanged
protected void handleSelectionChanged(SelectionChangedEvent event)
Deprecated.Handles a selection changed event from the viewer. Updates the status line and the action bars, and links to editor (if option enabled).- Parameters:
event- the selection event- Since:
- 2.0
-
handleKeyPressed
protected void handleKeyPressed(KeyEvent event)
Deprecated.Handles a key press event from the viewer. Delegates to the action group.- Parameters:
event- the key event- Since:
- 2.0
-
handleKeyReleased
protected void handleKeyReleased(KeyEvent event)
Deprecated.Handles a key release in the viewer. Does nothing by default.- Parameters:
event- the key event- Since:
- 2.0
-
init
public void init(IViewSite site, IMemento memento) throws PartInitException
Deprecated.Description copied from interface:IViewPartInitializes this view with the given view site. A memento is passed to the view which contains a snapshot of the views state from a previous session. Where possible, the view should try to recreate that state within the part controls.This method is automatically called by the workbench shortly after the part is instantiated. It marks the start of the views's lifecycle. Clients must not call this method.
- Specified by:
initin interfaceIViewPart- Overrides:
initin classViewPart- Parameters:
site- the view sitememento- the IViewPart state or null if there is no previous saved state- Throws:
PartInitException- if this view was not initialized successfully
-
initDragAndDrop
protected void initDragAndDrop()
Deprecated.Adds drag and drop support to the navigator.- Since:
- 2.0
-
createFrameList
protected FrameList createFrameList()
Deprecated.Creates the frame source and frame list, and connects them.- Since:
- 2.0
-
initResourceSorter
@Deprecated protected void initResourceSorter()
Deprecated.as of 3.3, useinitResourceComparator()insteadInitializes the sorter.
-
initResourceComparator
protected void initResourceComparator()
Deprecated.Initializes the comparator.- Since:
- 3.3
-
initWorkingSetFilter
protected void initWorkingSetFilter()
Deprecated.Restores the working set filter from the persistence store.
-
isLinkingEnabled
public boolean isLinkingEnabled()
Deprecated.Returns whether the navigator selection automatically tracks the active editor.- Specified by:
isLinkingEnabledin interfaceIResourceNavigator- Returns:
trueif linking is enabled,falseif not- Since:
- 2.0 (this was protected in 2.0, but was made public in 2.1)
-
linkToEditor
@Deprecated protected void linkToEditor(IStructuredSelection selection)
Deprecated.As of 3.5, replaced bylinkToEditor(ISelection)Brings the corresponding editor to top if the selected resource is open.- Since:
- 2.0
-
linkToEditor
protected void linkToEditor(ISelection selection)
Deprecated.Brings the corresponding editor to top if the selected resource is open.- Since:
- 3.5
-
makeActions
protected void makeActions()
Deprecated.Creates the action group, which encapsulates all actions for the view.
-
restoreState
protected void restoreState(IMemento memento)
Deprecated.Restores the state of the receiver to the state described in the specified memento.- Parameters:
memento- the memento- Since:
- 2.0
-
saveState
public void saveState(IMemento memento)
Deprecated.Description copied from interface:IViewPartSaves the object state within a memento.- Specified by:
saveStatein interfaceIPersistable- Specified by:
saveStatein interfaceIViewPart- Overrides:
saveStatein classViewPart- Parameters:
memento- a memento to receive the object state- See Also:
ViewPart.saveState(org.eclipse.ui.IMemento)
-
selectReveal
public void selectReveal(ISelection selection)
Deprecated.Selects and reveals the specified elements.- Specified by:
selectRevealin interfaceISetSelectionTarget- Parameters:
selection- the new element to select
-
setFiltersPreference
public void setFiltersPreference(String[] patterns)
Deprecated.Saves the filters defined as strings inpatternsin the preference store.- Specified by:
setFiltersPreferencein interfaceIResourceNavigator- Parameters:
patterns- filter patterns to use on contents of the resource navigator
-
setFocus
public void setFocus()
Deprecated.Description copied from interface:IWorkbenchPartAsks this part to take focus within the workbench. Parts must assign focus to one of the controls contained in the part's parent composite.Clients should not call this method (the workbench calls this method at appropriate times). To have the workbench activate a part, use
IWorkbenchPage.activate(IWorkbenchPart) instead.- Specified by:
setFocusin interfaceIWorkbenchPart- Specified by:
setFocusin classWorkbenchPart- See Also:
IWorkbenchPart.setFocus()
-
setLabelDecorator
@Deprecated public void setLabelDecorator(ILabelDecorator decorator)
Deprecated.use the decorators extension point instead; see IWorkbench.getDecoratorManager()Note: For experimental use only. Sets the decorator for the navigator.As of 2.0, this method no longer has any effect.
- Parameters:
decorator- a label decorator ornullfor no decorations.
-
setLinkingEnabled
public void setLinkingEnabled(boolean enabled)
Deprecated.Description copied from interface:IResourceNavigatorSets whether this navigator's selection automatically tracks the active editor.- Specified by:
setLinkingEnabledin interfaceIResourceNavigator- Parameters:
enabled-trueto enable,falseto disable- Since:
- 2.1
- See Also:
IResourceNavigator.setLinkingEnabled(boolean)
-
setSorter
@Deprecated public void setSorter(ResourceSorter sorter)
Deprecated.as of 3.3, usesetComparator(ResourceComparator)Sets the resource sorter.- Specified by:
setSorterin interfaceIResourceNavigator- Parameters:
sorter- the resource sorter- Since:
- 2.0
-
setComparator
public void setComparator(ResourceComparator comparator)
Deprecated.Sets the resource comparator- Specified by:
setComparatorin interfaceIResourceNavigator- Parameters:
comparator- the resource comparator- Since:
- 3.3
-
setWorkingSet
public void setWorkingSet(IWorkingSet workingSet)
Deprecated.Description copied from interface:IResourceNavigatorSets the working set for this view, ornullto clear it.- Specified by:
setWorkingSetin interfaceIResourceNavigator- Parameters:
workingSet- the working set, ornullto clear it
-
updateActionBars
protected void updateActionBars(IStructuredSelection selection)
Deprecated.Updates the action bar actions.- Parameters:
selection- the current selection- Since:
- 2.0
-
updateStatusLine
protected void updateStatusLine(IStructuredSelection selection)
Deprecated.Updates the message shown in the status line.- Parameters:
selection- the current selection
-
updateTitle
public void updateTitle()
Deprecated.Updates the title text and title tool tip. Called whenever the input of the viewer changes. Called whenever the input of the viewer changes.- Since:
- 2.0
-
getActionGroup
protected ResourceNavigatorActionGroup getActionGroup()
Deprecated.Returns the action group.- Returns:
- the action group
-
setActionGroup
protected void setActionGroup(ResourceNavigatorActionGroup actionGroup)
Deprecated.Sets the action group.- Parameters:
actionGroup- the action group
-
getAdapter
public <T> T getAdapter(Class<T> adapter)
Deprecated.Description copied from class:WorkbenchPartReturns an object which is an instance of the given class associated with this object. Returnsnullif no such object can be found.Clients may implement this method but should generally call
Adapters.adapt(Object, Class, boolean)rather than invoking it directly. Subclasses may override this method (however, if they do so, they should invoke the method on their superclass to ensure that the Platform's adapter manager is consulted).- Specified by:
getAdapterin interfaceIAdaptable- Overrides:
getAdapterin classWorkbenchPart- Type Parameters:
T- the class type- Parameters:
adapter- the adapter class to look up- Returns:
- a object of the given class,
or
nullif this object does not have an adapter for the given class
-
getShowInSource
protected IShowInSource getShowInSource()
Deprecated.Returns theIShowInSourcefor this view.
-
getShowInTarget
protected IShowInTarget getShowInTarget()
Deprecated.Returns theIShowInTargetfor this view.
-
getSingleElement
protected static final Object getSingleElement(ISelection s)
Deprecated.Returns the selected element if the selection consists of a single element only.- Parameters:
s- the selection- Returns:
- the selected first element or null
- Since:
- 3.5
-
-