Save This Page
Home » geronimo-eclipse-plugin-2.2-source-release » org.apache.geronimo.st.v21.ui.editors » [javadoc | source]
    1   /*
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements.  See the NOTICE file distributed with
    4    * this work for additional information regarding copyright ownership.
    5    * The ASF licenses this file to You under the Apache License, Version 2.0
    6    * (the "License"); you may not use this file except in compliance with
    7    * the License.  You may obtain a copy of the License at
    8    *
    9    *    http://www.apache.org/licenses/LICENSE-2.0
   10    *
   11    * Unless required by applicable law or agreed to in writing, software
   12    * distributed under the License is distributed on an "AS IS" BASIS,
   13    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14    * See the License for the specific language governing permissions and
   15    * limitations under the License.
   16    */
   17   package org.apache.geronimo.st.v21.ui.editors;
   18   
   19   import java.io.IOException;
   20   
   21   import javax.xml.bind.JAXBElement;
   22   import javax.xml.bind.JAXBException;
   23   
   24   import org.apache.geronimo.st.core.jaxb.JAXBUtils;
   25   import org.apache.geronimo.st.ui.CommonMessages;
   26   import org.apache.geronimo.st.ui.editors.AbstractGeronimoDeploymentPlanEditor;
   27   import org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader;
   28   import org.apache.geronimo.st.v21.core.GeronimoServerInfo;
   29   import org.apache.geronimo.st.v21.core.GeronimoV21Utils;
   30   import org.apache.geronimo.st.v21.ui.pages.AppClientGeneralPage;
   31   import org.apache.geronimo.st.v21.ui.pages.AppClientSecurityPage;
   32   import org.apache.geronimo.st.v21.ui.pages.AppGeneralPage;
   33   import org.apache.geronimo.st.v21.ui.pages.ConnectorOverviewPage;
   34   import org.apache.geronimo.st.v21.ui.pages.ConnectorPage;
   35   import org.apache.geronimo.st.v21.ui.pages.DeploymentPage;
   36   import org.apache.geronimo.st.v21.ui.pages.EjbOverviewPage;
   37   import org.apache.geronimo.st.v21.ui.pages.NamingFormPage;
   38   import org.apache.geronimo.st.v21.ui.pages.SecurityPage;
   39   import org.apache.geronimo.st.v21.ui.pages.WebGeneralPage;
   40   import org.eclipse.core.resources.IFile;
   41   import org.eclipse.ui.PartInitException;
   42   import org.eclipse.ui.forms.editor.FormEditor;
   43   
   44   /**
   45    * @version $Rev$ $Date$
   46    */
   47   public class GeronimoFormContentLoader extends AbstractGeronimoFormContentLoader {
   48   
   49       /*
   50        * (non-Javadoc)
   51        * 
   52        * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addApplicationPlanPages(org.eclipse.ui.forms.editor.FormEditor)
   53        */
   54       public void addApplicationPlanPages(FormEditor editor) throws PartInitException {
   55           editor.addPage(new AppGeneralPage(editor, "appgeneralpage", CommonMessages.editorTabGeneral));
   56           editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity));
   57           editor.addPage(new ConnectorPage(editor,"connectorpage",CommonMessages.editorTabConnector));
   58           editor.addPage(createDeploymentFormPage(editor));
   59       }
   60   
   61       /*
   62        * (non-Javadoc)
   63        * 
   64        * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addConnectorPlanPages(org.eclipse.ui.forms.editor.FormEditor)
   65        */
   66       public void addConnectorPlanPages(FormEditor editor) throws PartInitException {
   67           editor.addPage(new ConnectorOverviewPage(editor, "connectoroverview", CommonMessages.editorTabGeneral));
   68           editor.addPage(createDeploymentFormPage(editor));
   69       }
   70   
   71       /*
   72        * (non-Javadoc)
   73        * 
   74        * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addApplicationPlanPages(org.eclipse.ui.forms.editor.FormEditor)
   75        */
   76       public void addApplicationClientPlanPages(FormEditor editor) throws PartInitException {
   77           editor.addPage(new AppClientGeneralPage(editor, "appclientgeneralpage", CommonMessages.editorTabGeneral));
   78           editor.addPage(createNamingFormPage(editor));
   79           editor.addPage(new AppClientSecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity));
   80           editor.addPage(createDeploymentFormPage(editor));
   81       }
   82   
   83       /*
   84        * (non-Javadoc)
   85        * 
   86        * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addOpenEjbPlanPages()
   87        */
   88       public void addOpenEjbPlanPages(FormEditor editor) throws PartInitException {
   89           editor.addPage(new EjbOverviewPage(editor, "ejboverview", CommonMessages.editorTabGeneral));
   90           editor.addPage(createNamingFormPage(editor));
   91           editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity));
   92           editor.addPage(createDeploymentFormPage(editor));
   93       }
   94   
   95       /*
   96        * (non-Javadoc)
   97        * 
   98        * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addWebPlanPages()
   99        */
  100       public void addWebPlanPages(FormEditor editor) throws PartInitException {
  101           AbstractGeronimoDeploymentPlanEditor geronimoEditor = (AbstractGeronimoDeploymentPlanEditor)editor;
  102           JAXBElement plan = geronimoEditor.getDeploymentPlan();
  103           editor.addPage(new WebGeneralPage(editor, "generalpage", CommonMessages.editorTabGeneral));
  104           editor.addPage(createNamingFormPage(editor));
  105           editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity));
  106           editor.addPage(createDeploymentFormPage(editor));
  107       }
  108   
  109       /*
  110        * (non-Javadoc)
  111        * 
  112        * @see org.apache.geronimo.st.ui.editors.IGeronimoFormContentLoader#loadDeploymentPlan(org.eclipse.core.resources.IFile)
  113        */
  114       public JAXBElement loadDeploymentPlan(IFile file) throws Exception {
  115           return GeronimoV21Utils.getDeploymentPlan(file);
  116       }
  117       
  118       public void saveDeploymentPlan(JAXBElement deploymentPlan, IFile file) throws Exception {
  119           JAXBUtils.marshalDeploymentPlan(deploymentPlan, file);
  120       }
  121   
  122       private NamingFormPage createNamingFormPage(FormEditor editor) {
  123           return new NamingFormPage(editor, "namingpage", CommonMessages.editorTabNaming);
  124       }
  125   
  126       private DeploymentPage createDeploymentFormPage(FormEditor editor) {
  127           return new DeploymentPage(editor, "deploymentpage", CommonMessages.editorTabDeployment);
  128       }
  129   
  130       public void triggerGeronimoServerInfoUpdate() {
  131           GeronimoServerInfo.getInstance().updateInfo();
  132       }
  133   }

Save This Page
Home » geronimo-eclipse-plugin-2.2-source-release » org.apache.geronimo.st.v21.ui.editors » [javadoc | source]