[jboss-cvs] jbosside/core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui ...

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  
                        NodeContribution.java ExtensionManager.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.2       +6 -4      jbosside/core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui/NodeContribution.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NodeContribution.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosside/core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui/NodeContribution.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- NodeContribution.java	17 Feb 2007 17:31:38 -0000	1.1
  +++ NodeContribution.java	17 Feb 2007 18:08:20 -0000	1.2
  @@ -8,14 +8,14 @@
   import org.eclipse.core.runtime.Path;
   import org.eclipse.core.runtime.Platform;
   import org.eclipse.jface.resource.ImageDescriptor;
  -import org.eclipse.ui.IViewActionDelegate;
   import org.jboss.ide.eclipse.packages.core.Trace;
   import org.jboss.ide.eclipse.packages.core.model.IPackageNode;
  +import org.jboss.ide.eclipse.packages.ui.actions.INodeActionDelegate;
   import org.osgi.framework.Bundle;
   
   public class NodeContribution implements Comparable {
   	private String id, label;
  -	private IViewActionDelegate actionDelegate;
  +	private INodeActionDelegate actionDelegate;
   	private ImageDescriptor icon;
   	private int enablesForNodeType;
   	private int weight;
  @@ -28,7 +28,7 @@
   		label = element.getAttribute("label");
   		
   		try {
  -			actionDelegate = (IViewActionDelegate) element.createExecutableExtension("class");
  +			actionDelegate = (INodeActionDelegate) element.createExecutableExtension("class");
   		} catch (CoreException e) {
   			Trace.trace(getClass(), e);
   		}
  @@ -53,6 +53,8 @@
   		} else if ("fileset".equals(enablesFor)) {
   			enablesForNodeType = IPackageNode.TYPE_PACKAGE_FILESET;
   		}
  +		
  +		weight = Integer.parseInt(element.getAttribute("weight"));
   	}
   
   	public boolean isEnabledForNodeType (int nodeType)
  @@ -79,7 +81,7 @@
   	}
   
   	
  -	public IViewActionDelegate getActionDelegate() {
  +	public INodeActionDelegate getActionDelegate() {
   		return actionDelegate;
   	}
   
  
  
  
  1.2       +1 -1      jbosside/core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui/ExtensionManager.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ExtensionManager.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosside/core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui/ExtensionManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- ExtensionManager.java	17 Feb 2007 17:31:38 -0000	1.1
  +++ ExtensionManager.java	17 Feb 2007 18:08:20 -0000	1.2
  @@ -26,7 +26,7 @@
   		for (int i = 0; i < extensions.length; i++)
   		{
   			IConfigurationElement[] elements = extensions[i].getConfigurationElements();
  -			for (int j = 0; j < extensions.length; j++)
  +			for (int j = 0; j < elements.length; j++)
   			{
   				contributions.add(new NodeContribution(elements[j]));
   			}
  
  
  



More information about the jboss-cvs-commits mailing list