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

Robert Stryker rawblem at gmail.com
Fri Dec 22 14:09:31 EST 2006


  User: rawb    
  Date: 06/12/22 14:09:31

  Modified:    core/plugins/org.jboss.ide.eclipse.packages.core/src/main/org/jboss/ide/eclipse/packages/core/model/types  
                        JARPackageType.java
  Added:       core/plugins/org.jboss.ide.eclipse.packages.core/src/main/org/jboss/ide/eclipse/packages/core/model/types  
                        AbstractPackageType.java
  Log:
  Further changes to the extension point infrastructure to adhere to newly-determined best practices. 
  
  Revision  Changes    Path
  1.8       +3 -11     jbosside/core/plugins/org.jboss.ide.eclipse.packages.core/src/main/org/jboss/ide/eclipse/packages/core/model/types/JARPackageType.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: JARPackageType.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosside/core/plugins/org.jboss.ide.eclipse.packages.core/src/main/org/jboss/ide/eclipse/packages/core/model/types/JARPackageType.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- JARPackageType.java	22 Dec 2006 01:08:40 -0000	1.7
  +++ JARPackageType.java	22 Dec 2006 19:09:31 -0000	1.8
  @@ -21,7 +21,7 @@
    * The name of the resulting JAR will be the project's name followed by a ".jar" extension.
    * @author Marshall
    */
  -public class JARPackageType implements IPackageType {
  +public class JARPackageType extends AbstractPackageType {
   
   	public static final String TYPE_ID = "jar";
   	public IPackage createDefaultConfiguration(IProject project, IProgressMonitor monitor)
  @@ -70,20 +70,12 @@
   		try {
   			if (project.hasNature(JavaCore.NATURE_ID))
   			{
  -				return SUPPORT_FULL;
  +				return IPackageType.SUPPORT_FULL;
   			}
   		} catch (CoreException e) {
   			Trace.trace(getClass(), e);
   		}
   		
  -		return SUPPORT_NONE;
  -	}
  -	
  -	public String getId() {
  -		return "jar";
  -	}
  -
  -	public String getLabel() {
  -		return "JAR";
  +		return IPackageType.SUPPORT_NONE;
   	}
   }
  
  
  
  1.3       +35 -20    jbosside/core/plugins/org.jboss.ide.eclipse.packages.core/src/main/org/jboss/ide/eclipse/packages/core/model/types/AbstractPackageType.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AbstractPackageType.java
  ===================================================================
  RCS file: AbstractPackageType.java
  diff -N AbstractPackageType.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ AbstractPackageType.java	22 Dec 2006 19:09:31 -0000	1.3
  @@ -0,0 +1,47 @@
  +/**
  + * JBoss, a Division of Red Hat
  + * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
  + * by the @authors tag. See the copyright.txt in the distribution for a
  + * full listing of individual contributors.
  + *
  +* This is free software; you can redistribute it and/or modify it
  + * under the terms of the GNU Lesser General Public License as
  + * published by the Free Software Foundation; either version 2.1 of
  + * the License, or (at your option) any later version.
  + *
  + * This software is distributed in the hope that it will be useful,
  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  + * Lesser General Public License for more details.
  + *
  + * You should have received a copy of the GNU Lesser General Public
  + * License along with this software; if not, write to the Free
  + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  + * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  + */
  +package org.jboss.ide.eclipse.packages.core.model.types;
  +
  +import org.eclipse.core.resources.IProject;
  +import org.eclipse.core.runtime.IConfigurationElement;
  +import org.eclipse.core.runtime.IProgressMonitor;
  +import org.jboss.ide.eclipse.packages.core.model.IPackage;
  +
  +/**
  + *
  + * @author rob.stryker at jboss.com
  + */
  +public abstract class AbstractPackageType implements IPackageType {
  +	private String id;
  +	private String label;
  +	
  +	public void setInitializationData(IConfigurationElement el) {
  +		id = el.getAttribute("id");
  +		label = el.getAttribute("label");
  +	}
  +	
  +	public String getId() { return id; }
  +	public String getLabel() { return label; }
  +	
  +	public abstract int getSupportFor (IProject project);
  +	public abstract IPackage createDefaultConfiguration(IProject project, IProgressMonitor monitor);
  +}
  
  
  



More information about the jboss-cvs-commits mailing list