Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 49931 Details for
Bug 156928
[CommonNavigator] Make Common Navigator Framework commonWizard extension capabilities-aware
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patches CommonWizardDescriptorManager.isVisible() to check the Eclipse Capabilities activation
org.eclipse.ui.navigator_bug156928.txt (text/plain), 8.15 KB, created by
Michael D. Elder
on 2006-09-12 09:40:37 EDT
(
hide
)
Description:
Patches CommonWizardDescriptorManager.isVisible() to check the Eclipse Capabilities activation
Filename:
MIME Type:
Creator:
Michael D. Elder
Created:
2006-09-12 09:40:37 EDT
Size:
8.15 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.navigator >Index: src/org/eclipse/ui/internal/navigator/wizards/CommonWizardDescriptor.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/wizards/CommonWizardDescriptor.java,v >retrieving revision 1.8 >diff -u -r1.8 CommonWizardDescriptor.java >--- src/org/eclipse/ui/internal/navigator/wizards/CommonWizardDescriptor.java 8 May 2006 20:54:43 -0000 1.8 >+++ src/org/eclipse/ui/internal/navigator/wizards/CommonWizardDescriptor.java 12 Sep 2006 13:43:30 -0000 >@@ -23,6 +23,7 @@ > import org.eclipse.core.runtime.IConfigurationElement; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.jface.viewers.IStructuredSelection; >+import org.eclipse.ui.IPluginContribution; > import org.eclipse.ui.WorkbenchException; > import org.eclipse.ui.internal.navigator.NavigatorPlugin; > import org.eclipse.ui.internal.navigator.extensions.INavigatorContentExtPtConstants; >@@ -37,7 +38,7 @@ > * > * @since 3.2 > */ >-public class CommonWizardDescriptor implements INavigatorContentExtPtConstants { >+public class CommonWizardDescriptor implements INavigatorContentExtPtConstants, IPluginContribution { > > /** The default menu group id for commonWizards without a menuGroupId attribute. */ > public static final String DEFAULT_MENU_GROUP_ID = "all-uncategorized"; //$NON-NLS-1$ >@@ -243,4 +244,17 @@ > return "CommonWizardDescriptor["+getId()+", wizardId="+getWizardId()+"]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IPluginContribution#getLocalId() >+ */ >+ public String getLocalId() { >+ return getId(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IPluginContribution#getPluginId() >+ */ >+ public String getPluginId() { >+ return (configElement != null) ? configElement.getNamespaceIdentifier() : null; >+ } > } >Index: src/org/eclipse/ui/internal/navigator/wizards/CommonWizardDescriptorManager.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/wizards/CommonWizardDescriptorManager.java,v >retrieving revision 1.7 >diff -u -r1.7 CommonWizardDescriptorManager.java >--- src/org/eclipse/ui/internal/navigator/wizards/CommonWizardDescriptorManager.java 8 May 2006 20:54:43 -0000 1.7 >+++ src/org/eclipse/ui/internal/navigator/wizards/CommonWizardDescriptorManager.java 12 Sep 2006 13:43:30 -0000 >@@ -20,6 +20,7 @@ > > import org.eclipse.core.runtime.IConfigurationElement; > import org.eclipse.ui.WorkbenchException; >+import org.eclipse.ui.activities.WorkbenchActivityHelper; > import org.eclipse.ui.internal.navigator.NavigatorPlugin; > import org.eclipse.ui.internal.navigator.extensions.NavigatorContentRegistryReader; > import org.eclipse.ui.navigator.INavigatorContentService; >@@ -117,7 +118,7 @@ > .next(); > > if (isVisible(aContentService, descriptor) >- && descriptor.isEnabledFor(anElement)) { >+ && descriptor.isEnabledFor(anElement)) { > descriptorIds.add(descriptor.getWizardId()); > } > } >@@ -154,7 +155,7 @@ > .next(); > > if (isVisible(aContentService, descriptor) >- && descriptor.isEnabledFor(anElement)) { >+ && descriptor.isEnabledFor(anElement)) { > descriptors.add(descriptor); > } > } >@@ -168,13 +169,14 @@ > * @return True if the descriptor is visible to the given content service. > */ > private boolean isVisible(INavigatorContentService aContentService, CommonWizardDescriptor descriptor) { >- return (aContentService == null || >- (descriptor.getId() == null || >- (aContentService.isVisible(descriptor.getId()) && >- aContentService.isActive(descriptor.getId()) >- ) >- ) >- ); >+ return !WorkbenchActivityHelper.filterItem(descriptor) && >+ (aContentService == null || >+ (descriptor.getId() == null || >+ ( aContentService.isVisible(descriptor.getId()) && >+ aContentService.isActive(descriptor.getId()) >+ ) >+ ) >+ ); > } > > private class CommonWizardRegistry extends NavigatorContentRegistryReader { >Index: schema/navigatorContent.exsd >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.navigator/schema/navigatorContent.exsd,v >retrieving revision 1.31.6.2 >diff -u -r1.31.6.2 navigatorContent.exsd >--- schema/navigatorContent.exsd 12 Jul 2006 21:37:50 -0000 1.31.6.2 >+++ schema/navigatorContent.exsd 12 Sep 2006 13:43:30 -0000 >@@ -319,7 +319,9 @@ > <element name="commonWizard"> > <annotation> > <documentation> >- The extension point provides the ability to contribute to the menu defined by type. >+ Defines a binding between an existing Eclipse New/Import/Export Wizard and a given set of items. Each valid binding determines which menu items will appear in the submenus for New/Import/Export in the context menu of a Common Navigator Viewer. Since Eclipse 3.2.1, the wizard menu items respect Eclipse Capabilities (see <b>org.eclipse.ui.activites</b> for more information). >+<br><br> >+All of the following conditions must be met for a <b>commonWizard</b> item to appear in the menu: (1) The <b>commonWizard</b> is NOT filtered by an Eclipse Capability, (2) The identifier of the <b>commonWizard</b> is NOT null, (3) The associated <b>navigatorContent</b> extension is <i>visible</i> for the current content service (the content service used to initialize the <code>NavigatorActionService</code> or supplied to <code>WizardActionGroup</code>), (4) The associated <b>navigatorContent</b> extension is <i>active</i> for the current content service, and (5) The <b>enablement</b> of the <b>commonWizard</b> returns true for the current selection that was supplied to the context menu. > </documentation> > </annotation> > <complexType> >@@ -360,7 +362,7 @@ > <attribute name="associatedExtensionId" type="string"> > <annotation> > <documentation> >- A <b>commonWizard</b> may be defined as the nested child of a <b>navigatorContent</b> extension point, in which case the <i>associatedExtensionId</i> is automatically set to the id of its enclosing <b>naviagatorContent</b> element. However, when specified as a top-level extension, a <b>commonWizard</b> may indicate an content extension that it should be associated with explicitly. When a <b>commonWizard</b> is associated with a content extension, it will inherit the <i>visibility</i> and the <i>activation</i> of that content extension. >+ A <b>commonWizard</b> may be defined as the nested child of a <b>navigatorContent</b> extension point, in which case the <i>associatedExtensionId</i> is automatically set to the id of its enclosing <b>naviagatorContent</b> element. However, when specified as a top-level extension, a <b>commonWizard</b> may indicate an content extension that it should be associated with explicitly. When a <b>commonWizard</b> is associated with a content extension, it will inherit the <i>visibility</i> and the <i>activation</i> of that content extension. It will not inherit the <i>enablement</i>; so you must specify an <b>enablement</b> for the wizard menu item to appear. > <br><br> > That is, if the content extension is bound to a Common Navigator (see <b>org.eclipse.ui.navigator.viewer/viewerContentBinding</b>) and the user has the content extension <i>activated</i> either by default or through the "Available Extensions" dialog, then the <b>commonWizard</b> menu option would appear. However, when the user <i>deactivates</i> that content extension, the <b>commonWizard</b> menu option would no longer be shown in the menu. > <br><br>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 156928
:
49876
| 49931 |
49932