You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by jr...@apache.org on 2003/03/27 17:06:28 UTC

cvs commit: jakarta-cactus/integration/eclipse/org.apache.cactus.eclipse.webapp/src/java/org/apache/cactus/eclipse/webapp/ui WebappPlugin.java WebAppPropertyPage.java

jruaux      2003/03/27 08:06:27

  Modified:    integration/eclipse/org.apache.cactus.eclipse.webapp/src/java/org/apache/cactus/eclipse/webapp
                        WarBuilder.java Webapp.java
               integration/eclipse/org.apache.cactus.eclipse.webapp/src/java/org/apache/cactus/eclipse/webapp/ui
                        WebappPlugin.java WebAppPropertyPage.java
  Log:
  added a convenience method
  
  Revision  Changes    Path
  1.5       +2 -2      jakarta-cactus/integration/eclipse/org.apache.cactus.eclipse.webapp/src/java/org/apache/cactus/eclipse/webapp/WarBuilder.java
  
  Index: WarBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/integration/eclipse/org.apache.cactus.eclipse.webapp/src/java/org/apache/cactus/eclipse/webapp/WarBuilder.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- WarBuilder.java	19 Mar 2003 15:40:37 -0000	1.4
  +++ WarBuilder.java	27 Mar 2003 16:06:27 -0000	1.5
  @@ -153,7 +153,7 @@
           this.userClassFilesDir = getAbsoluteOutputLocation(theJavaProject);
   
           // TODO: Why not save the Webapp object directly?
  -        Webapp webapp = new Webapp(theJavaProject.getProject());
  +        Webapp webapp = new Webapp(theJavaProject);
           webapp.loadValues();
   
           this.outputWar = new File(webapp.getOutput());
  
  
  
  1.4       +20 -5     jakarta-cactus/integration/eclipse/org.apache.cactus.eclipse.webapp/src/java/org/apache/cactus/eclipse/webapp/Webapp.java
  
  Index: Webapp.java
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/integration/eclipse/org.apache.cactus.eclipse.webapp/src/java/org/apache/cactus/eclipse/webapp/Webapp.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Webapp.java	19 Mar 2003 17:18:20 -0000	1.3
  +++ Webapp.java	27 Mar 2003 16:06:27 -0000	1.4
  @@ -63,6 +63,7 @@
   import org.apache.cactus.eclipse.webapp.ui.WebappPlugin;
   import org.eclipse.core.resources.IProject;
   import org.eclipse.core.runtime.CoreException;
  +import org.eclipse.core.runtime.IPath;
   import org.eclipse.core.runtime.Path;
   import org.eclipse.core.runtime.QualifiedName;
   import org.eclipse.jdt.core.IClasspathEntry;
  @@ -140,11 +141,11 @@
   
       /**
        * Constructor.
  -     * @param theProject the project this webapp is linked to
  +     * @param theJavaProject the project this webapp is linked to
        */
  -    public Webapp(IProject theProject)
  +    public Webapp(IJavaProject theJavaProject)
       {
  -        javaProject = JavaCore.create(theProject);
  +        javaProject = theJavaProject;
       }
   
       /**
  @@ -332,11 +333,25 @@
       }
   
       /**
  -     * @return String directory of this webapp source files 
  +     * @return String directory of this webapp source files
  +     * relative to the project path 
        */
       public String getDir()
       {
           return this.dir;
  +    }
  +    
  +    /**
  +     * @return the absolute directory to this webapp source files
  +     */
  +    public File getAbsoluteDir()
  +    {
  +        if (dir == null)
  +        {
  +            return null;
  +        }
  +        IPath projectPath = javaProject.getProject().getLocation();
  +        return projectPath.append(dir).toFile();
       }
   
       /**
  
  
  
  1.2       +12 -1     jakarta-cactus/integration/eclipse/org.apache.cactus.eclipse.webapp/src/java/org/apache/cactus/eclipse/webapp/ui/WebappPlugin.java
  
  Index: WebappPlugin.java
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/integration/eclipse/org.apache.cactus.eclipse.webapp/src/java/org/apache/cactus/eclipse/webapp/ui/WebappPlugin.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WebappPlugin.java	12 Mar 2003 18:50:19 -0000	1.1
  +++ WebappPlugin.java	27 Mar 2003 16:06:27 -0000	1.2
  @@ -59,9 +59,11 @@
   import java.util.MissingResourceException;
   import java.util.ResourceBundle;
   
  +import org.apache.cactus.eclipse.webapp.Webapp;
   import org.eclipse.core.resources.IWorkspace;
   import org.eclipse.core.resources.ResourcesPlugin;
   import org.eclipse.core.runtime.IPluginDescriptor;
  +import org.eclipse.jdt.core.IJavaProject;
   import org.eclipse.ui.plugin.AbstractUIPlugin;
   
   /**
  @@ -152,5 +154,14 @@
       public static String getPluginId()
       {
           return getDefault().getDescriptor().getUniqueIdentifier();
  +    }
  +
  +    /**
  +     * @param theJavaProject the Java project to get the webapp from
  +     * @return the webapp associated to the given Java project
  +     */
  +    public static Webapp getWebapp(IJavaProject theJavaProject)
  +    {
  +        return new Webapp(theJavaProject);
       }
   }
  
  
  
  1.2       +2 -2      jakarta-cactus/integration/eclipse/org.apache.cactus.eclipse.webapp/src/java/org/apache/cactus/eclipse/webapp/ui/WebAppPropertyPage.java
  
  Index: WebAppPropertyPage.java
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/integration/eclipse/org.apache.cactus.eclipse.webapp/src/java/org/apache/cactus/eclipse/webapp/ui/WebAppPropertyPage.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WebAppPropertyPage.java	12 Mar 2003 18:50:19 -0000	1.1
  +++ WebAppPropertyPage.java	27 Mar 2003 16:06:27 -0000	1.2
  @@ -92,7 +92,7 @@
       protected Control createContents(Composite theParent)
       {
           IJavaProject javaProject = JavaCore.create(getProject());
  -        webapp = new Webapp(getProject());
  +        webapp = new Webapp(javaProject);
           boolean loadedDefaults = webapp.init();
           if (loadedDefaults)
           {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org