Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancis Upton IV2009-02-10 06:44:52 +0000
committerFrancis Upton IV2009-02-10 06:44:52 +0000
commitf00b5bf0817dd4d70870db6a0ec0372266ad7748 (patch)
tree1eccf5198b6fc60f09a671dbfcd7f0d2276fb5ff /bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigator.java
parentc9596c6a19c855dd999edc26208eb5a68dc0d603 (diff)
downloadeclipse.platform.ui-f00b5bf0817dd4d70870db6a0ec0372266ad7748.tar.gz
eclipse.platform.ui-f00b5bf0817dd4d70870db6a0ec0372266ad7748.tar.xz
eclipse.platform.ui-f00b5bf0817dd4d70870db6a0ec0372266ad7748.zip
bug 162986 [CommonNavigator] Should have a simple way to create the navigator with SWT.SINGLE
Diffstat (limited to 'bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigator.java')
-rw-r--r--bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigator.java30
1 files changed, 24 insertions, 6 deletions
diff --git a/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigator.java b/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigator.java
index c325cd9ce64..29817ded32d 100644
--- a/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigator.java
+++ b/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigator.java
@@ -135,7 +135,12 @@ public class CommonNavigator extends ViewPart implements ISetSelectionTarget, IS
private ActionGroup commonActionGroup;
- private IMemento memento;
+ /**
+ * To allow {@link #createCommonViewer(Composite)} to be subclassed
+ *
+ * @since 3.4
+ */
+ protected IMemento memento;
private boolean isLinkingEnabled = false;
@@ -444,26 +449,39 @@ public class CommonNavigator extends ViewPart implements ISetSelectionTarget, IS
}
/**
- * <p>
- * Constructs and returns an instance of {@link CommonViewer}. The ID of
+ * Creates and initializes an instance of {@link 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.
- * <p>
*
* @param aParent
* A composite parent to contain the Common Viewer
* @return An initialized instance of CommonViewer
*/
protected CommonViewer createCommonViewer(Composite aParent) {
- CommonViewer aViewer = new CommonViewer(getViewSite().getId(), aParent,
- SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+ CommonViewer aViewer = createCommonViewerObject(aParent);
initListeners(aViewer);
aViewer.getNavigatorContentService().restoreState(memento);
return aViewer;
}
/**
+ * Constructs and returns an instance of {@link CommonViewer}. The ID of
+ * the Eclipse view part will be used to create the viewer.
+ *
+ * Override this method if you want a subclass of the CommonViewer
+ *
+ * @param aParent
+ * A composite parent to contain the CommonViewer
+ * @return An instance of CommonViewer
+ * @since 3.4
+ */
+ protected CommonViewer createCommonViewerObject(Composite aParent) {
+ return new CommonViewer(getViewSite().getId(), aParent,
+ SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+ }
+
+ /**
* <p>
* Adds the listeners to the Common Viewer.
* </p>

Back to the top