[jboss-cvs] jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/runtime ...

Robert Stryker rawblem at gmail.com
Fri Aug 25 22:33:20 EDT 2006


  User: rawb    
  Date: 06/08/25 22:33:20

  Modified:    as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/runtime   
                        JBossServerRuntime.java
  Added:       as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/runtime   
                        ProjectRuntimeClasspathProvider.java
                        JBossProjectRuntime.java
  Log:
  Added infrastructure for facet runtime support
  
  Revision  Changes    Path
  1.2       +23 -2     jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/runtime/JBossServerRuntime.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: JBossServerRuntime.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/runtime/JBossServerRuntime.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- JBossServerRuntime.java	31 May 2006 06:21:28 -0000	1.1
  +++ JBossServerRuntime.java	26 Aug 2006 02:33:20 -0000	1.2
  @@ -1,3 +1,24 @@
  +/*
  + * JBoss, Home of Professional Open Source
  + * Copyright 2006, JBoss Inc., 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.as.core.server.runtime;
   
   import java.lang.reflect.Constructor;
  @@ -25,8 +46,8 @@
    */
   public class JBossServerRuntime extends RuntimeDelegate {
   
  -	private static String PROPERTY_VM_ID = "PROPERTY_VM_ID";
  -	private static String PROPERTY_VM_TYPE_ID = "PROPERTY_VM_TYPE_ID";
  +	public  static String PROPERTY_VM_ID = "PROPERTY_VM_ID";
  +	public  static String PROPERTY_VM_TYPE_ID = "PROPERTY_VM_TYPE_ID";
   	
   	
   	
  
  
  
  1.1      date: 2006/08/26 02:33:20;  author: rawb;  state: Exp;jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/runtime/ProjectRuntimeClasspathProvider.java
  
  Index: ProjectRuntimeClasspathProvider.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2006, JBoss Inc., 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.as.core.server.runtime;
  
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.Collections;
  import java.util.List;
  
  import org.eclipse.core.runtime.IAdapterFactory;
  import org.eclipse.core.runtime.IPath;
  import org.eclipse.core.runtime.Path;
  import org.eclipse.jdt.core.IClasspathEntry;
  import org.eclipse.jdt.core.JavaCore;
  import org.eclipse.jst.common.project.facet.core.IClasspathProvider;
  import org.eclipse.wst.common.project.facet.core.IProjectFacet;
  import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
  import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
  import org.jboss.ide.eclipse.as.core.runtime.WebtoolsProjectJBossClasspathContainerInitializer.WebtoolsProjectJBossClasspathContainer;
  
  
  public class ProjectRuntimeClasspathProvider implements IClasspathProvider {
  	private IRuntimeComponent rc;
  
  	public ProjectRuntimeClasspathProvider(final IRuntimeComponent rc) {
  		this.rc = rc;
  	}
  
  	public List getClasspathEntries(final IProjectFacetVersion fv) {
  		IProjectFacet pf = fv.getProjectFacet();
  		if (pf == null)
  			return null;
  		
  		
  		// initializer/runtimeId/facetId/facetVersion
  		IPath path = new Path("org.jboss.ide.eclipse.as.core.runtime.ProjectInitializer");
  		path = path.append(rc.getProperty("id"));
  		path = path.append(fv.getProjectFacet().getId());
  		path = path.append(fv.getVersionString());
  		
  		WebtoolsProjectJBossClasspathContainer temp = new WebtoolsProjectJBossClasspathContainer(path);
  		// If we're a java runtime, just return that.
  		if( temp.getClasspathEntries().length == 1 && fv.getProjectFacet().getId().equals("jst.java")) {
  			return Arrays.asList(temp.getClasspathEntries());
  		}
  
  		// Otherwise just return the path to it, unless its empty in which case dont even include it
  		if( temp.getClasspathEntries().length != 0 ) {
  			IClasspathEntry cpentry = JavaCore.newContainerEntry(path);
  			return Collections.singletonList(cpentry);
  		}
  		return new ArrayList();	
  	}
  	
  	public static final class Factory implements IAdapterFactory {
  		private static final Class[] ADAPTER_TYPES = { IClasspathProvider.class };
  
  		public Object getAdapter(final Object adaptable, final Class adapterType) {
  			IRuntimeComponent rc = (IRuntimeComponent) adaptable;
  			return new ProjectRuntimeClasspathProvider(rc);
  		}
  
  		public Class[] getAdapterList() {
  			return ADAPTER_TYPES;
  		}
  	}
  }
  
  
  1.1      date: 2006/08/26 02:33:20;  author: rawb;  state: Exp;jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/runtime/JBossProjectRuntime.java
  
  Index: JBossProjectRuntime.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2006, JBoss Inc., 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.as.core.server.runtime;
  
  import org.eclipse.core.runtime.IStatus;
  import org.eclipse.wst.server.core.model.RuntimeDelegate;
  import org.jboss.ide.eclipse.as.core.util.ASDebug;
  
  public class JBossProjectRuntime extends RuntimeDelegate {
  
  	public static final String SERVER_ID = "_SERVER_ID_";
  	
  	public JBossProjectRuntime() {
  		// TODO Auto-generated constructor stub
  		ASDebug.p("I am created!!!", this);
  	}
  
  	public String getServerId() {
  		return getAttribute(SERVER_ID, (String)null);
  	}
  
  	public IStatus validate() {
  		IStatus status = super.validate();
  		ASDebug.p("validating, status is " + status, this);
  		return status;
  	}
  
  }
  
  
  



More information about the jboss-cvs-commits mailing list