[jboss-cvs] jbosside/core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui/views ...
Marshall Culpepper
mculpepper at jboss.com
Sat Feb 17 13:08:20 EST 2007
User: mculpepper
Date: 07/02/17 13:08:20
Modified: core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui/views
ProjectPackagesView.java
Log:
the "class" of a nodeContribution must now implement INodeActionDelegate (this allows for fine-grained control of when a contribution is enabled or not). By default, extending AbstractNodeActionDelegate will always return true. (enablesForNodeType is still checked in conjunction with this interface)
Revision Changes Path
1.17 +4 -1 jbosside/core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui/views/ProjectPackagesView.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ProjectPackagesView.java
===================================================================
RCS file: /cvsroot/jboss/jbosside/core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui/views/ProjectPackagesView.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- ProjectPackagesView.java 17 Feb 2007 17:31:39 -0000 1.16
+++ ProjectPackagesView.java 17 Feb 2007 18:08:20 -0000 1.17
@@ -292,6 +292,8 @@
private void addContextMenuContributions (IPackageNode context)
{
+ Collections.sort(nodePopupMenuContributions);
+
for (Iterator iter = nodePopupMenuContributions.iterator(); iter.hasNext(); )
{
NodeContribution contribution = (NodeContribution) iter.next();
@@ -302,7 +304,8 @@
private void addContextMenuContribution(final NodeContribution contribution, IPackageNode context)
{
- if (contribution.isEnabledForNodeType(context.getNodeType()))
+ if (contribution.isEnabledForNodeType(context.getNodeType())
+ && contribution.getActionDelegate().isEnabledFor(context))
{
Action action = new Action () {
public String getId() {
More information about the jboss-cvs-commits
mailing list