001: /*******************************************************************************
002: * Copyright (c) 2005, 2006 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.ui.navigator;
011:
012: import org.eclipse.jface.action.GroupMarker;
013: import org.eclipse.jface.action.Separator;
014:
015: /**
016: * Provides a basic metadata about the abstract viewer for a particular content
017: * service.
018: *
019: * <p>
020: * This interface is not intended to be implemented by clients.
021: * </p>
022: *
023: * @since 3.2
024: *
025: */
026: public interface INavigatorViewerDescriptor {
027:
028: /**
029: * {@value} (boolean): True indicates the
030: * "Available Extensions" tab in the "Available Customizations" dialog
031: * should not be available for the user (defaults to <b>false</b>).
032: *
033: */
034: String PROP_HIDE_AVAILABLE_EXT_TAB = "org.eclipse.ui.navigator.hideAvailableExtensionsTab"; //$NON-NLS-1$
035:
036: /**
037: * {@value} (boolean): True
038: * indicates the entire "Available Customizations" dialog should not be
039: * available for the user (defaults to <b>false</b>).
040: */
041: String PROP_HIDE_AVAILABLE_CUSTOMIZATIONS_DIALOG = "org.eclipse.ui.navigator.hideAvailableCustomizationsDialog"; //$NON-NLS-1$
042:
043: /**
044: * {@value} (boolean): True indicates the
045: * "Collapse All" button should not be available for the user (defaults to
046: * <b>false</b>).
047: */
048: String PROP_HIDE_COLLAPSE_ALL_ACTION = "org.eclipse.ui.navigator.hideCollapseAllAction"; //$NON-NLS-1$
049:
050: /**
051: * {@value} (boolean): True indicates
052: * the "Link With Editor" action should not be available for the user
053: * (defaults to <b>false</b>).
054: */
055: String PROP_HIDE_LINK_WITH_EDITOR_ACTION = "org.eclipse.ui.navigator.hideLinkWithEditorAction"; //$NON-NLS-1$
056:
057: /**
058: * Returns the id of the viewer targeted by this extension.
059: *
060: * @return the id of the viewer targeted by this extension.
061: */
062: String getViewerId();
063:
064: /**
065: * The default value of the popup menu id is the viewer id. Clients may
066: * override this value using a <b>navigatorConfiguration</b> extension.
067: *
068: * @return The id of the context menu of the viewer.
069: */
070: String getPopupMenuId();
071:
072: /**
073: * Returns true if the content extension of the given id is 'visible'. A
074: * content extension is 'visible' if it matches a viewerContentBinding for
075: * the given viewer id.
076: *
077: * @param aContentExtensionId
078: * The id to query
079: * @return True if the content extension matches a viewerContentBinding for
080: * the viewer id of this descriptor.
081: */
082: boolean isVisibleContentExtension(String aContentExtensionId);
083:
084: /**
085: * Returns true if the action extension of the given id is 'visible'. An
086: * action extension is 'visible' if it matches a viewerActionBinding for the
087: * given viewer id.
088: *
089: * @param anActionExtensionId
090: * The id to query
091: * @return True if the action extension matches a viewerActionBinding for
092: * the viewer id of this descriptor.
093: */
094: boolean isVisibleActionExtension(String anActionExtensionId);
095:
096: /**
097: * Returns true if the content extension of the given id matches a
098: * viewerContentBinding extension that declares isRoot as true.
099: *
100: * @param aContentExtensionId
101: * The id to query
102: * @return True if the content extension matches a viewerContentBinding
103: * which declares 'isRoot' as true for the viewer id of this
104: * descriptor.
105: */
106: boolean isRootExtension(String aContentExtensionId);
107:
108: /**
109: * Returns true if there exists at least one matching viewerContentBinding
110: * which declares isRoot as true. This behavior will override the default
111: * enablement for the viewer root.
112: *
113: * @return True if there exists a matching viewerContentBinding which
114: * declares isRoot as true.
115: */
116: boolean hasOverriddenRootExtensions();
117:
118: /**
119: * Returns true by default. A true value indicates that object and view
120: * contributions should be supported by the popup menu of any viewer
121: * described by this viewer descriptor. The value may be overridden from the
122: * <popupMenu /> child element of the <viewer /> element in the
123: * <b>org.eclipse.ui.navigator.viewer</b> extension point.
124: *
125: * @return True if object/view contributions should be allowed or False
126: * otherwise.
127: */
128: boolean allowsPlatformContributionsToContextMenu();
129:
130: /**
131: *
132: * Custom insertion points are declared through a nested 'popupMenu' element
133: * in the <b>org.eclipse.ui.navigator.viewer</b> extension point. Each
134: * insertion point represents either a {@link Separator} or
135: * {@link GroupMarker} in the context menu of the viewer.
136: * <p>
137: *
138: * @return The set of custom insertion points, if any. A null list indicates
139: * the default set (as defined by {@link NavigatorActionService})
140: * should be used. An empty list indicates there are no declarative
141: * insertion points.
142: */
143: MenuInsertionPoint[] getCustomInsertionPoints();
144:
145: /**
146: * @param aPropertyName
147: * A property name corresponding to a configuration option from
148: * <b>org.eclipse.ui.navigator.viewer</b>
149: * @return The unmodified string value returned from the extension (<b>null</b>
150: * is a possible return value).
151: */
152: String getStringConfigProperty(String aPropertyName);
153:
154: /**
155: * @param aPropertyName
156: * A property name corresponding to a configuration option from
157: * <b>org.eclipse.ui.navigator.viewer</b>
158: * @return The boolean value returned from the extension (<b>null</b> is a
159: * possible return value).
160: */
161: boolean getBooleanConfigProperty(String aPropertyName);
162:
163: }
|