public class ResourceNavigator extends ViewPart implements ISetSelectionTarget, IResourceNavigator
Modifier and Type | Field and Description |
---|---|
static String |
NAVIGATOR_VIEW_HELP_ID
Deprecated.
No longer used but preserved to avoid an api change.
|
PROP_TITLE
Constructor and Description |
---|
ResourceNavigator()
Deprecated.
Constructs a new resource navigator view.
|
Modifier and Type | Method and Description |
---|---|
protected FrameList |
createFrameList()
Deprecated.
Creates the frame source and frame list, and connects them.
|
void |
createPartControl(Composite parent)
Deprecated.
Creates the SWT controls for this workbench part.
|
protected TreeViewer |
createViewer(Composite parent)
Deprecated.
Creates the viewer.
|
void |
dispose()
Deprecated.
The
WorkbenchPart implementation of this
IWorkbenchPart method disposes the title image
loaded by setInitializationData . |
protected void |
editorActivated(IEditorPart editor)
Deprecated.
An editor has been activated.
|
protected void |
fillContextMenu(IMenuManager menu)
Deprecated.
Called when the context menu is about to open.
|
protected ResourceNavigatorActionGroup |
getActionGroup()
Deprecated.
Returns the action group.
|
Object |
getAdapter(Class adapter)
Deprecated.
Returns an object which is an instance of the given class
associated with this object.
|
ResourceComparator |
getComparator()
Deprecated.
Returns the comparator.
|
FrameList |
getFrameList()
Deprecated.
Returns the frame list for this navigator.
|
protected String |
getHelpContextId()
Deprecated.
Returns the help context id to use for this view.
|
protected IAdaptable |
getInitialInput()
Deprecated.
Returns the initial input for the viewer.
|
ResourcePatternFilter |
getPatternFilter()
Deprecated.
Returns the pattern filter for this view.
|
AbstractUIPlugin |
getPlugin()
Deprecated.
Returns the navigator's plugin.
|
Shell |
getShell()
Deprecated.
use getViewSite().getShell()
|
protected IShowInSource |
getShowInSource()
Deprecated.
Returns the
IShowInSource for this view. |
protected IShowInTarget |
getShowInTarget()
Deprecated.
Returns the
IShowInTarget for this view. |
protected static Object |
getSingleElement(ISelection s)
Deprecated.
Returns the selected element if the selection consists of a single element only.
|
ResourceSorter |
getSorter()
Deprecated.
as of 3.3, use
getComparator() |
protected String |
getStatusLineMessage(IStructuredSelection selection)
Deprecated.
Returns the message to show in the status line.
|
TreeViewer |
getTreeViewer()
Deprecated.
Returns the tree viewer which shows the resource hierarchy.
|
TreeViewer |
getViewer()
Deprecated.
Returns the resource viewer which shows the resource hierarchy.
|
IWorkingSet |
getWorkingSet()
Deprecated.
Returns the working set for this view.
|
protected void |
handleDoubleClick(DoubleClickEvent event)
Deprecated.
Handles a double-click event from the viewer.
|
protected void |
handleKeyPressed(KeyEvent event)
Deprecated.
Handles a key press event from the viewer.
|
protected void |
handleKeyReleased(KeyEvent event)
Deprecated.
Handles a key release in the viewer.
|
protected void |
handleOpen(ISelection selection)
Deprecated.
Handles an open event from the viewer.
|
protected void |
handleOpen(OpenEvent event)
Deprecated.
As of 3.5, replaced by
handleOpen(ISelection) |
protected void |
handleSelectionChanged(SelectionChangedEvent event)
Deprecated.
Handles a selection changed event from the viewer.
|
void |
init(IViewSite site,
IMemento memento)
Deprecated.
Initializes this view with the given view site.
|
protected void |
initContentProvider(TreeViewer viewer)
Deprecated.
Sets the content provider for the viewer.
|
protected void |
initContextMenu()
Deprecated.
Initializes and registers the context menu.
|
protected void |
initDragAndDrop()
Deprecated.
Adds drag and drop support to the navigator.
|
protected void |
initFilters(TreeViewer viewer)
Deprecated.
Adds the filters to the viewer.
|
protected void |
initLabelProvider(TreeViewer viewer)
Deprecated.
Sets the label provider for the viewer.
|
protected void |
initListeners(TreeViewer viewer)
Deprecated.
Adds the listeners to the viewer.
|
protected void |
initResourceComparator()
Deprecated.
Initializes the comparator.
|
protected void |
initResourceSorter()
Deprecated.
as of 3.3, use
initResourceComparator() instead |
protected void |
initWorkingSetFilter()
Deprecated.
Restores the working set filter from the persistence store.
|
boolean |
isLinkingEnabled()
Deprecated.
Returns whether the navigator selection automatically tracks the active
editor.
|
protected void |
linkToEditor(ISelection selection)
Deprecated.
Brings the corresponding editor to top if the selected resource is open.
|
protected void |
linkToEditor(IStructuredSelection selection)
Deprecated.
As of 3.5, replaced by
linkToEditor(ISelection) |
protected void |
makeActions()
Deprecated.
Creates the action group, which encapsulates all actions for the view.
|
protected void |
restoreState(IMemento memento)
Deprecated.
Restores the state of the receiver to the state described in the specified memento.
|
void |
saveState(IMemento memento)
Deprecated.
Saves the object state within a memento.
|
void |
selectReveal(ISelection selection)
Deprecated.
Selects and reveals the specified elements.
|
protected void |
setActionGroup(ResourceNavigatorActionGroup actionGroup)
Deprecated.
Sets the action group.
|
void |
setComparator(ResourceComparator comparator)
Deprecated.
Sets the resource comparator
|
void |
setFiltersPreference(String[] patterns)
Deprecated.
Saves the filters defined as strings in
patterns
in the preference store. |
void |
setFocus()
Deprecated.
Asks this part to take focus within the workbench.
|
void |
setLabelDecorator(ILabelDecorator decorator)
Deprecated.
use the decorators extension point instead; see IWorkbench.getDecoratorManager()
|
void |
setLinkingEnabled(boolean enabled)
Deprecated.
Sets whether this navigator's selection automatically tracks the active editor.
|
void |
setSorter(ResourceSorter sorter)
Deprecated.
as of 3.3, use
setComparator(ResourceComparator) |
void |
setWorkingSet(IWorkingSet workingSet)
Deprecated.
Sets the working set for this view, or
null to clear it. |
protected void |
updateActionBars(IStructuredSelection selection)
Deprecated.
Updates the action bar actions.
|
protected void |
updateStatusLine(IStructuredSelection selection)
Deprecated.
Updates the message shown in the status line.
|
void |
updateTitle()
Deprecated.
Updates the title text and title tool tip.
|
checkSite, getViewSite, init, setContentDescription, setInitializationData, setPartName
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getViewSite, init
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
public static final String NAVIGATOR_VIEW_HELP_ID
public ResourceNavigator()
public void createPartControl(Composite parent)
IWorkbenchPart
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:
IActionBars
.ISelectionService
(optional). createPartControl
in interface IWorkbenchPart
createPartControl
in class WorkbenchPart
parent
- the parent controlprotected String getHelpContextId()
protected void initContextMenu()
protected TreeViewer createViewer(Composite parent)
parent
- the parent compositeprotected void initContentProvider(TreeViewer viewer)
viewer
- the viewerprotected void initLabelProvider(TreeViewer viewer)
viewer
- the viewerprotected void initFilters(TreeViewer viewer)
viewer
- the viewerprotected void initListeners(TreeViewer viewer)
viewer
- the viewerpublic void dispose()
WorkbenchPart
WorkbenchPart
implementation of this
IWorkbenchPart
method disposes the title image
loaded by setInitializationData
. Subclasses may extend.dispose
in interface IWorkbenchPart
dispose
in class WorkbenchPart
protected void editorActivated(IEditorPart editor)
editor
- the active editorprotected void fillContextMenu(IMenuManager menu)
public FrameList getFrameList()
IResourceNavigator
getFrameList
in interface IResourceNavigator
protected IAdaptable getInitialInput()
public ResourcePatternFilter getPatternFilter()
getPatternFilter
in interface IResourceNavigator
public IWorkingSet getWorkingSet()
getWorkingSet
in interface IResourceNavigator
public AbstractUIPlugin getPlugin()
public ResourceSorter getSorter()
getComparator()
setComparator(ResourceComparator)
, this method will return
null
.getSorter
in interface IResourceNavigator
public ResourceComparator getComparator()
setSorter(ResourceSorter)
, this method will return
null
.getComparator
in interface IResourceNavigator
ResourceComparator
public TreeViewer getViewer()
getViewer
in interface IResourceNavigator
public TreeViewer getTreeViewer()
public Shell getShell()
protected String getStatusLineMessage(IStructuredSelection selection)
selection
- the current selectionprotected void handleOpen(OpenEvent event)
handleOpen(ISelection)
event
- the open eventprotected void handleOpen(ISelection selection)
selection
- the selectionprotected void handleDoubleClick(DoubleClickEvent event)
event
- the double-click eventprotected void handleSelectionChanged(SelectionChangedEvent event)
event
- the selection eventprotected void handleKeyPressed(KeyEvent event)
event
- the key eventprotected void handleKeyReleased(KeyEvent event)
event
- the key eventpublic void init(IViewSite site, IMemento memento) throws PartInitException
IViewPart
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.
init
in interface IViewPart
init
in class ViewPart
site
- the view sitememento
- the IViewPart state or null if there is no previous saved statePartInitException
- if this view was not initialized successfullyprotected void initDragAndDrop()
protected FrameList createFrameList()
protected void initResourceSorter()
initResourceComparator()
insteadprotected void initResourceComparator()
protected void initWorkingSetFilter()
public boolean isLinkingEnabled()
isLinkingEnabled
in interface IResourceNavigator
true
if linking is enabled, false
if notprotected void linkToEditor(IStructuredSelection selection)
linkToEditor(ISelection)
protected void linkToEditor(ISelection selection)
protected void makeActions()
protected void restoreState(IMemento memento)
memento
- the mementopublic void saveState(IMemento memento)
IViewPart
saveState
in interface IPersistable
saveState
in interface IViewPart
saveState
in class ViewPart
memento
- a memento to receive the object stateViewPart.saveState(org.eclipse.ui.IMemento)
public void selectReveal(ISelection selection)
selectReveal
in interface ISetSelectionTarget
selection
- the new element to selectpublic void setFiltersPreference(String[] patterns)
patterns
in the preference store.setFiltersPreference
in interface IResourceNavigator
patterns
- filter patterns to use on contents of the resource navigatorpublic void setFocus()
IWorkbenchPart
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
.
setFocus
in interface IWorkbenchPart
setFocus
in class WorkbenchPart
IWorkbenchPart.setFocus()
public void setLabelDecorator(ILabelDecorator decorator)
As of 2.0, this method no longer has any effect.
decorator
- a label decorator or null
for no decorations.public void setLinkingEnabled(boolean enabled)
IResourceNavigator
setLinkingEnabled
in interface IResourceNavigator
enabled
- true
to enable, false
to disableIResourceNavigator.setLinkingEnabled(boolean)
public void setSorter(ResourceSorter sorter)
setComparator(ResourceComparator)
setSorter
in interface IResourceNavigator
sorter
- the resource sorterpublic void setComparator(ResourceComparator comparator)
setComparator
in interface IResourceNavigator
comparator
- the resource comparatorpublic void setWorkingSet(IWorkingSet workingSet)
IResourceNavigator
null
to clear it.setWorkingSet
in interface IResourceNavigator
workingSet
- the working set, or null
to clear itprotected void updateActionBars(IStructuredSelection selection)
selection
- the current selectionprotected void updateStatusLine(IStructuredSelection selection)
selection
- the current selectionpublic void updateTitle()
protected ResourceNavigatorActionGroup getActionGroup()
protected void setActionGroup(ResourceNavigatorActionGroup actionGroup)
actionGroup
- the action grouppublic Object getAdapter(Class adapter)
WorkbenchPart
null
if
no such object can be found.
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).getAdapter
in interface IAdaptable
getAdapter
in class WorkbenchPart
adapter
- the adapter class to look upnull
if this object does not
have an adapter for the given classprotected IShowInSource getShowInSource()
IShowInSource
for this view.protected IShowInTarget getShowInTarget()
IShowInTarget
for this view.protected static final Object getSingleElement(ISelection s)
s
- the selection
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.