geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r344445 - in /geronimo/devtools/trunk/modules/eclipse-plugin/plugins: org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/ org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/
Date Tue, 15 Nov 2005 21:22:17 GMT
Author: sppatel
Date: Tue Nov 15 13:22:08 2005
New Revision: 344445

URL: http://svn.apache.org/viewcvs?rev=344445&view=rev
Log:
default to text editor if can't open plan

Modified:
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServer.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/AbstractGeronimoDeploymentPlanEditor.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/ApplicationPlanEditor.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/ConnectorPlanEditor.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/OpenEjbPlanEditor.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/WebEditor.java

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServer.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServer.java?rev=344445&r1=344444&r2=344445&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServer.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServer.java
Tue Nov 15 13:22:08 2005
@@ -29,7 +29,9 @@
 
     public static final String PROPERTY_ADMIN_PW = "adminPassword";
     
-    public static final String PROPERY_RMI_PORT = "rmiport";
+    public static final String PROPERTY_RMI_PORT = "rmiport";
+    
+    public static final String PROPERY_HTTP_PORT = "port";
 
     /*
      * (non-Javadoc)
@@ -76,7 +78,11 @@
     }
     
     public String getRMINamingPort() {
-        return (String) getServerInstanceProperties().get(PROPERY_RMI_PORT);    
+        return (String) getServerInstanceProperties().get(PROPERTY_RMI_PORT);    
+    }
+    
+    public String getHTTPPort() {
+        return (String) getServerInstanceProperties().get(PROPERY_HTTP_PORT);    
     }
 
     public void setAdminID(String value) {
@@ -88,7 +94,11 @@
     }
 
     public void setRMINamingPort(String value) {
-        getServerInstanceProperties().put(PROPERY_RMI_PORT, value);    
+        getServerInstanceProperties().put(PROPERTY_RMI_PORT, value);    
+    }
+    
+    public void setHTTPPort(String value) {
+        getServerInstanceProperties().put(PROPERY_HTTP_PORT, value);    
     }
     
     

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/AbstractGeronimoDeploymentPlanEditor.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/AbstractGeronimoDeploymentPlanEditor.java?rev=344445&r1=344444&r2=344445&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/AbstractGeronimoDeploymentPlanEditor.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/AbstractGeronimoDeploymentPlanEditor.java
Tue Nov 15 13:22:08 2005
@@ -24,6 +24,8 @@
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.IFileEditorInput;
@@ -39,121 +41,127 @@
  */
 public abstract class AbstractGeronimoDeploymentPlanEditor extends FormEditor {
 
-    private EObject deploymentPlan;
+	private EObject deploymentPlan;
 
-    /**
-     * 
-     */
-    public AbstractGeronimoDeploymentPlanEditor() {
-        super();
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
-     */
-    public void doSave(IProgressMonitor monitor) {
-        InputStream is = null;
-        try {
-            IEditorInput input = getEditorInput();
-            if (input instanceof IFileEditorInput) {
-
-                deploymentPlan.eResource().save(Collections.EMPTY_MAP);
-                commitFormPages(true);
-                editorDirtyStateChanged();
-
-            }
-        } catch (Exception e) {
-            Trace.trace(Trace.SEVERE, "Error saving", e);
-        } finally {
-            try {
-                if (is != null)
-                    is.close();
-            } catch (Exception e) {
-                // do nothing
-            }
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.ui.forms.editor.FormEditor#addPages()
-     */
-    protected void addPages() {
-        try {
-            doAddPages();
-        } catch (PartInitException e1) {
-            e1.printStackTrace();
-        }
-    }
-
-    abstract public void doAddPages() throws PartInitException;
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.ui.part.EditorPart#doSaveAs()
-     */
-    public final void doSaveAs() {
-        // do nothing
-    }
+	/**
+	 * 
+	 */
+	public AbstractGeronimoDeploymentPlanEditor() {
+		super();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public void doSave(IProgressMonitor monitor) {
+		InputStream is = null;
+		try {
+			IEditorInput input = getEditorInput();
+			if (input instanceof IFileEditorInput) {
+				if (deploymentPlan != null) {
+					deploymentPlan.eResource().save(Collections.EMPTY_MAP);
+					commitFormPages(true);
+					editorDirtyStateChanged();
+				} else {
+					getActiveEditor().doSave(monitor);
+				}
+			}
+		} catch (Exception e) {
+			Trace.trace(Trace.SEVERE, "Error saving", e);
+		} finally {
+			try {
+				if (is != null)
+					is.close();
+			} catch (Exception e) {
+				// do nothing
+			}
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.forms.editor.FormEditor#addPages()
+	 */
+	protected void addPages() {
+		try {
+			doAddPages();
+		} catch (PartInitException e1) {
+			e1.printStackTrace();
+		}
+	}
+
+	abstract public void doAddPages() throws PartInitException;
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.part.EditorPart#doSaveAs()
+	 */
+	public final void doSaveAs() {
+		// do nothing
+	}
 
-    protected void addSourcePage() throws PartInitException {
-        TextEditor source = new TextEditor();
+	protected void addSourcePage() throws PartInitException {
+		TextEditor source = new TextEditor();
         int index = addPage(source, getEditorInput());
         setPageText(index, Messages.editorTabSource);
-    }
+	}
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
-     */
-    public boolean isSaveAsAllowed() {
-        return false;
-    }
-
-    public void commitFormPages(boolean onSave) {
-        IFormPage[] pages = getPages();
-        for (int i = 0; i < pages.length; i++) {
-            IFormPage page = pages[i];
-            IManagedForm mform = page.getManagedForm();
-            if (mform != null && mform.isDirty())
-                mform.commit(true);
-        }
-    }
-
-    public IFormPage[] getPages() {
-        ArrayList formPages = new ArrayList();
-        for (int i = 0; i < pages.size(); i++) {
-            Object page = pages.get(i);
-            if (page instanceof IFormPage)
-                formPages.add(page);
-        }
-        return (IFormPage[]) formPages.toArray(new IFormPage[formPages.size()]);
-    }
-
-    public EObject getDeploymentPlan() {
-        return deploymentPlan;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.ui.IEditorPart#init(org.eclipse.ui.IEditorSite,
-     *      org.eclipse.ui.IEditorInput)
-     */
-    public void init(IEditorSite site, IEditorInput input)
-            throws PartInitException {
-        super.init(site, input);
-        if (input instanceof IFileEditorInput) {
-            IFileEditorInput fei = (IFileEditorInput) input;
-            deploymentPlan = loadDeploymentPlan(fei.getFile());
-        }
-    }
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
+	 */
+	public boolean isSaveAsAllowed() {
+		return false;
+	}
+
+	public void commitFormPages(boolean onSave) {
+		IFormPage[] pages = getPages();
+		for (int i = 0; i < pages.length; i++) {
+			IFormPage page = pages[i];
+			IManagedForm mform = page.getManagedForm();
+			if (mform != null && mform.isDirty())
+				mform.commit(true);
+		}
+	}
+
+	public IFormPage[] getPages() {
+		ArrayList formPages = new ArrayList();
+		for (int i = 0; i < pages.size(); i++) {
+			Object page = pages.get(i);
+			if (page instanceof IFormPage)
+				formPages.add(page);
+		}
+		return (IFormPage[]) formPages.toArray(new IFormPage[formPages.size()]);
+	}
+
+	public EObject getDeploymentPlan() {
+		return deploymentPlan;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.IEditorPart#init(org.eclipse.ui.IEditorSite,
+	 *      org.eclipse.ui.IEditorInput)
+	 */
+	public void init(IEditorSite site, IEditorInput input)
+			throws PartInitException {
+		super.init(site, input);
+		if (input instanceof IFileEditorInput) {
+			IFileEditorInput fei = (IFileEditorInput) input;
+			deploymentPlan = loadDeploymentPlan(fei.getFile());
+			if (deploymentPlan == null) {
+				MessageDialog.openInformation(Display.getDefault()
+						.getActiveShell(), "Error Opening Editor", "Could not open the deployment plan editor.
 Opening the default text editor.");
+			}
+		}
+	}
 
-    abstract public EObject loadDeploymentPlan(IFile file);
+	abstract public EObject loadDeploymentPlan(IFile file);
 
 }

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/ApplicationPlanEditor.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/ApplicationPlanEditor.java?rev=344445&r1=344444&r2=344445&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/ApplicationPlanEditor.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/ApplicationPlanEditor.java
Tue Nov 15 13:22:08 2005
@@ -29,43 +29,45 @@
 
 public class ApplicationPlanEditor extends AbstractGeronimoDeploymentPlanEditor {
 
-    public ApplicationPlanEditor() {
-        super();
-    }
+	public ApplicationPlanEditor() {
+		super();
+	}
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.geronimo.ui.editors.AbstractGeronimoDeploymentPlanEditor#doAddPages()
-     */
-    public void doAddPages() throws PartInitException {
-        addPage(new AppGeneralPage(this, "appgeneralpage",
-                Messages.editorTabGeneral));
-        addPage(new SecurityPage(this, "securitypage",
-                Messages.editorTabSecurity, ApplicationPackage.eINSTANCE
-                        .getApplicationType_Security()));
-        addPage(getDeploymentPage());
-        addSourcePage();
-    }
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.ui.editors.AbstractGeronimoDeploymentPlanEditor#doAddPages()
+	 */
+	public void doAddPages() throws PartInitException {
+		if (getDeploymentPlan() != null) {
+			addPage(new AppGeneralPage(this, "appgeneralpage",
+					Messages.editorTabGeneral));
+			addPage(new SecurityPage(this, "securitypage",
+					Messages.editorTabSecurity, ApplicationPackage.eINSTANCE
+							.getApplicationType_Security()));
+			addPage(getDeploymentPage());
+		}
+		addSourcePage();
+	}
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.geronimo.ui.editors.AbstractGeronimoDeploymentPlanEditor#loadDeploymentPlan(org.eclipse.core.resources.IFile)
-     */
-    public EObject loadDeploymentPlan(IFile file) {
-        return GeronimoUtils.getApplicationDeploymentPlan(file);
-    }
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.ui.editors.AbstractGeronimoDeploymentPlanEditor#loadDeploymentPlan(org.eclipse.core.resources.IFile)
+	 */
+	public EObject loadDeploymentPlan(IFile file) {
+		return GeronimoUtils.getApplicationDeploymentPlan(file);
+	}
 
-    private FormPage getDeploymentPage() {
-        DeploymentPage formPage = new DeploymentPage(this, "deploymentpage",
-                Messages.editorTabDeployment);
-        ApplicationPackage pkg = ApplicationFactory.eINSTANCE
-                .getApplicationPackage();
-        formPage.dependencies = pkg.getApplicationType_Dependency();
-        formPage.imports = pkg.getApplicationType_Import();
-        formPage.gbeans = pkg.getApplicationType_Gbean();
-        return formPage;
-    }
+	private FormPage getDeploymentPage() {
+		DeploymentPage formPage = new DeploymentPage(this, "deploymentpage",
+				Messages.editorTabDeployment);
+		ApplicationPackage pkg = ApplicationFactory.eINSTANCE
+				.getApplicationPackage();
+		formPage.dependencies = pkg.getApplicationType_Dependency();
+		formPage.imports = pkg.getApplicationType_Import();
+		formPage.gbeans = pkg.getApplicationType_Gbean();
+		return formPage;
+	}
 
 }

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/ConnectorPlanEditor.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/ConnectorPlanEditor.java?rev=344445&r1=344444&r2=344445&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/ConnectorPlanEditor.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/ConnectorPlanEditor.java
Tue Nov 15 13:22:08 2005
@@ -28,34 +28,36 @@
 
 public class ConnectorPlanEditor extends AbstractGeronimoDeploymentPlanEditor {
 
-    public ConnectorPlanEditor() {
-        super();
-    }
+	public ConnectorPlanEditor() {
+		super();
+	}
 
-    public void doAddPages() throws PartInitException {
-        addPage(new ConnectorOverviewPage(this, "connectoroverview",
-                Messages.editorTabGeneral));
-        addPage(getDeploymentPage());        
-        addSourcePage();
-    }
+	public void doAddPages() throws PartInitException {
+		if (getDeploymentPlan() != null) {
+			addPage(new ConnectorOverviewPage(this, "connectoroverview",
+					Messages.editorTabGeneral));
+			addPage(getDeploymentPage());
+		}
+		addSourcePage();
+	}
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.geronimo.ui.editors.AbstractGeronimoDeploymentPlanEditor#loadDeploymentPlan(org.eclipse.core.resources.IFile)
-     */
-    public EObject loadDeploymentPlan(IFile file) {
-        return GeronimoUtils.getConnectorDeploymentPlan(file);
-    }
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.ui.editors.AbstractGeronimoDeploymentPlanEditor#loadDeploymentPlan(org.eclipse.core.resources.IFile)
+	 */
+	public EObject loadDeploymentPlan(IFile file) {
+		return GeronimoUtils.getConnectorDeploymentPlan(file);
+	}
 
-    private FormPage getDeploymentPage() {
-        DeploymentPage formPage = new DeploymentPage(this, "deploymentpage",
-                Messages.editorTabDeployment);
-        ConnectorPackage pkg = ConnectorFactory.eINSTANCE.getConnectorPackage();
-        formPage.dependencies = pkg.getConnectorType_Dependency();
-        formPage.imports = pkg.getConnectorType_Import();
-        formPage.gbeans = pkg.getConnectorType_Gbean();
-        return formPage;
-    }
+	private FormPage getDeploymentPage() {
+		DeploymentPage formPage = new DeploymentPage(this, "deploymentpage",
+				Messages.editorTabDeployment);
+		ConnectorPackage pkg = ConnectorFactory.eINSTANCE.getConnectorPackage();
+		formPage.dependencies = pkg.getConnectorType_Dependency();
+		formPage.imports = pkg.getConnectorType_Import();
+		formPage.gbeans = pkg.getConnectorType_Gbean();
+		return formPage;
+	}
 
 }

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/OpenEjbPlanEditor.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/OpenEjbPlanEditor.java?rev=344445&r1=344444&r2=344445&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/OpenEjbPlanEditor.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/OpenEjbPlanEditor.java
Tue Nov 15 13:22:08 2005
@@ -33,41 +33,43 @@
  */
 public class OpenEjbPlanEditor extends AbstractGeronimoDeploymentPlanEditor {
 
-    /**
-     * 
-     */
-    public OpenEjbPlanEditor() {
-        super();
-    }
+	/**
+	 * 
+	 */
+	public OpenEjbPlanEditor() {
+		super();
+	}
 
-    public void doAddPages() throws PartInitException {
-        addPage(new EjbOverviewPage(this, "ejboverview",
-                Messages.editorTabGeneral));
-        // TODO Add naming page but broken down for each bean type
-        addPage(new SecurityPage(this, "securitypage",
-                Messages.editorTabSecurity, JarPackage.eINSTANCE
-                        .getOpenejbJarType_Security()));
-        addPage(getDeploymentPage());
-        addSourcePage();
-    }
+	public void doAddPages() throws PartInitException {
+		if (getDeploymentPlan() != null) {
+			addPage(new EjbOverviewPage(this, "ejboverview",
+					Messages.editorTabGeneral));
+			// TODO Add naming page but broken down for each bean type
+			addPage(new SecurityPage(this, "securitypage",
+					Messages.editorTabSecurity, JarPackage.eINSTANCE
+							.getOpenejbJarType_Security()));
+			addPage(getDeploymentPage());
+		}
+		addSourcePage();
+	}
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.geronimo.ui.editors.AbstractGeronimoDeploymentPlanEditor#loadDeploymentPlan(org.eclipse.core.resources.IFile)
-     */
-    public EObject loadDeploymentPlan(IFile file) {
-        return GeronimoUtils.getOpenEjbDeploymentPlan(file);
-    }
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.ui.editors.AbstractGeronimoDeploymentPlanEditor#loadDeploymentPlan(org.eclipse.core.resources.IFile)
+	 */
+	public EObject loadDeploymentPlan(IFile file) {
+		return GeronimoUtils.getOpenEjbDeploymentPlan(file);
+	}
 
-    private FormPage getDeploymentPage() {
-        DeploymentPage formPage = new DeploymentPage(this, "deploymentpage",
-                Messages.editorTabDeployment);
-        JarPackage pkg = JarFactory.eINSTANCE.getJarPackage();
-        formPage.dependencies = pkg.getOpenejbJarType_Dependency();
-        formPage.imports = pkg.getOpenejbJarType_Import();
-        formPage.gbeans = pkg.getOpenejbJarType_Gbean();
-        return formPage;
-    }
+	private FormPage getDeploymentPage() {
+		DeploymentPage formPage = new DeploymentPage(this, "deploymentpage",
+				Messages.editorTabDeployment);
+		JarPackage pkg = JarFactory.eINSTANCE.getJarPackage();
+		formPage.dependencies = pkg.getOpenejbJarType_Dependency();
+		formPage.imports = pkg.getOpenejbJarType_Import();
+		formPage.gbeans = pkg.getOpenejbJarType_Gbean();
+		return formPage;
+	}
 
 }

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/WebEditor.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/WebEditor.java?rev=344445&r1=344444&r2=344445&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/WebEditor.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/WebEditor.java
Tue Nov 15 13:22:08 2005
@@ -31,47 +31,49 @@
 
 public class WebEditor extends AbstractGeronimoDeploymentPlanEditor {
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.geronimo.ui.editors.AbstractGeronimoDeploymentPlanEditor#doAddPages()
-     */
-    public void doAddPages() throws PartInitException {
-        addPage(new WebGeneralPage(this, "generalpage",
-                Messages.editorTabGeneral));
-        addPage(getNamingPage());
-        addPage(new SecurityPage(this, "securitypage",
-                Messages.editorTabSecurity, WebPackageImpl.eINSTANCE
-                        .getWebAppType_Security()));
-        addPage(getDeploymentPage());
-        addSourcePage();
-    }
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.ui.editors.AbstractGeronimoDeploymentPlanEditor#doAddPages()
+	 */
+	public void doAddPages() throws PartInitException {
+		if (getDeploymentPlan() != null) {
+			addPage(new WebGeneralPage(this, "generalpage",
+					Messages.editorTabGeneral));
+			addPage(getNamingPage());
+			addPage(new SecurityPage(this, "securitypage",
+					Messages.editorTabSecurity, WebPackageImpl.eINSTANCE
+							.getWebAppType_Security()));
+			addPage(getDeploymentPage());
+		}
+		addSourcePage();
+	}
 
-    public EObject loadDeploymentPlan(IFile file) {
-        return GeronimoUtils.getWebDeploymentPlan(file);
-    }
+	public EObject loadDeploymentPlan(IFile file) {
+		return GeronimoUtils.getWebDeploymentPlan(file);
+	}
 
-    private FormPage getNamingPage() {
-        NamingFormPage formPage = new NamingFormPage(this, "namingpage",
-                Messages.editorTabNaming);
-        WebPackage pkg = WebFactory.eINSTANCE.getWebPackage();
-        formPage.ejbLocalRef = pkg.getWebAppType_EjbLocalRef();
-        formPage.ejbRef = pkg.getWebAppType_EjbRef();
-        formPage.resEnvRef = pkg.getWebAppType_ResourceEnvRef();
-        formPage.resRef = pkg.getWebAppType_ResourceRef();
-        formPage.gbeanRef = pkg.getWebAppType_GbeanRef();
-        formPage.serviceRef = pkg.getWebAppType_ServiceRef();
-        return formPage;
-    }
+	private FormPage getNamingPage() {
+		NamingFormPage formPage = new NamingFormPage(this, "namingpage",
+				Messages.editorTabNaming);
+		WebPackage pkg = WebFactory.eINSTANCE.getWebPackage();
+		formPage.ejbLocalRef = pkg.getWebAppType_EjbLocalRef();
+		formPage.ejbRef = pkg.getWebAppType_EjbRef();
+		formPage.resEnvRef = pkg.getWebAppType_ResourceEnvRef();
+		formPage.resRef = pkg.getWebAppType_ResourceRef();
+		formPage.gbeanRef = pkg.getWebAppType_GbeanRef();
+		formPage.serviceRef = pkg.getWebAppType_ServiceRef();
+		return formPage;
+	}
 
-    private FormPage getDeploymentPage() {
-        DeploymentPage formPage = new DeploymentPage(this, "deploymentpage",
-                Messages.editorTabDeployment);
-        WebPackage pkg = WebFactory.eINSTANCE.getWebPackage();
-        formPage.dependencies = pkg.getWebAppType_Dependency();
-        formPage.imports = pkg.getWebAppType_Import();
-        formPage.gbeans = pkg.getWebAppType_Gbean();
-        return formPage;
-    }
+	private FormPage getDeploymentPage() {
+		DeploymentPage formPage = new DeploymentPage(this, "deploymentpage",
+				Messages.editorTabDeployment);
+		WebPackage pkg = WebFactory.eINSTANCE.getWebPackage();
+		formPage.dependencies = pkg.getWebAppType_Dependency();
+		formPage.imports = pkg.getWebAppType_Import();
+		formPage.gbeans = pkg.getWebAppType_Gbean();
+		return formPage;
+	}
 
 }



Mime
View raw message