public class CommonNavigator extends ViewPart implements ISetSelectionTarget,ISaveablePart,ISaveablesSource,IShowInTarget(Code)
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:
org.eclipse.ui.navigator.CommonViewer : The viewer that renders the
extensible tree. Creates and manages the lifecylce of the Navigator Content
Service (described below).
org.eclipse.ui.navigator.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:
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.
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.
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.
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.
The Action Group to be associated with the Common Navigator ViewPart.
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.
The Common Navigator Manager class which handles menu populationand ActionBars
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.
Parameters: aParent - A composite parent to contain the Common Viewer An initialized instance of CommonViewer
createPartControl
public void createPartControl(Composite aParent)(Code)
Create the CommonViewer part control and setup the default providers as
necessary.
See Also: org.eclipse.ui.part.WorkbenchPart.createPartControl(org.eclipse.swt.widgets.Composite)
Returns an object which is an instance of the given class
associated with this object. Returns null if
no such object can be found.
Parameters: adapter - the adapter class to look up a object castable to the given class, or null if this object does nothave an adapter for the given class
Provides access to the commonViewer used by the current CommonNavigator.
The field will not be valid until after
CommonNavigator.init(IViewSite,IMemento) has been called by the
Workbench.
Note: This method is for internal use only. Clients should not call this
method.
See Also: org.eclipse.ui.part.ViewPart.saveState(org.eclipse.ui.IMemento)
selectReveal
public void selectReveal(ISelection selection)(Code)
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.
See Also: org.eclipse.ui.part.ISetSelectionTarget.selectReveal(org.eclipse.jface.viewers.ISelection)
Force the workbench to focus on the Common Navigator tree.
See Also: org.eclipse.ui.part.WorkbenchPart.setFocus
setLinkingEnabled
final public void setLinkingEnabled(boolean toEnableLinking)(Code)
Linking is handled by an action which listens for
changes to the
CommonNavigator.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.
Parameters: toEnableLinking - True enables linking the current selection with open editors