|
Eclipse Platform Release 3.2 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.eclipse.ui.part.WorkbenchPart
org.eclipse.ui.part.ViewPart
org.eclipse.ui.views.navigator.ResourceNavigator
public class 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()
The WorkbenchPart implementation of this
IWorkbenchPart method disposes the title image
loaded by setInitializationData. |
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. |
Object |
getAdapter(Class adapter)
Returns an object which is an instance of the given class associated with this object. 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). |
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() |
protected IShowInSource |
getShowInSource()
Returns the IShowInSource for this view. |
protected IShowInTarget |
getShowInTarget()
Returns the IShowInTarget for this view. |
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 void |
initWorkingSetFilter()
Restores the working set filter from the persistence store. |
boolean |
isLinkingEnabled()
Returns whether the navigator selection automatically tracks the active editor. |
protected void |
linkToEditor(IStructuredSelection selection)
Brings the corresponding editor to top if the selected resource is open. |
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 state of the object in the given memento. |
void |
selectReveal(ISelection selection)
Selects and reveals the specified elements. |
protected void |
setActionGroup(ResourceNavigatorActionGroup actionGroup)
Sets the action group. |
void |
setFiltersPreference(String[] patterns)
Saves the filters defined as strings in patterns
in the preference store. |
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 |
setLinkingEnabled(boolean enabled)
Sets whether this navigator's selection automatically tracks the active editor. |
void |
setSorter(ResourceSorter sorter)
Sets the resource sorter. |
void |
setWorkingSet(IWorkingSet workingSet)
Sets the working set for this view, or null to clear it. |
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 |
|---|
checkSite, getViewSite, init, setContentDescription, setInitializationData, setPartName |
| Methods inherited from class org.eclipse.ui.part.WorkbenchPart |
|---|
addPropertyListener, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, 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 |
|---|
public static final String NAVIGATOR_VIEW_HELP_ID
| Constructor Detail |
|---|
public ResourceNavigator()
| Method Detail |
|---|
public void createPartControl(Composite parent)
IWorkbenchPartClients 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 IWorkbenchPartcreatePartControl in class WorkbenchPartparent - 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()
WorkbenchPartWorkbenchPart implementation of this
IWorkbenchPart method disposes the title image
loaded by setInitializationData. Subclasses may extend.
dispose in interface IWorkbenchPartdispose in class WorkbenchPartprotected void editorActivated(IEditorPart editor)
editor - the active editorprotected void fillContextMenu(IMenuManager menu)
public FrameList getFrameList()
IResourceNavigator
getFrameList in interface IResourceNavigatorprotected IAdaptable getInitialInput()
public ResourcePatternFilter getPatternFilter()
getPatternFilter in interface IResourceNavigatorpublic IWorkingSet getWorkingSet()
getWorkingSet in interface IResourceNavigatorpublic AbstractUIPlugin getPlugin()
public ResourceSorter getSorter()
getSorter in interface IResourceNavigatorpublic TreeViewer getViewer()
getViewer in interface IResourceNavigatorpublic 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 event
public void init(IViewSite site,
IMemento memento)
throws PartInitException
IViewPartThis 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 IViewPartinit in class ViewPartsite - 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 void initWorkingSetFilter()
public boolean isLinkingEnabled()
isLinkingEnabled in interface IResourceNavigatortrue if linking is enabled, false
if notprotected void linkToEditor(IStructuredSelection selection)
protected void makeActions()
protected void restoreState(IMemento memento)
memento - the mementopublic void saveState(IMemento memento)
IPersistable
saveState in interface IPersistablesaveState in interface IViewPartsaveState in class ViewPartmemento - the storage area for object's stateViewPart.saveState(org.eclipse.ui.IMemento)public void selectReveal(ISelection selection)
selectReveal in interface ISetSelectionTargetselection - the new element to selectpublic void setFiltersPreference(String[] patterns)
patterns
in the preference store.
setFiltersPreference in interface IResourceNavigatorpublic 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 IWorkbenchPartsetFocus in class WorkbenchPartIWorkbenchPart.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 IResourceNavigatorenabled - true to enable, false to disableIResourceNavigator.setLinkingEnabled(boolean)public void setSorter(ResourceSorter sorter)
setSorter in interface IResourceNavigatorsorter - the resource sorterpublic void setWorkingSet(IWorkingSet workingSet)
IResourceNavigatornull to clear it.
setWorkingSet in interface IResourceNavigatorworkingSet - 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)
WorkbenchPartnull 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 IAdaptablegetAdapter in class WorkbenchPartadapter - the adapter class to look up
null 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.
|
Eclipse Platform Release 3.2 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.