You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by mc...@apache.org on 2008/06/28 01:15:02 UTC

svn commit: r672424 - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/jaxb/ org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/ org.apache.geronimo.st.v21...

Author: mcconne
Date: Fri Jun 27 16:15:01 2008
New Revision: 672424

URL: http://svn.apache.org/viewvc?rev=672424&view=rev
Log:
GERONIMODEVTOOLS-392 Fixes to add various missing elements in the deployment plan editor(s) for the <environment> tag -- Thanks to BJ Reed for this patch !!

Added:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ClassFilterSection.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ClassFilterWizard.java   (with props)
Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/jaxb/JAXBUtils.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBObjectFactoryImpl.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/AppClientDeploymentPage.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/DeploymentPage.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/jaxb/JAXBUtils.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/jaxb/JAXBUtils.java?rev=672424&r1=672423&r2=672424&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/jaxb/JAXBUtils.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/jaxb/JAXBUtils.java Fri Jun 27 16:15:01 2008
@@ -45,12 +45,12 @@
  */
 public class JAXBUtils {
 
-	// JAXBContext instantiation is costly - must be done only once!
-	private static final JAXBContext jaxbContext = newJAXBContext();
-	private static JAXBContext newJAXBContext() {
-		try {
+    // JAXBContext instantiation is costly - must be done only once!
+    private static final JAXBContext jaxbContext = newJAXBContext();
+    private static JAXBContext newJAXBContext() {
+        try {
             return JAXBContext.newInstance( 
-            		"org.apache.geronimo.jee.connector:" +
+                    "org.apache.geronimo.jee.connector:" +
                     "org.apache.geronimo.jee.openejb:" +
                     "org.apache.geronimo.jee.web:" +
                     "org.apache.geronimo.jee.application:" +
@@ -58,55 +58,55 @@
                     "org.apache.geronimo.jee.deployment:" +
                     "org.apache.geronimo.jee.naming:" +
                     "org.apache.geronimo.jee.security", Activator.class.getClassLoader() );
-		} catch (JAXBException e) {
-			Trace.tracePoint("JAXBException", "JAXBContext.newInstance");
-			e.printStackTrace();
-		}
-		return null;
-	}
-
-	public static void marshalDeploymentPlan(JAXBElement jaxbElement, IFile file) {
-		try {
-			Marshaller marshaller = jaxbContext.createMarshaller();
-			marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
-			marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
-			marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new NamespacePrefixMapperImpl());
-			ByteArrayOutputStream outBuffer = new ByteArrayOutputStream();
-			marshaller.marshal(jaxbElement, outBuffer);
-			ByteArrayInputStream inBuffer = new ByteArrayInputStream(outBuffer.toByteArray());
-			if(file.exists()) {
-				file.setContents(inBuffer, true, false, null);
-			} else {
-				prepareFolder(file.getParent());
-				file.create(inBuffer, true, null);
-			}
-		} catch (JAXBException jaxbException) {
-			Trace.tracePoint("JAXBException", "JAXBUtils.marshalDeploymentPlan()", file.getFullPath());
-			jaxbException.printStackTrace();
-		} catch (CoreException coreException) {
-			Trace.tracePoint("CoreException", "JAXBUtils.marshalDeploymentPlan()", file.getFullPath());
-			coreException.printStackTrace();
-		}
-	}
-
-	public static JAXBElement unmarshalDeploymentPlan(IFile file) {
-		try {
-			Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
-			JAXBElement plan = (JAXBElement) unmarshaller.unmarshal(file.getContents());
-			return plan;
-		} catch (JAXBException e) {
-			Trace.tracePoint("JAXBException", "JAXBUtils.unmarshalDeploymentPlan()", file.getFullPath());
-			e.printStackTrace();
-		} catch (CoreException e) {
-			Trace.tracePoint("CoreException", "JAXBUtils.unmarshalDeploymentPlan()", file.getFullPath());
-			e.printStackTrace();
-		}
-		return null;
-	}
-
-	public static JAXBElement unmarshalFilterDeploymentPlan(IFile file) {
-		try {
-			Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+        } catch (JAXBException e) {
+            Trace.tracePoint("JAXBException", "JAXBContext.newInstance");
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static void marshalDeploymentPlan(JAXBElement jaxbElement, IFile file) {
+        try {
+            Marshaller marshaller = jaxbContext.createMarshaller();
+            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+            marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+            marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new NamespacePrefixMapperImpl());
+            ByteArrayOutputStream outBuffer = new ByteArrayOutputStream();
+            marshaller.marshal(jaxbElement, outBuffer);
+            ByteArrayInputStream inBuffer = new ByteArrayInputStream(outBuffer.toByteArray());
+            if(file.exists()) {
+                file.setContents(inBuffer, true, false, null);
+            } else {
+                prepareFolder(file.getParent());
+                file.create(inBuffer, true, null);
+            }
+        } catch (JAXBException jaxbException) {
+            Trace.tracePoint("JAXBException", "JAXBUtils.marshalDeploymentPlan()", file.getFullPath());
+            jaxbException.printStackTrace();
+        } catch (CoreException coreException) {
+            Trace.tracePoint("CoreException", "JAXBUtils.marshalDeploymentPlan()", file.getFullPath());
+            coreException.printStackTrace();
+        }
+    }
+
+    public static JAXBElement unmarshalDeploymentPlan(IFile file) {
+        try {
+            Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+            JAXBElement plan = (JAXBElement) unmarshaller.unmarshal(file.getContents());
+            return plan;
+        } catch (JAXBException e) {
+            Trace.tracePoint("JAXBException", "JAXBUtils.unmarshalDeploymentPlan()", file.getFullPath());
+            e.printStackTrace();
+        } catch (CoreException e) {
+            Trace.tracePoint("CoreException", "JAXBUtils.unmarshalDeploymentPlan()", file.getFullPath());
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static JAXBElement unmarshalFilterDeploymentPlan(IFile file) {
+        try {
+            Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
             SAXParserFactory factory = SAXParserFactory.newInstance();
             factory.setNamespaceAware(true);
             factory.setValidating(false);
@@ -114,13 +114,13 @@
             NamespaceFilter xmlFilter = new NamespaceFilter(parser.getXMLReader());
             SAXSource source = new SAXSource(xmlFilter, new InputSource( file.getContents()));
             JAXBElement plan = (JAXBElement) unmarshaller.unmarshal(source);
-			return plan;
-		} catch (JAXBException e) {
-			Trace.tracePoint("JAXBException", "JAXBUtils.unmarshalFilterDeploymentPlan()", file.getFullPath());
-			e.printStackTrace();
-		} catch (CoreException e) {
-			Trace.tracePoint("CoreException", "JAXBUtils.unmarshalFilterDeploymentPlan()", file.getFullPath());
-			e.printStackTrace();
+            return plan;
+        } catch (JAXBException e) {
+            Trace.tracePoint("JAXBException", "JAXBUtils.unmarshalFilterDeploymentPlan()", file.getFullPath());
+            e.printStackTrace();
+        } catch (CoreException e) {
+            Trace.tracePoint("CoreException", "JAXBUtils.unmarshalFilterDeploymentPlan()", file.getFullPath());
+            e.printStackTrace();
         } catch (ParserConfigurationException e) {
             Trace.tracePoint("ParserConfigurationException", "JAXBUtils.unmarshalFilterDeploymentPlan()", file.getFullPath());
             e.printStackTrace();
@@ -128,56 +128,58 @@
             Trace.tracePoint("SAXException", "JAXBUtils.unmarshalFilterDeploymentPlan()", file.getFullPath());
             e.printStackTrace();
         }
-		return null;
-	}
+        return null;
+    }
 
-	private static void prepareFolder(IContainer folder) throws CoreException {
-		if (folder.exists() || !(folder instanceof IFolder)) {
-			return;
-		}
-		// prepare the upper level folders recursively
-		prepareFolder(folder.getParent());
-		((IFolder) folder).create(true, true, null);
-	}
-
-	public static Object getValue( Object element, String name ) {
-		try {
-			Method method = element.getClass().getMethod( "get" + name, null);
-			return method.invoke(element, null);
-		} catch ( NoSuchMethodException e ) {
-			e.printStackTrace();
-		} catch (IllegalArgumentException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (IllegalAccessException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (InvocationTargetException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		return null;
-	}
-	
-	public static void setValue( Object element, String name, Object value ) {
-		try {
-			Method[] methods = element.getClass().getMethods();
-			for ( Method method: methods) {
-				if ( method.getName().equals( "set" + name ) ) {
-					method.invoke( element, value );
-					return;
-				}
-			}
-		} catch (IllegalArgumentException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (IllegalAccessException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (InvocationTargetException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		System.out.println( "============== No such method set" + name + " in class " + element.getClass().getName() );
-	}
+    private static void prepareFolder(IContainer folder) throws CoreException {
+        if (folder.exists() || !(folder instanceof IFolder)) {
+            return;
+        }
+        // prepare the upper level folders recursively
+        prepareFolder(folder.getParent());
+        ((IFolder) folder).create(true, true, null);
+    }
+
+    public static Object getValue( Object element, String name ) {
+        try {
+            if (String.class.isInstance(element))
+                return (String)element;
+            Method method = element.getClass().getMethod( "get" + name, null);
+            return method.invoke(element, null);
+        } catch ( NoSuchMethodException e ) {
+            e.printStackTrace();
+        } catch (IllegalArgumentException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (IllegalAccessException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (InvocationTargetException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        return null;
+    }
+    
+    public static void setValue( Object element, String name, Object value ) {
+        try {
+            Method[] methods = element.getClass().getMethods();
+            for ( Method method: methods) {
+                if ( method.getName().equals( "set" + name ) ) {
+                    method.invoke( element, value );
+                    return;
+                }
+            }
+        } catch (IllegalArgumentException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (IllegalAccessException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (InvocationTargetException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        System.out.println( "============== No such method set" + name + " in class " + element.getClass().getName() );
+    }
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java?rev=672424&r1=672423&r2=672424&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java Fri Jun 27 16:15:01 2008
@@ -143,9 +143,24 @@
     public static String editorSectionClientDependenciesTitle;
     public static String editorSectionClientDependenciesDescription;
     //
+    public static String editorSectionHiddenClassesTitle;
+    public static String editorSectionHiddenClassesDescription;
+    public static String editorSectionClientHiddenClassesTitle;
+    public static String editorSectionClientHiddenClassesDescription;
+    public static String editorSectionNonOverridableTitle;
+    public static String editorSectionNonOverridableDescription;
+    public static String editorSectionClientNonOverridableTitle;
+    public static String editorSectionClientNonOverridableDescription;
+    //
     public static String editorSectionMessageDestTitle;
     public static String editorSectionMessageDestDescription;
     //
+    public static String editorSectionModuleTitle;
+    public static String editorSectionModuleDescription;
+    //
+    public static String editorSectionExtModuleTitle;
+    public static String editorSectionExtModuleDescription;
+    //
     public static String editorSectionImportTitle;
     public static String editorSectionImportDescription;
     //
@@ -247,6 +262,16 @@
     public static String wizardPageTitle_MessageDest;
     public static String wizardPageDescription_MessageDest;
     //
+    public static String wizardNewTitle_Module;
+    public static String wizardEditTitle_Module;
+    public static String wizardPageTitle_Module;
+    public static String wizardPageDescription_Module;
+    //
+    public static String wizardNewTitle_ExtModule;
+    public static String wizardEditTitle_ExtModule;
+    public static String wizardPageTitle_ExtModule;
+    public static String wizardPageDescription_ExtModule;
+    //
     public static String wizardNewTitle_SecurityRole;
     public static String wizardEditTitle_SecurityRole;
     public static String wizardPageTitle_SecurityRole;
@@ -274,4 +299,15 @@
     public static String addSharedLib;
     public static String webContainerSection;
     public static String webContainerSectionDescription;
-}
\ No newline at end of file
+
+    public static String moduleType;
+    public static String path;
+    public static String internalPath;
+    public static String externalPath;
+    public static String altDD;
+    
+    public static String connector;
+    public static String ejb;
+    public static String java;
+    public static String web;
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties?rev=672424&r1=672423&r2=672424&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties Fri Jun 27 16:15:01 2008
@@ -44,9 +44,24 @@
 editorSectionClientDependenciesTitle=Client Dependencies
 editorSectionClientDependenciesDescription=The following client dependencies are defined as common libraries.
 
+editorSectionHiddenClassesTitle=Hidden Classes
+editorSectionHiddenClassesDescription=The following classes are hidden.
+editorSectionClientHiddenClassesTitle=Client Hidden Classes
+editorSectionClientHiddenClassesDescription=The following classes are hidden in the client.
+editorSectionNonOverridableTitle=Non Overridable Classes
+editorSectionNonOverridableDescription=The following classes are not overridable.
+editorSectionClientNonOverridableTitle=Client Non Overridable Classes
+editorSectionClientNonOverridableDescription=The following classes are not overridable in the client.
+
 editorSectionMessageDestTitle=Message Destinations
 editorSectionMessageDestDescription=The following message destinations are defined:
 
+editorSectionModuleTitle=Modules
+editorSectionModuleDescription=The following modules are defined:
+
+editorSectionExtModuleTitle=External Modules
+editorSectionExtModuleDescription=The following external modules are defined:
+
 editorSectionImportTitle=Imports
 editorSectionImportDescription=The following configurations are imported into this plan.
 
@@ -182,6 +197,16 @@
 wizardPageTitle_MessageDest=Message Destination Details
 wizardPageDescription_MessageDest=Provide details for this message destination.
 
+wizardNewTitle_Module=New Module
+wizardEditTitle_Module=Edit Module
+wizardPageTitle_Module=Module Details
+wizardPageDescription_Module=Provide details for this module.
+
+wizardNewTitle_ExtModule=New External Module
+wizardEditTitle_ExtModule=Edit External Module
+wizardPageTitle_ExtModule=External Module Details
+wizardPageDescription_ExtModule=Provide details for this external module.
+
 doasCurrentCaller=Do as current caller
 useContextHandler=Use context handler
 defaultRole=Default Role:
@@ -267,4 +292,15 @@
 useGBeanLink=Specify as GBean Link
 gBeanLink=GBean Link:
 useGBeanPattern=Specify as GBean Pattern
-moduleId=Module Id:
\ No newline at end of file
+moduleId=Module Id:
+
+moduleType=Module Type
+path=Path
+internalPath=Internal Path
+externalPath=External Path
+altDD=Alternate DD
+
+connector=Connector
+ejb=EJB
+java=Java
+web=Web

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBObjectFactoryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBObjectFactoryImpl.java?rev=672424&r1=672423&r2=672424&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBObjectFactoryImpl.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBObjectFactoryImpl.java Fri Jun 27 16:15:01 2008
@@ -17,7 +17,11 @@
 package org.apache.geronimo.st.v21.core.jaxb;
 
 import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
+import org.apache.geronimo.jee.application.ExtModule;
+import org.apache.geronimo.jee.application.Module;
+import org.apache.geronimo.jee.application.Path;
 import org.apache.geronimo.jee.deployment.Artifact;
+import org.apache.geronimo.jee.deployment.ClassFilter;
 import org.apache.geronimo.jee.deployment.Dependencies;
 import org.apache.geronimo.jee.deployment.Dependency;
 import org.apache.geronimo.jee.deployment.Environment;
@@ -26,7 +30,6 @@
 import org.apache.geronimo.jee.naming.EjbLocalRef;
 import org.apache.geronimo.jee.naming.GbeanRef;
 import org.apache.geronimo.jee.naming.MessageDestination;
-import org.apache.geronimo.jee.naming.Pattern;
 import org.apache.geronimo.jee.naming.ResourceEnvRef;
 import org.apache.geronimo.jee.naming.ResourceRef;
 import org.apache.geronimo.jee.naming.ServiceRef;
@@ -61,7 +64,7 @@
             return (new org.apache.geronimo.jee.naming.ObjectFactory()).createGbeanRef();
         } else if ( type.equals( MessageDestination.class ) ) {
             return (new org.apache.geronimo.jee.naming.ObjectFactory()).createMessageDestination();
-        } else if ( type.equals( Pattern.class ) ) {
+        } else if ( type.equals( org.apache.geronimo.jee.naming.Pattern.class ) ) {
             return (new org.apache.geronimo.jee.naming.ObjectFactory()).createPattern();
         } else if ( type.equals( ServiceRef.class ) ) {
             return (new org.apache.geronimo.jee.naming.ObjectFactory()).createServiceRef();
@@ -79,12 +82,22 @@
             return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createGbean();
         } else if ( type.equals( Artifact.class ) ) {
             return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createArtifact();
+        } else if ( type.equals( ClassFilter.class ) ) {
+            return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createClassFilter();
         } else if ( type.equals( Dependencies.class ) ) {
             return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createDependencies();
         } else if ( type.equals( Dependency.class ) ) {
             return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createDependency();
         } else if ( type.equals( Environment.class ) ) {
             return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createEnvironment();
+        } else if ( type.equals( org.apache.geronimo.jee.deployment.Pattern.class ) ) {
+            return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createPattern();
+        } else if ( type.equals( ExtModule.class ) ) {
+            return (new org.apache.geronimo.jee.application.ObjectFactory()).createExtModule();
+        } else if ( type.equals( Module.class ) ) {
+            return (new org.apache.geronimo.jee.application.ObjectFactory()).createModule();
+        } else if ( type.equals( Path.class ) ) {
+            return (new org.apache.geronimo.jee.application.ObjectFactory()).createPath();
         }
         
         return null;

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/AppClientDeploymentPage.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/AppClientDeploymentPage.java?rev=672424&r1=672423&r2=672424&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/AppClientDeploymentPage.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/AppClientDeploymentPage.java Fri Jun 27 16:15:01 2008
@@ -18,6 +18,7 @@
 
 import org.apache.geronimo.st.ui.CommonMessages;
 import org.apache.geronimo.st.v21.core.jaxb.JAXBModelUtils;
+import org.apache.geronimo.st.v21.ui.sections.ClassFilterSection;
 import org.apache.geronimo.st.v21.ui.sections.DependencySection;
 import org.apache.geronimo.st.v21.ui.sections.GBeanSection;
 import org.eclipse.ui.forms.IManagedForm;
@@ -25,28 +26,32 @@
 
 public class AppClientDeploymentPage extends DeploymentPage {
 	
-	public AppClientDeploymentPage(FormEditor editor, String id, String title) {
-		super(editor, id, title);
-	}
+    public AppClientDeploymentPage(FormEditor editor, String id, String title) {
+        super(editor, id, title);
+    }
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#fillBody(org.eclipse.ui.forms.IManagedForm)
-	 */
-	protected void fillBody(IManagedForm managedForm) {
-		managedForm.addPart(new DependencySection(getDeploymentPlan(), JAXBModelUtils.getEnvironment(getDeploymentPlan(), true), body, toolkit, getStyle(), true));
-		managedForm.addPart(new DependencySection(getDeploymentPlan(), JAXBModelUtils.getEnvironment(getDeploymentPlan(), false), body, toolkit, getStyle(), false));
-		managedForm.addPart(new GBeanSection(getDeploymentPlan(), JAXBModelUtils.getGbeans(getDeploymentPlan()), body, toolkit, getStyle()));
-	}
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#fillBody(org.eclipse.ui.forms.IManagedForm)
+     */
+    protected void fillBody(IManagedForm managedForm) {
+        managedForm.addPart(new DependencySection(getDeploymentPlan(), JAXBModelUtils.getEnvironment(getDeploymentPlan(), true), body, toolkit, getStyle(), true));
+        managedForm.addPart(new DependencySection(getDeploymentPlan(), JAXBModelUtils.getEnvironment(getDeploymentPlan(), false), body, toolkit, getStyle(), false));
+        managedForm.addPart(new ClassFilterSection(getDeploymentPlan(), JAXBModelUtils.getEnvironment(getDeploymentPlan(), true), body, toolkit, getStyle(), true, true));
+        managedForm.addPart(new ClassFilterSection(getDeploymentPlan(), JAXBModelUtils.getEnvironment(getDeploymentPlan(), false), body, toolkit, getStyle(), false, true));
+        managedForm.addPart(new ClassFilterSection(getDeploymentPlan(), JAXBModelUtils.getEnvironment(getDeploymentPlan(), true), body, toolkit, getStyle(), true, false));
+        managedForm.addPart(new ClassFilterSection(getDeploymentPlan(), JAXBModelUtils.getEnvironment(getDeploymentPlan(), false), body, toolkit, getStyle(), false, false));
+        managedForm.addPart(new GBeanSection(getDeploymentPlan(), JAXBModelUtils.getGbeans(getDeploymentPlan()), body, toolkit, getStyle()));
+    }
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#getFormTitle()
-	 */
-	public String getFormTitle() {
-		return CommonMessages.deploymentPageTitle;
-	}
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#getFormTitle()
+     */
+    public String getFormTitle() {
+        return CommonMessages.deploymentPageTitle;
+    }
 
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/DeploymentPage.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/DeploymentPage.java?rev=672424&r1=672423&r2=672424&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/DeploymentPage.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/DeploymentPage.java Fri Jun 27 16:15:01 2008
@@ -1,59 +1,55 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.geronimo.st.v21.ui.pages;
-
-import javax.xml.bind.JAXBElement;
-
-import org.apache.geronimo.jee.deployment.Environment;
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.pages.AbstractGeronimoFormPage;
-import org.apache.geronimo.st.v21.core.jaxb.JAXBModelUtils;
-import org.apache.geronimo.st.v21.ui.sections.DependencySection;
-import org.apache.geronimo.st.v21.ui.sections.GBeanSection;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-
-public class DeploymentPage extends AbstractGeronimoFormPage {
-	
-//	public EnvironmentType environment;
-	
-//	public JAXBElement gbeanERef;
-
-	public DeploymentPage(FormEditor editor, String id, String title) {
-		super(editor, id, title);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#fillBody(org.eclipse.ui.forms.IManagedForm)
-	 */
-	protected void fillBody(IManagedForm managedForm) {
-		managedForm.addPart(new DependencySection(getDeploymentPlan(), JAXBModelUtils.getEnvironment(getDeploymentPlan()), body, toolkit, getStyle()));
-		managedForm.addPart(new GBeanSection(getDeploymentPlan(), JAXBModelUtils.getGbeans(getDeploymentPlan()), body, toolkit, getStyle()));
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#getFormTitle()
-	 */
-	public String getFormTitle() {
-		return CommonMessages.deploymentPageTitle;
-	}
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.pages;
+
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.pages.AbstractGeronimoFormPage;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBModelUtils;
+import org.apache.geronimo.st.v21.ui.sections.ClassFilterSection;
+import org.apache.geronimo.st.v21.ui.sections.DependencySection;
+import org.apache.geronimo.st.v21.ui.sections.GBeanSection;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+
+public class DeploymentPage extends AbstractGeronimoFormPage {
+    
+    public DeploymentPage(FormEditor editor, String id, String title) {
+        super(editor, id, title);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#fillBody(org.eclipse.ui.forms.IManagedForm)
+     */
+    protected void fillBody(IManagedForm managedForm) {
+        managedForm.addPart(new DependencySection(getDeploymentPlan(), JAXBModelUtils.getEnvironment(getDeploymentPlan()), body, toolkit, getStyle()));
+        managedForm.addPart(new GBeanSection(getDeploymentPlan(), JAXBModelUtils.getGbeans(getDeploymentPlan()), body, toolkit, getStyle()));
+        managedForm.addPart(new ClassFilterSection(getDeploymentPlan(), JAXBModelUtils.getEnvironment(getDeploymentPlan()), body, toolkit, getStyle(), true, true));
+        managedForm.addPart(new ClassFilterSection(getDeploymentPlan(), JAXBModelUtils.getEnvironment(getDeploymentPlan()), body, toolkit, getStyle(), true, false));
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#getFormTitle()
+     */
+    public String getFormTitle() {
+        return CommonMessages.deploymentPageTitle;
+    }
+
+}

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ClassFilterSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ClassFilterSection.java?rev=672424&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ClassFilterSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ClassFilterSection.java Fri Jun 27 16:15:01 2008
@@ -0,0 +1,154 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.sections;
+
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.providers.AdapterFactory;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+import org.apache.geronimo.st.v21.ui.Activator;
+import org.apache.geronimo.st.v21.ui.wizards.ClassFilterWizard;
+import org.apache.geronimo.jee.deployment.ClassFilter;
+import org.apache.geronimo.jee.deployment.Environment;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ClassFilterSection extends AbstractTableSection {
+
+    protected Environment environment;
+
+    protected boolean isServerEnvironment;
+
+    // isHiddenClasses = true for hidden classes or false for non overridable classes
+    protected boolean isHiddenClasses;
+
+    /**
+     * @param plan
+     * @param parent
+     * @param toolkit
+     * @param style
+     * @param envType
+     * @param classFilterType
+     */
+    public ClassFilterSection(JAXBElement plan, Environment environment, Composite parent, FormToolkit toolkit, int style, boolean isServerEnvironment, boolean isHiddenClasses) {
+        super(plan, parent, toolkit, style);
+        this.environment = environment;
+        this.isServerEnvironment = isServerEnvironment;
+        this.isHiddenClasses = isHiddenClasses; 
+        this.COLUMN_NAMES = new String[] {
+                CommonMessages.className
+        };
+        createClient();
+    }
+
+    public String getTitle() {
+        if (isServerEnvironment && isHiddenClasses)
+            return CommonMessages.editorSectionHiddenClassesTitle;
+        else if (!isServerEnvironment && isHiddenClasses)
+            return CommonMessages.editorSectionClientHiddenClassesTitle;
+        else if (isServerEnvironment && !isHiddenClasses)
+            return CommonMessages.editorSectionNonOverridableTitle;
+        else
+            return CommonMessages.editorSectionClientNonOverridableTitle;
+    }
+
+    public String getDescription() {
+        if (isServerEnvironment && isHiddenClasses)
+            return CommonMessages.editorSectionHiddenClassesDescription;
+        else if (!isServerEnvironment && isHiddenClasses)
+            return CommonMessages.editorSectionClientHiddenClassesDescription;
+        else if (isServerEnvironment && !isHiddenClasses)
+            return CommonMessages.editorSectionNonOverridableDescription;
+        else
+            return CommonMessages.editorSectionClientNonOverridableDescription;
+    }
+
+    public List getObjectContainer() {
+        if (environment == null) {
+            environment = (Environment)JAXBObjectFactoryImpl.getInstance().create(Environment.class);
+        }
+
+        if (getClassFilter() == null) {
+            ClassFilter filter = (ClassFilter)JAXBObjectFactoryImpl.getInstance().create(ClassFilter.class);
+            setClassFilter (filter);
+        }
+        return getClassFilter().getFilter();
+    }
+
+    public Wizard getWizard() {
+        return new ClassFilterWizard(this, isServerEnvironment);
+    }
+
+    public ClassFilter getClassFilter() {
+        if (isHiddenClasses == true)
+            return environment.getHiddenClasses();
+        else
+            return environment.getNonOverridableClasses();
+    }
+
+    public void setClassFilter (ClassFilter filter) {
+        if (isHiddenClasses == true)
+            environment.setHiddenClasses (filter);
+        else
+            environment.setNonOverridableClasses (filter);
+    }
+    
+    public ImageDescriptor getImageDescriptor() {
+        return Activator.imageDescriptorFromPlugin("org.eclipse.jdt.ui", "icons/full/obj16/jar_obj.gif");
+    }
+
+    public Class getTableEntryObjectType() {
+        return String.class;
+    }
+
+    public Object getInput() {
+        if (environment != null) {
+            return getClassFilter();
+        }
+        return super.getInput();
+    }
+    
+    public AdapterFactory getAdapterFactory() {
+        return new AdapterFactory() {
+            public Object[] getElements(Object inputElement) {
+                if (!ClassFilter.class.isInstance(inputElement)) {
+                    return new String[] { "" };
+                }
+                ClassFilter plan = (ClassFilter)inputElement;
+                return plan.getFilter().toArray();
+            }
+            public String getColumnText(Object element, int columnIndex) {
+                if (String.class.isInstance(element)) {
+                    String clazz = (String)element;
+                    switch (columnIndex) {
+                    case 0: return clazz;
+                    }
+                }
+                return null;
+            }
+        };
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ClassFilterSection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ClassFilterSection.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ClassFilterSection.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ClassFilterWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ClassFilterWizard.java?rev=672424&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ClassFilterWizard.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ClassFilterWizard.java Fri Jun 27 16:15:01 2008
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.wizards;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBModelUtils;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+import org.apache.geronimo.st.v21.ui.sections.ClassFilterSection;
+import org.apache.geronimo.jee.deployment.ClassFilter;
+import org.apache.geronimo.jee.deployment.Environment;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ClassFilterWizard extends AbstractTableWizard {
+
+    protected boolean isServerEnvironment;
+    
+    public ClassFilterWizard(AbstractTableSection section, boolean isServerEnvironment) {
+        super(section);
+        this.isServerEnvironment = isServerEnvironment;
+    }
+
+    public JAXBObjectFactory getEFactory() {
+        return JAXBObjectFactoryImpl.getInstance();
+    }
+
+    public String[] getTableColumnEAttributes() {
+        return new String[] { "Value" };
+    }
+
+    public String getAddWizardWindowTitle() {
+        return CommonMessages.wizardNewTitle_Dependency;
+    }
+
+    public String getEditWizardWindowTitle() {
+        return CommonMessages.wizardEditTitle_Dependency;
+    }
+
+    public String getWizardFirstPageTitle() {
+        return CommonMessages.wizardPageTitle_Dependency;
+    }
+
+    public String getWizardFirstPageDescription() {
+        return CommonMessages.wizardPageDescription_Dependency;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.st.ui.wizards.AbstractTableWizard#performFinish()
+     */
+    public boolean performFinish() {
+        DynamicWizardPage page = (DynamicWizardPage) getPages()[0];
+
+        if (eObject == null) {
+            eObject = new String();
+            JAXBElement plan = section.getPlan();
+
+            Environment environment = null;
+          	environment = JAXBModelUtils.getEnvironment(plan, isServerEnvironment);
+            if (environment == null) {
+                environment = (Environment)getEFactory().create(Environment.class);
+                JAXBModelUtils.setEnvironment (plan, environment, isServerEnvironment);
+            }
+
+            ClassFilter filter = ((ClassFilterSection)section).getClassFilter();
+            if (filter == null) {
+                filter = (ClassFilter)getEFactory().create(ClassFilter.class);
+                ((ClassFilterSection)section).setClassFilter (filter);
+            }
+            filter.getFilter().add(page.getTextEntry(0).getText());
+        }
+        else {
+            ClassFilter filter = ((ClassFilterSection)section).getClassFilter();
+            filter.getFilter().set(filter.getFilter().indexOf(eObject), page.getTextEntry(0).getText());
+        }
+
+        if (section.getTableViewer().getInput() == null) {
+            section.getTableViewer().setInput(section.getInput());
+        }
+
+        return true;
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ClassFilterWizard.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ClassFilterWizard.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ClassFilterWizard.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain