Class ProjectExplorer
- All Implemented Interfaces:
IAdaptable,IExecutableExtension,IPersistable,ISaveablePart,ISaveablesSource,ISecondarySaveableSource,IViewPart,IWorkbenchPart,IWorkbenchPart2,IWorkbenchPart3,ISetSelectionTarget,IShowInTarget,IWorkbenchPartOrientation
- Since:
- 3.2
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final StringProvides a constant for the standard instance of the Common Navigator.static final intFields inherited from class org.eclipse.ui.navigator.CommonNavigator
IS_LINKING_ENABLED_PROPERTY, mementoFields inherited from interface org.eclipse.ui.ISaveablePart
PROP_DIRTYFields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ActionGroupThe 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 createdprotected CommonViewercreateCommonViewer(Composite aParent) Creates and initializes an instance ofCommonViewer.voidcreatePartControl(Composite aParent) Create the CommonViewer part control and setup the default providers as necessary.Saveable[]Returns the saveables currently active in the workbench part.getFrameToolTipText(Object element) Returns the tool tip text for the given element.intSaveable[]Returns the saveables presented by the workbench part.protected voidhandleDoubleClick(DoubleClickEvent anEvent) Note: This method is for internal use only.voidNote: This method is for internal use only.protected voidinitListeners(TreeViewer viewer) Adds the listeners to the Common Viewer.booleanWhether the dirty state changes should be supported by the framework if the part directly implementsISecondarySaveableSource.voidNote: This method is for internal use only.voidsetRootMode(int mode) voidsetWorkingSetLabel(String label) voidThe superclass does not deal with the content description, handle it here.Methods inherited from class org.eclipse.ui.navigator.CommonNavigator
createCommonManager, createCommonViewerObject, dispose, doSave, doSaveAs, getAdapter, getCommonViewer, getInitialInput, getLinkHelperService, getMemento, getNavigatorActionService, getNavigatorContentService, hasSaveablesProvider, isDirty, isLinkingEnabled, isSaveAsAllowed, isSaveOnCloseNeeded, selectReveal, setFocus, setLinkingEnabled, showMethods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, setContentDescription, setInitializationData, setPartNameMethods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusyMethods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
-
Field Details
-
VIEW_ID
Provides a constant for the standard instance of the Common Navigator.- See Also:
-
WORKING_SETS
public static final int WORKING_SETS- Since:
- 3.4
- See Also:
-
PROJECTS
public static final int PROJECTS- Since:
- 3.4
- See Also:
-
-
Constructor Details
-
ProjectExplorer
public ProjectExplorer()
-
-
Method Details
-
init
Description copied from class:CommonNavigatorNote: This method is for internal use only. Clients should not call this method.
- Specified by:
initin interfaceIViewPart- Overrides:
initin classCommonNavigator- Parameters:
site- the view sitememento- the IViewPart state or null if there is no previous saved state- Throws:
PartInitException- if this view was not initialized successfully- See Also:
-
saveState
Description copied from class:CommonNavigatorNote: This method is for internal use only. Clients should not call this method.
- Specified by:
saveStatein interfaceIPersistable- Specified by:
saveStatein interfaceIViewPart- Overrides:
saveStatein classCommonNavigator- Parameters:
aMemento- a memento to receive the object state- See Also:
-
createPartControl
Description copied from class:CommonNavigatorCreate the CommonViewer part control and setup the default providers as necessary.
- Specified by:
createPartControlin interfaceIWorkbenchPart- Overrides:
createPartControlin classCommonNavigator- Parameters:
aParent- the parent control- See Also:
-
createCommonActionGroup
Description copied from class:CommonNavigatorThe 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.
- Overrides:
createCommonActionGroupin classCommonNavigator- Returns:
- The Action Group to be associated with the Common Navigator View Part.
-
-
updateTitle
public void updateTitle()The superclass does not deal with the content description, handle it here.- Overrides:
updateTitlein classCommonNavigator- Restriction:
- This method is not intended to be referenced by clients.
-
getFrameToolTipText
Returns the tool tip text for the given element.- Overrides:
getFrameToolTipTextin classCommonNavigator- Parameters:
element- the element- Returns:
- the tooltip
- Restriction:
- This method is not intended to be referenced by clients.
-
setRootMode
public void setRootMode(int mode) - Overrides:
setRootModein classCommonNavigator- Parameters:
mode- root mode to set- Since:
- 3.4
- Restriction:
- This method is not intended to be referenced by clients.
-
getRootMode
public int getRootMode()- Overrides:
getRootModein classCommonNavigator- Returns:
- the root mode
- Since:
- 3.4
- Restriction:
- This method is not intended to be referenced by clients.
-
setWorkingSetLabel
- Overrides:
setWorkingSetLabelin classCommonNavigator- Parameters:
label- working set label- Since:
- 3.4
- Restriction:
- This method is not intended to be referenced by clients.
-
getWorkingSetLabel
- Overrides:
getWorkingSetLabelin classCommonNavigator- Returns:
- the working set label
- Since:
- 3.4
- Restriction:
- This method is not intended to be referenced by clients.
-
handleDoubleClick
Description copied from class:CommonNavigatorNote: This method is for internal use only. Clients should not call this method.
- Overrides:
handleDoubleClickin classCommonNavigator- Parameters:
anEvent- Supplied by the DoubleClick listener.
-
createCommonViewer
Description copied from class:CommonNavigatorCreates and initializes an instance ofCommonViewer. 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.- Overrides:
createCommonViewerin classCommonNavigator- Parameters:
aParent- A composite parent to contain the Common Viewer- Returns:
- An initialized instance of CommonViewer
-
getSaveables
Description copied from interface:ISaveablesSourceReturns the saveables presented by the workbench part. If the return value of this method changes during the lifetime of this part (i.e. after initialization and control creation but before disposal) the part must notify an implicit listener usingISaveablesLifecycleListener.handleLifecycleEvent(SaveablesLifecycleEvent).Additions of saveables to the list of saveables of this part are announced using an event of type
SaveablesLifecycleEvent.POST_OPEN. Removals are announced in a two-stage process, first using an event of typeSaveablesLifecycleEvent.PRE_CLOSEfollowed by an event of typeSaveablesLifecycleEvent.POST_CLOSE. Since firing thePRE_CLOSEevent may trigger prompts to save dirty saveables, the cancellation status of the event must be checked by the part after the notification. When removing only non-dirty saveables,POST_CLOSEnotification is sufficient.The listener is obtained from the part site by calling
partSite.getService(ISaveablesLifecycleListener.class).The part must not notify from its initialization methods (e.g.
initorcreatePartControl), or from its dispose method. Parts that implementIReusableEditormust notify when their input is changed throughIReusableEditor.setInput(IEditorInput).- Specified by:
getSaveablesin interfaceISaveablesSource- Overrides:
getSaveablesin classCommonNavigator- Returns:
- the saveables presented by the workbench part
- See Also:
-
getActiveSaveables
Description copied from interface:ISaveablesSourceReturns the saveables currently active in the workbench part.Certain workbench actions, such as Save, target only the active saveables in the active part. For example, the active saveables could be determined based on the current selection in the part.
- Specified by:
getActiveSaveablesin interfaceISaveablesSource- Overrides:
getActiveSaveablesin classCommonNavigator- Returns:
- the saveables currently active in the workbench part
-
isDirtyStateSupported
public boolean isDirtyStateSupported()Description copied from interface:ISecondarySaveableSourceWhether the dirty state changes should be supported by the framework if the part directly implementsISecondarySaveableSource.If the part providing the adapter is not implementing
ISecondarySaveableSource, return value defines the default behavior of "secondary" parts connected to this part.- Specified by:
isDirtyStateSupportedin interfaceISecondarySaveableSource- Returns:
- default implementation returns
false
-
initListeners
Description copied from class:CommonNavigatorAdds the listeners to the Common Viewer.
- Overrides:
initListenersin classCommonNavigator- Parameters:
viewer- The viewer
-