|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.ui.part.WorkbenchPart | +--org.eclipse.ui.part.ViewPart | +--org.eclipse.ui.views.navigator.ResourceNavigator
Implements the Resource Navigator view.
Field Summary | |
static String |
NAVIGATOR_VIEW_HELP_ID
Deprecated. No longer used but preserved to avoid an api change. |
Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
PROP_TITLE |
Constructor Summary | |
ResourceNavigator()
Constructs a new resource navigator view. |
Method Summary | |
protected FrameList |
createFrameList()
Creates the frame source and frame list, and connects them. |
void |
createPartControl(Composite parent)
Creates the SWT controls for this workbench part. |
protected TreeViewer |
createViewer(Composite parent)
Creates the viewer. |
void |
dispose()
Disposes of this workbench part. |
protected void |
editorActivated(IEditorPart editor)
An editor has been activated. |
protected void |
fillContextMenu(IMenuManager menu)
Called when the context menu is about to open. |
protected ResourceNavigatorActionGroup |
getActionGroup()
Returns the action group. |
FrameList |
getFrameList()
Returns the frame list for this navigator. |
protected String |
getHelpContextId()
Returns the help context id to use for this view. |
protected IAdaptable |
getInitialInput()
Returns the initial input for the viewer. |
ResourcePatternFilter |
getPatternFilter()
Returns the pattern filter for this view. |
AbstractUIPlugin |
getPlugin()
Returns the navigator's plugin. |
Shell |
getShell()
Deprecated. use getViewSite().getShell() |
ResourceSorter |
getSorter()
Returns the sorter. |
protected String |
getStatusLineMessage(IStructuredSelection selection)
Returns the message to show in the status line. |
TreeViewer |
getTreeViewer()
Returns the tree viewer which shows the resource hierarchy. |
TreeViewer |
getViewer()
Returns the resource viewer which shows the resource hierarchy. |
IWorkingSet |
getWorkingSet()
Returns the working set for this view. |
protected void |
handleDoubleClick(DoubleClickEvent event)
Handles a double-click event from the viewer. |
protected void |
handleKeyPressed(KeyEvent event)
Handles a key press event from the viewer. |
protected void |
handleKeyReleased(KeyEvent event)
Handles a key release in the viewer. |
protected void |
handleOpen(OpenEvent event)
Handles an open event from the viewer. |
protected void |
handleSelectionChanged(SelectionChangedEvent event)
Handles a selection changed event from the viewer. |
void |
init(IViewSite site,
IMemento memento)
Initializes this view with the given view site. |
protected void |
initContentProvider(TreeViewer viewer)
Sets the content provider for the viewer. |
protected void |
initContextMenu()
Initializes and registers the context menu. |
protected void |
initDragAndDrop()
Adds drag and drop support to the navigator. |
protected void |
initFilters(TreeViewer viewer)
Adds the filters to the viewer. |
protected void |
initLabelProvider(TreeViewer viewer)
Sets the label provider for the viewer. |
protected void |
initListeners(TreeViewer viewer)
Adds the listeners to the viewer. |
protected void |
initResourceSorter()
Initializes the sorter. |
protected boolean |
isLinkingEnabled()
Returns whether the preference to link navigator selection to active editor is enabled. |
protected void |
linkToEditor(IStructuredSelection selection)
Links to editor (if option enabled). |
protected void |
makeActions()
Creates the action group, which encapsulates all actions for the view. |
protected void |
restoreState(IMemento memento)
Restores the state of the receiver to the state described in the specified memento. |
void |
saveState(IMemento memento)
Saves the object state within a memento. |
void |
selectReveal(ISelection selection)
Selects and reveals the specified elements. |
protected void |
setActionGroup(ResourceNavigatorActionGroup actionGroup)
Sets the action group. |
void |
setFiltersPreference(String[] patterns)
Sets the values of the filter preference to be the strings in preference values |
void |
setFocus()
Asks this part to take focus within the workbench. |
void |
setLabelDecorator(ILabelDecorator decorator)
Deprecated. use the decorators extension point instead; see IWorkbench.getDecoratorManager() |
void |
setSorter(ResourceSorter sorter)
Sets the resource sorter. |
void |
setWorkingSet(IWorkingSet workingSet)
Implements IResourceNavigatorPart |
protected void |
updateActionBars(IStructuredSelection selection)
Updates the action bar actions. |
protected void |
updateStatusLine(IStructuredSelection selection)
Updates the message shown in the status line. |
void |
updateTitle()
Updates the title text and title tool tip. |
Methods inherited from class org.eclipse.ui.part.ViewPart |
getViewSite, init |
Methods inherited from class org.eclipse.ui.part.WorkbenchPart |
addPropertyListener, firePropertyChange, getAdapter, getConfigurationElement, getDefaultImage, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setInitializationData, setSite, setTitle, setTitleImage, setTitleToolTip |
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 |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
getAdapter |
Field Detail |
public static final String NAVIGATOR_VIEW_HELP_ID
Constructor Detail |
public ResourceNavigator()
Method Detail |
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:
IActionService
.IActionService
.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()
IWorkbenchPart
This is the last method called on the IWorkbenchPart
. At this
point the part controls (if they were ever created) have been disposed as part
of an SWT composite. There is no guarantee that createPartControl() has been
called, so the part controls may never have been created.
Within this method a part may release any resources, fonts, images, etc. held by this part. It is also very important to deregister all listeners from the workbench.
Clients should not call this method (the workbench calls this method at appropriate times).
dispose
in interface IWorkbenchPart
dispose
in class WorkbenchPart
protected void editorActivated(IEditorPart editor)
protected void fillContextMenu(IMenuManager menu)
public FrameList getFrameList()
IResourceNavigator
getFrameList
in interface IResourceNavigator
IResourceNavigatorPart
protected IAdaptable getInitialInput()
public ResourcePatternFilter getPatternFilter()
getPatternFilter
in interface IResourceNavigator
public IWorkingSet getWorkingSet()
getWorkingSet
in interface IResourceNavigator
public AbstractUIPlugin getPlugin()
public ResourceSorter getSorter()
getSorter
in interface IResourceNavigator
public TreeViewer getViewer()
getViewer
in interface IResourceNavigator
public TreeViewer getTreeViewer()
public Shell getShell()
protected String getStatusLineMessage(IStructuredSelection selection)
selection
- the current selection
protected void handleOpen(OpenEvent event)
event
- the open eventprotected 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 part construction. 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 state
PartInitException
- if this view was not initialized successfullyprotected void initDragAndDrop()
protected FrameList createFrameList()
protected void initResourceSorter()
protected boolean isLinkingEnabled()
protected void linkToEditor(IStructuredSelection selection)
protected void makeActions()
protected void restoreState(IMemento memento)
memento
- the mementopublic void saveState(IMemento memento)
IViewPart
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)
setFiltersPreference
in interface IResourceNavigator
public void setFocus()
IWorkbenchPart
Clients should not call this method (the workbench calls this method at appropriate times).
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 setSorter(ResourceSorter sorter)
setSorter
in interface IResourceNavigator
sorter
- the resource sorterpublic void setWorkingSet(IWorkingSet workingSet)
setWorkingSet
in interface IResourceNavigator
workingSet
- the working set, or null
to clear itorg.eclipse.ui.views.navigator.IResourceNavigatorPart#setWorkingSet(IWorkingSet)
protected 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 group
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |