Author: rob.stryker(a)jboss.com
Date: 2011-10-06 11:36:29 -0400 (Thu, 06 Oct 2011)
New Revision: 35422
Added:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBehaviourDelegate.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressLaunchDelegate.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/OpenshiftDeployUI.java
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
Log:
JBIDE-9856 - Mostly-stub implementation to get started and intergrate with andre's
expectations
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-10-06
14:34:10 UTC (rev 35421)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-10-06
15:36:29 UTC (rev 35422)
@@ -11,7 +11,12 @@
org.eclipse.core.databinding.beans;bundle-version="1.2.100",
org.eclipse.core.databinding.observable;bundle-version="1.4.0",
org.eclipse.core.databinding.property;bundle-version="1.4.0",
- org.eclipse.jface.databinding;bundle-version="1.5.0"
+ org.eclipse.jface.databinding;bundle-version="1.5.0",
+ org.jboss.ide.eclipse.as.core;bundle-version="2.3.0",
+ org.eclipse.wst.server.core;bundle-version="1.1.402",
+ org.eclipse.debug.core;bundle-version="3.7.0",
+ org.jboss.ide.eclipse.as.ui;bundle-version="2.3.0",
+ org.eclipse.wst.server.ui;bundle-version="1.1.405"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.jboss.tools.common.databinding,
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2011-10-06 14:34:10
UTC (rev 35421)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2011-10-06 15:36:29
UTC (rev 35422)
@@ -15,4 +15,22 @@
name="New Server Adapter">
</wizard>
</extension>
+ <extension
+ point="org.jboss.ide.eclipse.as.core.behaviourExtension">
+ <behaviour
+
behaviourDelegate="org.jboss.tools.openshift.express.internal.core.behaviour.ExpressBehaviourDelegate"
+
launchDelegate="org.jboss.tools.openshift.express.internal.core.behaviour.ExpressLaunchDelegate"
+ name="Openshift"
+
publishMethod="org.jboss.tools.openshift.express.internal.core.behaviour.ExpressPublishMethod"
+
serverTypes="org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.60"
+ typeId="openshift">
+ </behaviour>
+ </extension>
+ <extension
+ point="org.jboss.ide.eclipse.as.ui.DeployMethodUI">
+ <ui
+
class="org.jboss.tools.openshift.express.internal.ui.behaviour.OpenshiftDeployUI"
+ deployMethodId="openshift">
+ </ui>
+ </extension>
</plugin>
Added:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBehaviourDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBehaviourDelegate.java
(rev 0)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBehaviourDelegate.java 2011-10-06
15:36:29 UTC (rev 35422)
@@ -0,0 +1,75 @@
+package org.jboss.tools.openshift.express.internal.core.behaviour;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
+import org.jboss.ide.eclipse.as.core.server.internal.IJBossBehaviourDelegate;
+
+public class ExpressBehaviourDelegate implements IJBossBehaviourDelegate {
+
+ public ExpressBehaviourDelegate() {
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public String getBehaviourTypeId() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void setActualBehaviour(DelegatingServerBehavior actualBehaviour) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void stop(boolean force) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void publishStart(IProgressMonitor monitor) throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void publishFinish(IProgressMonitor monitor) throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void onServerStarting() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void onServerStopping() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public IStatus canChangeState(String launchMode) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getDefaultStopArguments() throws CoreException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void dispose() {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressLaunchDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressLaunchDelegate.java
(rev 0)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressLaunchDelegate.java 2011-10-06
15:36:29 UTC (rev 35422)
@@ -0,0 +1,55 @@
+package org.jboss.tools.openshift.express.internal.core.behaviour;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.wst.server.core.IServer;
+import
org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.IJBossLaunchDelegate;
+
+public class ExpressLaunchDelegate implements IJBossLaunchDelegate {
+
+ public ExpressLaunchDelegate() {
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public void actualLaunch(DelegatingStartLaunchConfiguration launchConfig,
+ ILaunchConfiguration configuration, String mode, ILaunch launch,
+ IProgressMonitor monitor) throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean preLaunchCheck(ILaunchConfiguration configuration,
+ String mode, IProgressMonitor monitor) throws CoreException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public void preLaunch(ILaunchConfiguration configuration, String mode,
+ ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void postLaunch(ILaunchConfiguration configuration, String mode,
+ ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void setupLaunchConfiguration(
+ ILaunchConfigurationWorkingCopy workingCopy, IServer server)
+ throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
(rev 0)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2011-10-06
15:36:29 UTC (rev 35422)
@@ -0,0 +1,53 @@
+package org.jboss.tools.openshift.express.internal.core.behaviour;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
+import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
+import
org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
+
+public class ExpressPublishMethod implements IJBossServerPublishMethod {
+
+ public ExpressPublishMethod() {
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public void publishStart(DeployableServerBehavior behaviour,
+ IProgressMonitor monitor) throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public int publishFinish(DeployableServerBehavior behaviour,
+ IProgressMonitor monitor) throws CoreException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int publishModule(DeployableServerBehavior behaviour, int kind,
+ int deltaKind, IModule[] module, IProgressMonitor monitor)
+ throws CoreException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public IPublishCopyCallbackHandler getCallbackHandler(IPath path,
+ IServer server) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getPublishDefaultRootFolder(IServer server) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Added:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
(rev 0)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2011-10-06
15:36:29 UTC (rev 35422)
@@ -0,0 +1,76 @@
+package org.jboss.tools.openshift.express.internal.core.behaviour;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerAttributes;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+
+/**
+ * This class holds the attribute names whose values will be
+ * stored inside a server object, as well as the utility methods
+ * used to get and set them for a server.
+ *
+ */
+public class ExpressServerUtils {
+ public static final String ATTRIBUTE_EXPRESS_MODE =
"org.jboss.tools.openshift.express.internal.core.behaviour.ExpressMode";
+ public static final String EXPRESS_BINARY_MODE =
"org.jboss.tools.openshift.express.internal.core.behaviour.ExpressBinaryMode";
+ public static final String EXPRESS_SOURCE_MODE =
"org.jboss.tools.openshift.express.internal.core.behaviour.ExpressSourceMode";
+ public static final String ATTRIBUTE_APPLICATION =
"org.jboss.tools.openshift.express.internal.core.behaviour.Application";
+ public static final String ATTRIBUTE_DOMAIN =
"org.jboss.tools.openshift.express.internal.core.behaviour.Domain";
+ public static final String ATTRIBUTE_USERNAME =
"org.jboss.tools.openshift.express.internal.core.behaviour.Username";
+ public static final String ATTRIBUTE_PASSWORD =
"org.jboss.tools.openshift.express.internal.core.behaviour.Password";
+
+ public static String getExpressMode(IServerAttributes attributes ) {
+ return attributes.getAttribute(ATTRIBUTE_EXPRESS_MODE, EXPRESS_SOURCE_MODE);
+ }
+
+ public static IServer setExpressMode(IServer server, String val) throws CoreException {
+ IServerWorkingCopy wc = server.createWorkingCopy();
+ wc.setAttribute(ATTRIBUTE_EXPRESS_MODE, val);
+ return wc.save(false, new NullProgressMonitor());
+ }
+
+ public static String getExpressApplication(IServerAttributes attributes ) {
+ return attributes.getAttribute(ATTRIBUTE_APPLICATION, (String)null);
+ }
+
+ public static IServer setExpressApplication(IServer server, String val) throws
CoreException {
+ IServerWorkingCopy wc = server.createWorkingCopy();
+ wc.setAttribute(ATTRIBUTE_APPLICATION, val);
+ return wc.save(false, new NullProgressMonitor());
+ }
+
+
+ public static String getExpressDomain(IServerAttributes attributes ) {
+ return attributes.getAttribute(ATTRIBUTE_DOMAIN, (String)null);
+ }
+
+ public static IServer setExpressDomain(IServer server, String val) throws CoreException
{
+ IServerWorkingCopy wc = server.createWorkingCopy();
+ wc.setAttribute(ATTRIBUTE_DOMAIN, val);
+ return wc.save(false, new NullProgressMonitor());
+ }
+
+ public static String getExpressUsername(IServerAttributes attributes ) {
+ return attributes.getAttribute(ATTRIBUTE_USERNAME, (String)null);
+ }
+
+ public static IServer setExpressUsername(IServer server, String val) throws
CoreException {
+ IServerWorkingCopy wc = server.createWorkingCopy();
+ wc.setAttribute(ATTRIBUTE_USERNAME, val);
+ return wc.save(false, new NullProgressMonitor());
+ }
+
+ // TODO Must secure this!!!
+ public static String getExpressPassword(IServerAttributes attributes ) {
+ return attributes.getAttribute(ATTRIBUTE_PASSWORD, (String)null);
+ }
+
+ public static IServer setExpressPassword(IServer server, String val) throws
CoreException {
+ IServerWorkingCopy wc = server.createWorkingCopy();
+ wc.setAttribute(ATTRIBUTE_PASSWORD, val);
+ return wc.save(false, new NullProgressMonitor());
+ }
+
+}
Added:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/OpenshiftDeployUI.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/OpenshiftDeployUI.java
(rev 0)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/OpenshiftDeployUI.java 2011-10-06
15:36:29 UTC (rev 35422)
@@ -0,0 +1,74 @@
+package org.jboss.tools.openshift.express.internal.ui.behaviour;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.ide.eclipse.as.ui.UIUtil;
+import org.jboss.ide.eclipse.as.ui.editor.IDeploymentTypeUI;
+import org.jboss.ide.eclipse.as.ui.editor.ServerModeSection;
+import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
+
+public class OpenshiftDeployUI implements IDeploymentTypeUI {
+
+ public OpenshiftDeployUI() {
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public void fillComposite(Composite parent, IServerModeUICallback callback) {
+ createWidgets(parent, callback);
+ addListeners(callback);
+ }
+
+ private void addListeners(IServerModeUICallback callback) {
+
+ }
+
+ private Text userText, passText;
+ private Combo modeCombo;
+
+ private void createWidgets(Composite parent, IServerModeUICallback callback) {
+ // TODO Auto-generated method stub
+ parent.setLayout(new FillLayout());
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new FormLayout());
+
+ Label nameLabel = new Label(composite, SWT.NONE);
+ nameLabel.setText("Openshift Username:");
+ userText = new Text(composite, SWT.BORDER);
+ Label passLabel = new Label(composite, SWT.NONE);
+ passLabel.setText("Openshift Password:");
+ passText = new Text(composite, SWT.BORDER);
+
+ Label domainLabel = new Label(composite, SWT.NONE);
+ domainLabel.setText("Domain: " +
ExpressServerUtils.getExpressDomain(callback.getServer()));
+ Label appLabel = new Label(composite, SWT.NONE);
+ appLabel.setText("App: " +
ExpressServerUtils.getExpressApplication(callback.getServer()));
+
+ Label modeLabel = new Label(composite, SWT.NONE);
+ modeLabel.setText("Mode:");
+
+ // Maybe just make this a label ??
+ modeCombo = new Combo(composite, SWT.READ_ONLY);
+ modeCombo.setItems(new String[]{
+ "Source", "Binary"
+ });
+ modeCombo.select(0);
+
+ nameLabel.setLayoutData(UIUtil.createFormData2(0, 5,null,0,0,5,null,0));
+ userText.setLayoutData(UIUtil.createFormData2(0,3,null,0,nameLabel,5,100,-5));
+
+ passLabel.setLayoutData(UIUtil.createFormData2(userText, 5,null,0,0,5,null,0));
+ passText.setLayoutData(UIUtil.createFormData2(userText,5,null,0,nameLabel,5,100,-5));
+
+ domainLabel.setLayoutData(UIUtil.createFormData2(passText,5,null,0,0,5,null,0));
+ appLabel.setLayoutData(UIUtil.createFormData2(domainLabel,5,null,0,0,5,null,0));
+ modeLabel.setLayoutData(UIUtil.createFormData2(appLabel,5,null,0,0,5,null,0));
+ modeCombo.setLayoutData(UIUtil.createFormData2(appLabel,3,null,0,modeLabel,5,100,-5));
+ }
+
+}