|
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.navigator.CommonNavigator
This class provides the IViewPart for the Common Navigator framework in the Eclipse workbench. This class also serves as the backbone for navigational viewers. The following types are used by this class to render the Common Navigator:
CommonViewer: The viewer that renders the
extensible tree. Creates and manages the lifecylce of the Navigator Content
Service (described below).
NavigatorActionService: Manages instances
of CommonActionProviders provided by
individual extensions and content extensions.
INavigatorContentService: Manages instances
of Navigator Content Extensions. Instances are created as needed, and
disposed of upon the disposal of the Navigator Content Service.
Clients are not expected to subclass CommonNavigator. Clients that wish to define their own custom extensible navigator view need to specify an instance of the org.eclipse.ui.views extension point:
<extension
point="org.eclipse.ui.views">
<view
name="My Custom View"
icon="relative/path/to/icon.gif"
category="org.acme.mycategory"
class="org.eclipse.ui.navigator.CommonNavigator"
id="org.acme.MyCustomNavigatorID">
</view>
</extension>
Clients that wish to extend the view menu provided via the
org.eclipse.ui.popupMenus extension may specify the the popupMenuId
specified by org.eclipse.ui.navigator.viewer (or a nested popupMenu element) of their target viewer
as their target menu id.
This class may be instantiated; it is not intended to be subclassed.
| Field Summary | |
|---|---|
static int |
IS_LINKING_ENABLED_PROPERTY
Used to track changes to the isLinkingEnabled() property.
|
| Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
|---|
PROP_TITLE |
| Constructor Summary | |
|---|---|
CommonNavigator()
|
|
| Method Summary | |
|---|---|
protected ActionGroup |
createCommonActionGroup()
The ActionGroup is used to populate the ActionBars of Common Navigator View Part, and the returned implementation will have an opportunity to fill the ActionBars of the view as soon as it is created. |
protected org.eclipse.ui.internal.navigator.CommonNavigatorManager |
createCommonManager()
The Common Navigator Manager handles the setup of the Common Navigator Menu, manages updates to the ActionBars from CommonActionProvider extensions as the user's selection
changes, and also updates the status bar based on the current selection. |
protected CommonViewer |
createCommonViewer(Composite aParent)
Constructs and returns an instance of CommonViewer. |
protected DisposeListener |
createDisposeListener()
|
void |
createPartControl(Composite aParent)
Create the CommonViewer part control and setup the default providers as necessary. |
void |
dispose()
Note: This method is for internal use only. |
Object |
getAdapter(Class adapter)
Returns an object which is an instance of the given class associated with this object. |
CommonViewer |
getCommonViewer()
Provides access to the commonViewer used by the current CommonNavigator. |
protected String |
getFrameToolTipText(Object anElement)
Returns the tool tip text for the given element. |
protected IAdaptable |
getInitialInput()
|
NavigatorActionService |
getNavigatorActionService()
|
INavigatorContentService |
getNavigatorContentService()
|
protected void |
handleDoubleClick(DoubleClickEvent anEvent)
Note: This method is for internal use only. |
void |
init(IViewSite aSite,
IMemento aMemento)
Note: This method is for internal use only. |
protected void |
initListeners(TreeViewer viewer)
Adds the listeners to the Common Viewer. |
boolean |
isLinkingEnabled()
|
void |
saveState(IMemento aMemento)
Note: This method is for internal use only. |
void |
selectReveal(ISelection selection)
Set the selection to the Common Navigator tree, and expand nodes if necessary. |
void |
setFocus()
Force the workbench to focus on the Common Navigator tree. |
void |
setLinkingEnabled(boolean toEnableLinking)
Linking is handled by an action which listens for changes to the IS_LINKING_ENABLED_PROPERTY.
|
protected 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.IWorkbenchPart |
|---|
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener |
| Field Detail |
public static final int IS_LINKING_ENABLED_PROPERTY
Used to track changes to the isLinkingEnabled() property.
| Constructor Detail |
public CommonNavigator()
| Method Detail |
public void createPartControl(Composite aParent)
Create the CommonViewer part control and setup the default providers as necessary.
createPartControl in interface IWorkbenchPartcreatePartControl in class WorkbenchPartWorkbenchPart.createPartControl(org.eclipse.swt.widgets.Composite)public void dispose()
Note: This method is for internal use only. Clients should not call this method.
This method will be invoked when the DisposeListener is notified of the disposal of the Eclipse view part.
dispose in interface IWorkbenchPartdispose in class WorkbenchPartWorkbenchPart.dispose()
public void init(IViewSite aSite,
IMemento aMemento)
throws PartInitException
Note: This method is for internal use only. Clients should not call this method.
init in interface IViewPartinit in class ViewPartPartInitExceptionViewPart.init(org.eclipse.ui.IViewSite,
org.eclipse.ui.IMemento)public void saveState(IMemento aMemento)
Note: This method is for internal use only. Clients should not call this method.
saveState in interface IViewPartsaveState in class ViewPartViewPart.saveState(org.eclipse.ui.IMemento)public void setFocus()
Force the workbench to focus on the Common Navigator tree.
setFocus in interface IWorkbenchPartsetFocus in class WorkbenchPartWorkbenchPart.setFocus()public void selectReveal(ISelection selection)
Set the selection to the Common Navigator tree, and expand nodes if necessary. Use caution when invoking this method as it can cause Navigator Content Extensions to load, thus causing plugin activation.
selectReveal in interface ISetSelectionTargetselection - the new element to selectISetSelectionTarget.selectReveal(org.eclipse.jface.viewers.ISelection)public final void setLinkingEnabled(boolean toEnableLinking)
Linking is handled by an action which listens for
changes to the IS_LINKING_ENABLED_PROPERTY.
Custom implementations that wish to override this functionality, need to
override the action used by the default ActionGroup and listen for
changes to the above property.
toEnableLinking - True enables linking the current selection with open editorspublic final boolean isLinkingEnabled()
public CommonViewer getCommonViewer()
Provides access to the commonViewer used by the current CommonNavigator.
The field will not be valid until after
init(IViewSite, IMemento) has been called by the
Workbench.
public INavigatorContentService getNavigatorContentService()
public Object getAdapter(Class adapter)
null if
no such object can be found.
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 classpublic NavigatorActionService getNavigatorActionService()
protected CommonViewer createCommonViewer(Composite aParent)
Constructs and returns an instance of CommonViewer. The ID of
the Eclipse view part will be used to create the viewer. The ID is
important as some extensions indicate they should only be used with a
particular viewer ID.
aParent - A composite parent to contain the Common Viewer
protected void initListeners(TreeViewer viewer)
Adds the listeners to the Common Viewer.
viewer - The viewerprotected void handleDoubleClick(DoubleClickEvent anEvent)
Note: This method is for internal use only. Clients should not call this method.
anEvent - Supplied by the DoubleClick listener.protected org.eclipse.ui.internal.navigator.CommonNavigatorManager createCommonManager()
The Common Navigator Manager handles the setup of the Common Navigator
Menu, manages updates to the ActionBars from
CommonActionProvider extensions as the user's selection
changes, and also updates the status bar based on the current selection.
protected ActionGroup createCommonActionGroup()
The ActionGroup is used to populate the ActionBars of Common Navigator
View Part, and the returned implementation will have an opportunity to
fill the ActionBars of the view as soon as it is created. (ActionGroup.fillActionBars(org.eclipse.ui.IActionBars).
The default implementation returns an action group which will add the following actions:
Link with editor support. Allows the user to toggling linking the current selection with the active editors.
Collapse all. Collapses all expanded nodes.
Select Filters. Provides access to the "Select Filters" dialog that allows users to enable/disable filters and also the Content Extension activations.
protected DisposeListener createDisposeListener()
protected IAdaptable getInitialInput()
protected void updateTitle()
Updates the title text and title tool tip. Called whenever the input of the viewer changes.
protected String getFrameToolTipText(Object anElement)
Returns the tool tip text for the given element. Used as the tool tip text for the current frame, and for the view title tooltip.
|
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.