Author: bjreed
Date: Mon Jan 12 10:56:29 2009
New Revision: 733867
URL: http://svn.apache.org/viewvc?rev=733867&view=rev
Log:
GERONIMODEVTOOLS-548. Adding Plugin Page to Server that has buttons on it for cleaner way to bring up Custom Server Assembly and Convert App to Plugin wizards
Added:
geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/ServerPluginPage.java (with props)
geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServerPluginSection.java (with props)
geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/ServerPluginPage.java (with props)
geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServerPluginSection.java (with props)
Removed:
geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/actions/
geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/actions/
Modified:
geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/plugin.properties
geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/plugin.xml
geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerPluginManager.java
geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/META-INF/MANIFEST.MF
geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/plugin.properties
geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/plugin.xml
geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.properties
geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml
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/operations/GeronimoServerPluginManager.java
geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/META-INF/MANIFEST.MF
geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.properties
geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.xml
Modified: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/plugin.properties
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/plugin.properties?rev=733867&r1=733866&r2=733867&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/plugin.properties (original)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/plugin.properties Mon Jan 12 10:56:29 2009
@@ -21,4 +21,4 @@
PopupMenus.launchconsole=Launch Geronimo Console
PopupMenus.launchSupport=Launch Geronimo Support
-deploymentPlanEditorName=Geronimo Deployment Plan Editor
\ No newline at end of file
+deploymentPlanEditorName=Geronimo Deployment Plan Editor
Modified: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/plugin.xml?rev=733867&r1=733866&r2=733867&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/plugin.xml (original)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/plugin.xml Mon Jan 12 10:56:29 2009
@@ -170,7 +170,6 @@
</section>
</extension>
-
<!--
|
| Define the Web editor class for the various Geronimo-specific XML files
Modified: geronimo/devtools/eclipse-plugin/branches/2.1.4/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/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java?rev=733867&r1=733866&r2=733867&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java (original)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java Mon Jan 12 10:56:29 2009
@@ -370,7 +370,9 @@
public static String editorCorrect;
public static String editorDefault;
+ public static String serverNotStarted;
public static String errorOpenDialog;
+ public static String errorOpenWizard;
public static String gBeanLink;
public static String moduleId;
@@ -414,6 +416,9 @@
public static String java;
public static String web;
public static String plugin;
+ public static String pluginActions;
+ public static String createCustomAssembly;
+ public static String convertAppsToPlugins;
public static String licenseAgreement;
public static String acceptLicenseAgreement;
Modified: geronimo/devtools/eclipse-plugin/branches/2.1.4/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/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties?rev=733867&r1=733866&r2=733867&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties (original)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties Mon Jan 12 10:56:29 2009
@@ -362,7 +362,9 @@
editorCorrect=There was an error opening the editor. The elements in the plan may not be qualified, do you want to try to auto-correct this? Otherwise the default text editor will be opened.
editorDefault=Could not load the deployment plan. Opening default text editor.
+serverNotStarted=Server has not been started. Please start the server and retry the action.
errorOpenDialog=Error opening editor.
+errorOpenWizard=Error opening wizard.
sourceLocWizTitle=Geronimo Source
sourceLocWizDescription=Choose the geronimo source zip file to locate source from during debug sessions.
@@ -417,6 +419,9 @@
java=Java
web=Web
plugin=Plugin
+pluginActions=Plugin actions that can be performed on the server
+createCustomAssembly=Create Custom Assembly
+convertAppsToPlugins=Convert Apps to Plugins
savePageTitle=Save Resource
savePageMessage=Data must be saved before entering or leaving the Source page.
Modified: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerPluginManager.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerPluginManager.java?rev=733867&r1=733866&r2=733867&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerPluginManager.java (original)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerPluginManager.java Mon Jan 12 10:56:29 2009
@@ -48,6 +48,7 @@
import org.apache.geronimo.kernel.repository.Dependency;
import org.apache.geronimo.kernel.repository.ImportType;
import org.apache.geronimo.st.core.CommonMessages;
+import org.apache.geronimo.st.core.GeronimoConnectionFactory;
import org.apache.geronimo.st.core.GeronimoServerBehaviourDelegate;
import org.apache.geronimo.st.core.jaxb.JAXBUtils;
import org.apache.geronimo.st.v21.core.internal.Trace;
@@ -61,6 +62,7 @@
import org.apache.geronimo.system.plugin.model.PluginType;
import org.apache.geronimo.system.plugin.model.PrerequisiteType;
import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
/**
* @version $Rev$ $Date$
@@ -68,28 +70,17 @@
public class GeronimoServerPluginManager {
private IServer server;
- private RemoteDeploymentManager remoteDM;
private PluginListType data;
private List<String> pluginList;
private Kernel kernel;
private PluginInstaller pluginInstaller;
- public GeronimoServerPluginManager () {
- kernel = null;
-
- Trace.tracePoint("Constructor", "GeronimoServerPluginManager");
- }
-
- public boolean serverChanged (Object aServer, String serverPrefix) {
- Trace.tracePoint("Entry", "GeronimoServerPluginManager.serverChanged", aServer, serverPrefix);
- server = (IServer)aServer;
-
- boolean enabled = server != null &&
- server.getServerType().getId().startsWith(serverPrefix) &&
- server.getServerState() == IServer.STATE_STARTED;
-
+ // The ServerWorkingCopy is passed in, not the IServer itself
+ public GeronimoServerPluginManager (IServer aServer) {
+ ServerWorkingCopy copy = (ServerWorkingCopy)aServer;
+ server = copy.getOriginal();
try {
- if (server !=null) {
+ if (server != null) {
GeronimoServerBehaviourDelegate delegate = (GeronimoServerBehaviourDelegate) server
.getAdapter(GeronimoServerBehaviourDelegate.class);
if (delegate != null) {
@@ -100,14 +91,12 @@
pluginInstaller = (PluginInstaller)kernel.getGBean(PluginInstaller.class);
}
}
- } catch (Throwable e) {
+ } catch (Exception e) {
e.printStackTrace();
Trace.trace(Trace.WARNING, "Kernel connection failed. "
+ e.getMessage());
}
-
- Trace.tracePoint("Exit", "GeronimoServerPluginManager.serverChanged", enabled);
- return enabled;
+ Trace.tracePoint("Constructor", "GeronimoServerPluginManager");
}
public List<String> getPluginList () {
@@ -165,6 +154,8 @@
}
try {
+ GeronimoConnectionFactory gcFactory = GeronimoConnectionFactory.getInstance();
+ RemoteDeploymentManager remoteDM = (RemoteDeploymentManager)gcFactory.getDeploymentManager(server);
remoteDM.installPluginList("repository", relativeServerPath, selectedPlugins);
remoteDM.archive(relativeServerPath, "var/temp", new Artifact(group, artifact, (String)version, format));
}
Modified: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/META-INF/MANIFEST.MF?rev=733867&r1=733866&r2=733867&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/META-INF/MANIFEST.MF (original)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/META-INF/MANIFEST.MF Mon Jan 12 10:56:29 2009
@@ -8,11 +8,14 @@
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.commands,
+ org.eclipse.debug.ui,
org.apache.geronimo.st.v21.core,
org.apache.geronimo.st.ui,
org.eclipse.ui.forms,
org.eclipse.core.resources,
org.eclipse.wst.common.project.facet.ui,
+ org.eclipse.wst.server.core,
+ org.eclipse.wst.server.ui,
org.apache.geronimo.jee.v21.jaxbmodel,
org.apache.geronimo.runtime.common,
org.apache.geronimo.runtime.v21
Modified: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/plugin.properties
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/plugin.properties?rev=733867&r1=733866&r2=733867&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/plugin.properties (original)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/plugin.properties Mon Jan 12 10:56:29 2009
@@ -16,5 +16,4 @@
#
# $Rev$ $Date$
#
-PopupMenus.launchPluginManager=Launch Plugin Manager
-PopupMenus.launchServerAssembly=Launch Custom Server Assembly
+serverEditorPluginPage=Plugin
Modified: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/plugin.xml?rev=733867&r1=733866&r2=733867&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/plugin.xml (original)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/plugin.xml Mon Jan 12 10:56:29 2009
@@ -34,37 +34,22 @@
<wizard-pages action="geronimo.plan.install.v21">
<page class="org.apache.geronimo.st.v21.ui.wizards.FacetInstallPage"/>
</wizard-pages>
- </extension>
-
- <extension point="org.eclipse.ui.popupMenus">
- <objectContribution adaptable="true" id="org.apache.geronimo.ui.serveractions"
- objectClass="org.eclipse.wst.server.core.IServer">
- <enablement>
- <test forcePluginActivation="true" property="org.eclipse.wst.server.ui.serverType"
- value="org.apache.geronimo.*" />
- </enablement>
- <action id="org.apache.geronimo.ui.launchServerAssembly"
- label="%PopupMenus.launchServerAssembly" icon="icons/obj16/littleG.gif"
- class="org.apache.geronimo.st.v21.ui.actions.LaunchGeronimoServerAssemblyAction"
- enablesFor="1">
- </action>
- </objectContribution>
</extension>
- <extension point="org.eclipse.ui.popupMenus">
- <objectContribution adaptable="true" id="org.apache.geronimo.ui.serveractions"
- objectClass="org.eclipse.wst.server.core.IServer">
- <enablement>
- <test forcePluginActivation="true"
- property="org.eclipse.wst.server.ui.serverType"
- value="org.apache.geronimo.*" />
- </enablement>
- <action id="org.apache.geronimo.ui.launchPluginManager"
- label="%PopupMenus.launchPluginManager" icon="icons/obj16/littleG.gif"
- class="org.apache.geronimo.st.v21.ui.actions.LaunchGeronimoPluginManagerAction"
- enablesFor="1">
- </action>
- </objectContribution>
+ <extension point="org.eclipse.wst.server.ui.editorPages">
+ <page id="org.eclipse.wst.server.editor.plugins" order="10"
+ name="%serverEditorPluginPage"
+ typeIds="*"
+ insertionIds="org.eclipse.wst.server.editor.plugins"
+ class="org.apache.geronimo.st.v21.ui.pages.ServerPluginPage"/>
+ </extension>
+
+ <extension point="org.eclipse.wst.server.ui.editorPageSections">
+ <section id="org.apache.server.geronimo.plugins" order="10"
+ insertionId="org.eclipse.wst.server.editor.plugins"
+ typeIds="org.apache.geronimo.server.*"
+ class="org.apache.geronimo.st.v21.ui.sections.ServerPluginSection">
+ </section>
</extension>
</plugin>
Added: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/ServerPluginPage.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/ServerPluginPage.java?rev=733867&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/ServerPluginPage.java (added)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/ServerPluginPage.java Mon Jan 12 10:56:29 2009
@@ -0,0 +1,112 @@
+/*
+ * 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.internal.Messages;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.fieldassist.ControlDecoration;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.forms.ManagedForm;
+import org.eclipse.ui.forms.widgets.*;
+import org.eclipse.wst.server.ui.editor.*;
+import org.eclipse.wst.server.ui.internal.ImageResource;
+
+/**
+ * Server advanced editor page.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ServerPluginPage extends ServerEditorPart {
+ protected ManagedForm managedForm;
+
+ /**
+ * ServerAdvancedPage constructor comment.
+ */
+ public ServerPluginPage() {
+ super();
+ }
+
+ /**
+ * Creates the SWT controls for this workbench part.
+ *
+ * @param parent the parent control
+ */
+ public final void createPartControl(final Composite parent) {
+ managedForm = new ManagedForm(parent);
+ setManagedForm(managedForm);
+ ScrolledForm form = managedForm.getForm();
+ FormToolkit toolkit = managedForm.getToolkit();
+ toolkit.decorateFormHeading(form.getForm());
+ form.setText(Messages.plugin);
+ form.setImage(ImageResource.getImage(ImageResource.IMG_SERVER));
+ form.getBody().setLayout(new GridLayout());
+
+ insertSections(form.getBody(), "org.eclipse.wst.server.editor.plugins");
+
+ form.reflow(true);
+ }
+
+ public void dispose() {
+ super.dispose();
+
+ if (managedForm != null) {
+ managedForm.dispose();
+ managedForm = null;
+ }
+ }
+
+ /* (non-Javadoc)
+ * Initializes the editor part with a site and input.
+ */
+ public void init(IEditorSite site, IEditorInput input) {
+ super.init(site, input);
+ }
+
+ protected void updateDecoration(ControlDecoration decoration, IStatus status) {
+ if (status != null) {
+ Image newImage = null;
+ FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
+ switch (status.getSeverity()) {
+ case IStatus.INFO:
+ newImage = registry.getFieldDecoration(FieldDecorationRegistry.DEC_REQUIRED).getImage();
+ break;
+ case IStatus.WARNING:
+ newImage = registry.getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage();
+ break;
+ case IStatus.ERROR:
+ newImage = registry.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage();
+ }
+ decoration.setDescriptionText(status.getMessage());
+ decoration.setImage(newImage);
+ decoration.show();
+ } else {
+ decoration.setDescriptionText(null);
+ decoration.hide();
+ }
+ }
+
+ /*
+ * @see IWorkbenchPart#setFocus()
+ */
+ public void setFocus() {
+ }
+}
Propchange: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/ServerPluginPage.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/ServerPluginPage.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/ServerPluginPage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServerPluginSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServerPluginSection.java?rev=733867&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServerPluginSection.java (added)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServerPluginSection.java Mon Jan 12 10:56:29 2009
@@ -0,0 +1,128 @@
+/*
+ * 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 org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractServerEditorSection;
+import org.apache.geronimo.st.v21.core.operations.GeronimoServerPluginManager;
+import org.apache.geronimo.st.v21.ui.wizards.ServerCustomAssemblyWizard;
+import org.apache.geronimo.st.v21.ui.wizards.ServerPluginManagerDialog;
+import org.apache.geronimo.st.v21.ui.wizards.ServerPluginManagerWizard;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.wst.server.core.IServer;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ServerPluginSection extends AbstractServerEditorSection {
+
+ private Button customAssemblyButton;
+ private Button pluginManagerButton;
+
+ public ServerPluginSection() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.wst.server.ui.editor.ServerEditorSection#createSection(org.eclipse.swt.widgets.Composite)
+ */
+ public void createSection(Composite parent) {
+ super.createSection(parent);
+ FormToolkit toolkit = getFormToolkit(parent.getDisplay());
+
+ Section section = toolkit.createSection(parent,
+ ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED
+ | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION
+ | ExpandableComposite.FOCUS_TITLE);
+ section.setText(CommonMessages.plugin);
+ section.setDescription(CommonMessages.pluginActions);
+ section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+ Composite composite = toolkit.createComposite(section);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginHeight = 5;
+ layout.marginWidth = 10;
+ layout.verticalSpacing = 5;
+ layout.horizontalSpacing = 15;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ section.setClient(composite);
+
+ customAssemblyButton = toolkit.createButton(composite, CommonMessages.createCustomAssembly, SWT.PUSH);
+ customAssemblyButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
+ customAssemblyButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ // if the server is started, then we can bring up the dialog
+ if (isServerRunning()) {
+ GeronimoServerPluginManager pluginManager = new GeronimoServerPluginManager (gs.getServer());
+ ServerCustomAssemblyWizard wizard = new ServerCustomAssemblyWizard (pluginManager);
+ WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
+ dialog.open();
+ if (dialog.getReturnCode() == Dialog.OK) {
+ }
+ } else {
+ MessageDialog.openError(Display.getCurrent().getActiveShell(), CommonMessages.errorOpenWizard, CommonMessages.serverNotStarted);
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+ pluginManagerButton = toolkit.createButton(composite, CommonMessages.convertAppsToPlugins, SWT.PUSH);
+ pluginManagerButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
+ pluginManagerButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ // if the server is started, then we can bring up the dialog
+ if (isServerRunning()) {
+ GeronimoServerPluginManager pluginManager = new GeronimoServerPluginManager (gs.getServer());
+ ServerPluginManagerWizard wizard = new ServerPluginManagerWizard (pluginManager);
+ ServerPluginManagerDialog dialog = new ServerPluginManagerDialog(Display.getCurrent().getActiveShell(), wizard);
+ dialog.open();
+ if (dialog.getReturnCode() == Dialog.OK) {
+ }
+ } else {
+ MessageDialog.openError(Display.getCurrent().getActiveShell(), CommonMessages.errorOpenWizard, CommonMessages.serverNotStarted);
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+ }
+
+ private boolean isServerRunning () {
+ if (gs == null || gs.getServer() == null)
+ return false;
+
+ return gs.getServer().getServerState() == IServer.STATE_STARTED;
+ }
+}
Propchange: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServerPluginSection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServerPluginSection.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServerPluginSection.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.properties
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.properties?rev=733867&r1=733866&r2=733867&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.properties (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.properties Mon Jan 12 10:56:29 2009
@@ -21,4 +21,4 @@
PopupMenus.launchconsole=Launch Geronimo Console
PopupMenus.launchSupport=Launch Geronimo Support
-deploymentPlanEditorName=Geronimo Deployment Plan Editor
\ No newline at end of file
+deploymentPlanEditorName=Geronimo Deployment Plan Editor
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml?rev=733867&r1=733866&r2=733867&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml Mon Jan 12 10:56:29 2009
@@ -174,7 +174,6 @@
</section>
</extension>
-
<!--
|
| Define the Web editor class for the various Geronimo-specific XML files
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=733867&r1=733866&r2=733867&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 Mon Jan 12 10:56:29 2009
@@ -370,7 +370,9 @@
public static String editorCorrect;
public static String editorDefault;
+ public static String serverNotStarted;
public static String errorOpenDialog;
+ public static String errorOpenWizard;
public static String gBeanLink;
public static String moduleId;
@@ -414,6 +416,9 @@
public static String java;
public static String web;
public static String plugin;
+ public static String pluginActions;
+ public static String createCustomAssembly;
+ public static String convertAppsToPlugins;
public static String licenseAgreement;
public static String acceptLicenseAgreement;
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=733867&r1=733866&r2=733867&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 Mon Jan 12 10:56:29 2009
@@ -362,7 +362,9 @@
editorCorrect=There was an error opening the editor. The elements in the plan may not be qualified, do you want to try to auto-correct this? Otherwise the default text editor will be opened.
editorDefault=Could not load the deployment plan. Opening default text editor.
+serverNotStarted=Server has not been started. Please start the server and retry the action.
errorOpenDialog=Error opening editor.
+errorOpenWizard=Error opening wizard.
sourceLocWizTitle=Geronimo Source
sourceLocWizDescription=Choose the geronimo source zip file to locate source from during debug sessions.
@@ -417,6 +419,9 @@
java=Java
web=Web
plugin=Plugin
+pluginActions=Plugin actions that can be performed on the server
+createCustomAssembly=Create Custom Assembly
+convertAppsToPlugins=Convert Apps to Plugins
savePageTitle=Save Resource
savePageMessage=Data must be saved before entering or leaving the Source page.
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerPluginManager.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/operations/GeronimoServerPluginManager.java?rev=733867&r1=733866&r2=733867&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerPluginManager.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerPluginManager.java Mon Jan 12 10:56:29 2009
@@ -48,6 +48,7 @@
import org.apache.geronimo.kernel.repository.Dependency;
import org.apache.geronimo.kernel.repository.ImportType;
import org.apache.geronimo.st.core.CommonMessages;
+import org.apache.geronimo.st.core.GeronimoConnectionFactory;
import org.apache.geronimo.st.core.GeronimoServerBehaviourDelegate;
import org.apache.geronimo.st.core.jaxb.JAXBUtils;
import org.apache.geronimo.st.v21.core.internal.Trace;
@@ -61,6 +62,7 @@
import org.apache.geronimo.system.plugin.model.PluginType;
import org.apache.geronimo.system.plugin.model.PrerequisiteType;
import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
/**
* @version $Rev$ $Date$
@@ -68,28 +70,17 @@
public class GeronimoServerPluginManager {
private IServer server;
- private RemoteDeploymentManager remoteDM;
private PluginListType data;
private List<String> pluginList;
private Kernel kernel;
private PluginInstaller pluginInstaller;
- public GeronimoServerPluginManager () {
- kernel = null;
-
- Trace.tracePoint("Constructor", "GeronimoServerPluginManager");
- }
-
- public boolean serverChanged (Object aServer, String serverPrefix) {
- Trace.tracePoint("Entry", "GeronimoServerPluginManager.serverChanged", aServer, serverPrefix);
- server = (IServer)aServer;
-
- boolean enabled = server != null &&
- server.getServerType().getId().startsWith(serverPrefix) &&
- server.getServerState() == IServer.STATE_STARTED;
-
+ // The ServerWorkingCopy is passed in, not the IServer itself
+ public GeronimoServerPluginManager (IServer aServer) {
+ ServerWorkingCopy copy = (ServerWorkingCopy)aServer;
+ server = copy.getOriginal();
try {
- if (server !=null) {
+ if (server != null) {
GeronimoServerBehaviourDelegate delegate = (GeronimoServerBehaviourDelegate) server
.getAdapter(GeronimoServerBehaviourDelegate.class);
if (delegate != null) {
@@ -100,14 +91,12 @@
pluginInstaller = kernel.getGBean(PluginInstaller.class);
}
}
- } catch (Throwable e) {
+ } catch (Exception e) {
e.printStackTrace();
Trace.trace(Trace.WARNING, "Kernel connection failed. "
+ e.getMessage());
}
-
- Trace.tracePoint("Exit", "GeronimoServerPluginManager.serverChanged", enabled);
- return enabled;
+ Trace.tracePoint("Constructor", "GeronimoServerPluginManager");
}
public List<String> getPluginList () {
@@ -165,6 +154,8 @@
}
try {
+ GeronimoConnectionFactory gcFactory = GeronimoConnectionFactory.getInstance();
+ RemoteDeploymentManager remoteDM = (RemoteDeploymentManager)gcFactory.getDeploymentManager(server);
remoteDM.installPluginList("repository", relativeServerPath, selectedPlugins);
remoteDM.archive(relativeServerPath, "var/temp", new Artifact(group, artifact, (String)version, format));
}
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/META-INF/MANIFEST.MF?rev=733867&r1=733866&r2=733867&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/META-INF/MANIFEST.MF (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/META-INF/MANIFEST.MF Mon Jan 12 10:56:29 2009
@@ -8,11 +8,14 @@
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.commands,
+ org.eclipse.debug.ui,
org.apache.geronimo.st.v21.core,
org.apache.geronimo.st.ui,
org.eclipse.ui.forms,
org.eclipse.core.resources,
org.eclipse.wst.common.project.facet.ui,
+ org.eclipse.wst.server.core,
+ org.eclipse.wst.server.ui,
org.apache.geronimo.jee.v21.jaxbmodel,
org.apache.geronimo.runtime.common,
org.apache.geronimo.runtime.v22
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.properties
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.properties?rev=733867&r1=733866&r2=733867&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.properties (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.properties Mon Jan 12 10:56:29 2009
@@ -16,5 +16,4 @@
#
# $Rev$ $Date$
#
-PopupMenus.launchPluginManager=Launch Plugin Manager
-PopupMenus.launchServerAssembly=Launch Custom Server Assembly
+serverEditorPluginPage=Plugin
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.xml?rev=733867&r1=733866&r2=733867&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.xml Mon Jan 12 10:56:29 2009
@@ -34,37 +34,22 @@
<wizard-pages action="geronimo.plan.install.v21">
<page class="org.apache.geronimo.st.v21.ui.wizards.FacetInstallPage"/>
</wizard-pages>
- </extension>
-
- <extension point="org.eclipse.ui.popupMenus">
- <objectContribution adaptable="true" id="org.apache.geronimo.ui.serveractions"
- objectClass="org.eclipse.wst.server.core.IServer">
- <enablement>
- <test forcePluginActivation="true" property="org.eclipse.wst.server.ui.serverType"
- value="org.apache.geronimo.*" />
- </enablement>
- <action id="org.apache.geronimo.ui.launchServerAssembly"
- label="%PopupMenus.launchServerAssembly" icon="icons/obj16/littleG.gif"
- class="org.apache.geronimo.st.v21.ui.actions.LaunchGeronimoServerAssemblyAction"
- enablesFor="1">
- </action>
- </objectContribution>
</extension>
- <extension point="org.eclipse.ui.popupMenus">
- <objectContribution adaptable="true" id="org.apache.geronimo.ui.serveractions"
- objectClass="org.eclipse.wst.server.core.IServer">
- <enablement>
- <test forcePluginActivation="true"
- property="org.eclipse.wst.server.ui.serverType"
- value="org.apache.geronimo.*" />
- </enablement>
- <action id="org.apache.geronimo.ui.launchPluginManager"
- label="%PopupMenus.launchPluginManager" icon="icons/obj16/littleG.gif"
- class="org.apache.geronimo.st.v21.ui.actions.LaunchGeronimoPluginManagerAction"
- enablesFor="1">
- </action>
- </objectContribution>
+ <extension point="org.eclipse.wst.server.ui.editorPages">
+ <page id="org.eclipse.wst.server.editor.plugins" order="10"
+ name="%serverEditorPluginPage"
+ typeIds="*"
+ insertionIds="org.eclipse.wst.server.editor.plugins"
+ class="org.apache.geronimo.st.v21.ui.pages.ServerPluginPage"/>
+ </extension>
+
+ <extension point="org.eclipse.wst.server.ui.editorPageSections">
+ <section id="org.apache.server.geronimo.plugins" order="10"
+ insertionId="org.eclipse.wst.server.editor.plugins"
+ typeIds="org.apache.geronimo.server.*"
+ class="org.apache.geronimo.st.v21.ui.sections.ServerPluginSection">
+ </section>
</extension>
</plugin>
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/ServerPluginPage.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/ServerPluginPage.java?rev=733867&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/ServerPluginPage.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/ServerPluginPage.java Mon Jan 12 10:56:29 2009
@@ -0,0 +1,112 @@
+/*
+ * 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.internal.Messages;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.fieldassist.ControlDecoration;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.forms.ManagedForm;
+import org.eclipse.ui.forms.widgets.*;
+import org.eclipse.wst.server.ui.editor.*;
+import org.eclipse.wst.server.ui.internal.ImageResource;
+
+/**
+ * Server advanced editor page.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ServerPluginPage extends ServerEditorPart {
+ protected ManagedForm managedForm;
+
+ /**
+ * ServerAdvancedPage constructor comment.
+ */
+ public ServerPluginPage() {
+ super();
+ }
+
+ /**
+ * Creates the SWT controls for this workbench part.
+ *
+ * @param parent the parent control
+ */
+ public final void createPartControl(final Composite parent) {
+ managedForm = new ManagedForm(parent);
+ setManagedForm(managedForm);
+ ScrolledForm form = managedForm.getForm();
+ FormToolkit toolkit = managedForm.getToolkit();
+ toolkit.decorateFormHeading(form.getForm());
+ form.setText(Messages.plugin);
+ form.setImage(ImageResource.getImage(ImageResource.IMG_SERVER));
+ form.getBody().setLayout(new GridLayout());
+
+ insertSections(form.getBody(), "org.eclipse.wst.server.editor.plugins");
+
+ form.reflow(true);
+ }
+
+ public void dispose() {
+ super.dispose();
+
+ if (managedForm != null) {
+ managedForm.dispose();
+ managedForm = null;
+ }
+ }
+
+ /* (non-Javadoc)
+ * Initializes the editor part with a site and input.
+ */
+ public void init(IEditorSite site, IEditorInput input) {
+ super.init(site, input);
+ }
+
+ protected void updateDecoration(ControlDecoration decoration, IStatus status) {
+ if (status != null) {
+ Image newImage = null;
+ FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
+ switch (status.getSeverity()) {
+ case IStatus.INFO:
+ newImage = registry.getFieldDecoration(FieldDecorationRegistry.DEC_REQUIRED).getImage();
+ break;
+ case IStatus.WARNING:
+ newImage = registry.getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage();
+ break;
+ case IStatus.ERROR:
+ newImage = registry.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage();
+ }
+ decoration.setDescriptionText(status.getMessage());
+ decoration.setImage(newImage);
+ decoration.show();
+ } else {
+ decoration.setDescriptionText(null);
+ decoration.hide();
+ }
+ }
+
+ /*
+ * @see IWorkbenchPart#setFocus()
+ */
+ public void setFocus() {
+ }
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/ServerPluginPage.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/pages/ServerPluginPage.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/pages/ServerPluginPage.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/sections/ServerPluginSection.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/ServerPluginSection.java?rev=733867&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServerPluginSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServerPluginSection.java Mon Jan 12 10:56:29 2009
@@ -0,0 +1,128 @@
+/*
+ * 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 org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractServerEditorSection;
+import org.apache.geronimo.st.v21.core.operations.GeronimoServerPluginManager;
+import org.apache.geronimo.st.v21.ui.wizards.ServerCustomAssemblyWizard;
+import org.apache.geronimo.st.v21.ui.wizards.ServerPluginManagerDialog;
+import org.apache.geronimo.st.v21.ui.wizards.ServerPluginManagerWizard;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.wst.server.core.IServer;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ServerPluginSection extends AbstractServerEditorSection {
+
+ private Button customAssemblyButton;
+ private Button pluginManagerButton;
+
+ public ServerPluginSection() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.wst.server.ui.editor.ServerEditorSection#createSection(org.eclipse.swt.widgets.Composite)
+ */
+ public void createSection(Composite parent) {
+ super.createSection(parent);
+ FormToolkit toolkit = getFormToolkit(parent.getDisplay());
+
+ Section section = toolkit.createSection(parent,
+ ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED
+ | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION
+ | ExpandableComposite.FOCUS_TITLE);
+ section.setText(CommonMessages.plugin);
+ section.setDescription(CommonMessages.pluginActions);
+ section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+ Composite composite = toolkit.createComposite(section);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginHeight = 5;
+ layout.marginWidth = 10;
+ layout.verticalSpacing = 5;
+ layout.horizontalSpacing = 15;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ section.setClient(composite);
+
+ customAssemblyButton = toolkit.createButton(composite, CommonMessages.createCustomAssembly, SWT.PUSH);
+ customAssemblyButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
+ customAssemblyButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ // if the server is started, then we can bring up the dialog
+ if (isServerRunning()) {
+ GeronimoServerPluginManager pluginManager = new GeronimoServerPluginManager (gs.getServer());
+ ServerCustomAssemblyWizard wizard = new ServerCustomAssemblyWizard (pluginManager);
+ WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
+ dialog.open();
+ if (dialog.getReturnCode() == Dialog.OK) {
+ }
+ } else {
+ MessageDialog.openError(Display.getCurrent().getActiveShell(), CommonMessages.errorOpenWizard, CommonMessages.serverNotStarted);
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+ pluginManagerButton = toolkit.createButton(composite, CommonMessages.convertAppsToPlugins, SWT.PUSH);
+ pluginManagerButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
+ pluginManagerButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ // if the server is started, then we can bring up the dialog
+ if (isServerRunning()) {
+ GeronimoServerPluginManager pluginManager = new GeronimoServerPluginManager (gs.getServer());
+ ServerPluginManagerWizard wizard = new ServerPluginManagerWizard (pluginManager);
+ ServerPluginManagerDialog dialog = new ServerPluginManagerDialog(Display.getCurrent().getActiveShell(), wizard);
+ dialog.open();
+ if (dialog.getReturnCode() == Dialog.OK) {
+ }
+ } else {
+ MessageDialog.openError(Display.getCurrent().getActiveShell(), CommonMessages.errorOpenWizard, CommonMessages.serverNotStarted);
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+ }
+
+ private boolean isServerRunning () {
+ if (gs == null || gs.getServer() == null)
+ return false;
+
+ return gs.getServer().getServerState() == IServer.STATE_STARTED;
+ }
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServerPluginSection.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/ServerPluginSection.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/ServerPluginSection.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
|