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/17 23:23:14 UTC

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

Author: mcconne
Date: Tue Jun 17 14:23:13 2008
New Revision: 668834

URL: http://svn.apache.org/viewvc?rev=668834&view=rev
Log:
GERONIMODEVTOOLS Fixes for Application General Page deployment plan editor. Thanks to BJ Reed for this patch !!

Modified:
    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.ui/src/main/java/org/apache/geronimo/st/ui/sections/AbstractSectionPart.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppGeneralSection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/CommonGeneralSection.java

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=668834&r1=668833&r2=668834&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 Tue Jun 17 14:23:13 2008
@@ -119,6 +119,7 @@
 	public static String editorSectionGeneralTitle;
 	public static String editorSectionGeneralDescription;
 	public static String editorContextRoot;
+	public static String editorApplicationName;
     public static String editorSectionServerTitle;
     public static String editorSectionServerDescription;
     public static String editorSectionClientTitle;

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=668834&r1=668833&r2=668834&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 Tue Jun 17 14:23:13 2008
@@ -78,6 +78,7 @@
 maxPingsTooltip=The number of pings to the server before startup is considered a failure.
 
 editorContextRoot=Context Root:
+editorApplicationName=Application Name:
 
 editorResourceRefTitle=Resource References
 editorResourceRefDescription=The following resource references are defined:

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/AbstractSectionPart.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/sections/AbstractSectionPart.java?rev=668834&r1=668833&r2=668834&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/AbstractSectionPart.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/AbstractSectionPart.java Tue Jun 17 14:23:13 2008
@@ -21,7 +21,11 @@
 
 import javax.xml.bind.JAXBElement;
 
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.IFormColors;
 import org.eclipse.ui.forms.SectionPart;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.forms.widgets.Section;
@@ -31,52 +35,65 @@
  */
 public abstract class AbstractSectionPart extends SectionPart {
 
-	protected FormToolkit toolkit;
+    protected FormToolkit toolkit;
 
-	private JAXBElement plan;
+    private JAXBElement plan;
 
-	/**
-	 * @param section
-	 */
-	public AbstractSectionPart(Section section) {
-		super(section);
-	}
-
-	/**
-	 * @param parent
-	 * @param toolkit
-	 * @param style
-	 * @param plan
-	 */
-	public AbstractSectionPart(Composite parent, FormToolkit toolkit,
-			int style, JAXBElement plan) {
-		super(parent, toolkit, style);
-		this.toolkit = toolkit;
-		this.plan = plan;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.forms.IFormPart#commit(boolean)
-	 * 
-	 * Overriding this method as a workaround as switching tabs on a dirty
-	 * editor commits the page and marks the part as not dirty.
-	 */
-	public void commit(boolean onSave) {
-		boolean currentDirtyState = isDirty();
-		super.commit(onSave);
-		if (!onSave && currentDirtyState) {
-			markDirty();
-		}
-	}
-
-	public JAXBElement getPlan() {
-		return plan;
-	}
-
-	public FormToolkit getToolkit() {
-		return toolkit;
-	}
+    /**
+     * @param section
+     */
+    public AbstractSectionPart(Section section) {
+        super(section);
+    }
+
+    /**
+     * @param parent
+     * @param toolkit
+     * @param style
+     * @param plan
+     */
+    public AbstractSectionPart(Composite parent, FormToolkit toolkit,
+            int style, JAXBElement plan) {
+        super(parent, toolkit, style);
+        this.toolkit = toolkit;
+        this.plan = plan;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.ui.forms.IFormPart#commit(boolean)
+     * 
+     * Overriding this method as a workaround as switching tabs on a dirty
+     * editor commits the page and marks the part as not dirty.
+     */
+    public void commit(boolean onSave) {
+        boolean currentDirtyState = isDirty();
+        super.commit(onSave);
+        if (!onSave && currentDirtyState) {
+            markDirty();
+        }
+    }
+
+    public JAXBElement getPlan() {
+        return plan;
+    }
+
+    public FormToolkit getToolkit() {
+        return toolkit;
+    }
+
+    protected Label createLabel(Composite parent, String text) {
+        Label label = toolkit.createLabel(parent, text);
+        label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+        label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+        return label;
+    }
+
+    protected GridData createTextFieldGridData() {
+        GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
+        data.widthHint = 150;
+        return data;
+    }
 
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppGeneralSection.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/AppGeneralSection.java?rev=668834&r1=668833&r2=668834&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppGeneralSection.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppGeneralSection.java Tue Jun 17 14:23:13 2008
@@ -1,43 +1,58 @@
-/*
- * 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 javax.xml.bind.JAXBElement;
-
-import org.apache.geronimo.jee.application.Application;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-public class AppGeneralSection extends CommonGeneralSection {
-
-	Application plan;
-
-	public AppGeneralSection(Composite parent, FormToolkit toolkit, int style, JAXBElement plan) {
-		super(parent, toolkit, style, plan);
-		this.plan = (Application) plan.getValue();
-		createClient();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.st.v21.ui.sections.CommonGeneralSection#getEnvironmentEReference()
-	 */
-	protected JAXBElement getEnvironmentEReference() {
-		return null; //ApplicationPackage.eINSTANCE.getApplicationType_Environment();
-	}
-}
+/*
+ * 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 javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.jee.application.Application;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+public class AppGeneralSection extends CommonGeneralSection {
+
+    protected Text applicationName;
+
+    Application plan;
+
+    public AppGeneralSection(Composite parent, FormToolkit toolkit, int style, JAXBElement plan) {
+        super(parent, toolkit, style, plan);
+        this.plan = (Application) plan.getValue();
+        createClient();
+    }
+
+    protected void createClient() {
+        super.createClient();
+        Composite composite = (Composite) getSection().getClient();
+
+        createLabel(composite, CommonMessages.editorApplicationName);
+
+        applicationName = toolkit.createText(composite, plan.getApplicationName(), SWT.BORDER);
+        applicationName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+        applicationName.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                plan.setApplicationName(applicationName.getText());
+                markDirty();
+            }
+        });
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/CommonGeneralSection.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/CommonGeneralSection.java?rev=668834&r1=668833&r2=668834&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/CommonGeneralSection.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/CommonGeneralSection.java Tue Jun 17 14:23:13 2008
@@ -42,9 +42,7 @@
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.IFormColors;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.forms.widgets.Section;
 
@@ -182,19 +180,6 @@
         });
     }
 
-    protected Label createLabel(Composite parent, String text) {
-        Label label = toolkit.createLabel(parent, text);
-        label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
-        label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-        return label;
-    }
-
-    protected GridData createTextFieldGridData() {
-        GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
-        data.widthHint = 150;
-        return data;
-    }
-
     protected String getGroupId() {
         Artifact moduleId = getModuleId(false);
         if (moduleId != null
@@ -366,8 +351,6 @@
         return deploymentObjectFactory;
     }
 
-    protected abstract JAXBElement getEnvironmentEReference();
-
     protected String getSectionGeneralTitle() {
         return CommonMessages.editorSectionGeneralTitle;
     }