Author: rob.stryker(a)jboss.com
Date: 2010-08-11 04:53:06 -0400 (Wed, 11 Aug 2010)
New Revision: 24033
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.classpath
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.project
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.settings/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.settings/org.eclipse.jdt.core.prefs
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/META-INF/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/META-INF/MANIFEST.MF
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/build.properties
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.properties
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSESingleFilePublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.classpath
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.project
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.settings/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.settings/org.eclipse.jdt.core.prefs
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF/MANIFEST.MF
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPageCallback.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$1.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$2.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$3.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$4.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$CustomSystemHostCombo$1.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$CustomSystemHostCombo.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEUIPlugin.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/build.properties
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/plugin.xml
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPageCallback.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEUIPlugin.java
Log:
Separating RSE into own plugins
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.classpath
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.classpath
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.classpath 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.project
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.project
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.project 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.ide.eclipse.as.rse.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.settings/org.eclipse.jdt.core.prefs 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,8 @@
+#Wed Aug 11 12:29:43 GMT+08:00 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/META-INF/MANIFEST.MF
===================================================================
---
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/META-INF/MANIFEST.MF
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/META-INF/MANIFEST.MF 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Core
+Bundle-SymbolicName: org.jboss.ide.eclipse.as.rse.core;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.ide.eclipse.as.rse.core.RSECorePlugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.rse.core,
+ org.eclipse.rse.subsystems.files.core,
+ org.eclipse.rse.services,
+ org.eclipse.rse.services.files.ftp,
+ org.eclipse.rse.services.local,
+ org.eclipse.rse.services.ssh,
+ org.jboss.ide.eclipse.as.core,
+ org.jboss.ide.eclipse.as.wtp.core,
+ org.eclipse.wst.server.core,
+ org.eclipse.wst.common.project.facet.core,
+ org.eclipse.core.resources,
+ org.eclipse.wst.common.modulecore,
+ org.eclipse.wst.common.emfworkbench.integration,
+ org.eclipse.jem.util,
+ org.jboss.ide.eclipse.archives.webtools;resolution:=optional
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.jboss.ide.eclipse.as.rse.core
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/build.properties
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/build.properties
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/build.properties 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties
+src.includes = plugin.properties,\
+ META-INF/
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.properties
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.properties
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.properties 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,4 @@
+AllJBossRuntimeTypes=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50
+AllJBossServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50
+AllJBTServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.systemCopyServer
+ServerTypesJBoss6OrHigher=org.jboss.ide.eclipse.as.60
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <!-- Below here is RSE stuff which can / should be moved if a new plugin is created
-->
+ <extension
+ point="org.jboss.ide.eclipse.as.core.publishMethod">
+ <publishMethod
+ class="org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod"
+ id="rse"
+ name="Remote System Deployment"
+
serverTypes="org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.systemCopyServer">
+ </publishMethod>
+ </extension>
+ <extension
+ point="org.jboss.ide.eclipse.as.core.publishers">
+ <publisher
+ class="org.jboss.ide.eclipse.as.rse.core.RSESingleFilePublisher"
+ priority="7">
+ </publisher>
+ <publisher
+ class="org.jboss.ide.eclipse.as.rse.core.RSEJSTPublisher"
+ priority="5">
+ </publisher>
+ <publisher
+
class="org.jboss.ide.eclipse.as.rse.core.archives.RSEZippedJSTPublisher"
+ priority="3"
+ zipDelegate="true">
+ </publisher>
+ </extension>
+
+</plugin>
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java
===================================================================
---
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,30 @@
+package org.jboss.ide.eclipse.as.rse.core;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class RSECorePlugin implements BundleActivator {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ RSECorePlugin.context = bundleContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ RSECorePlugin.context = null;
+ }
+
+}
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java
===================================================================
---
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * TODO: Logging and Progress Monitors
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.rse.core;
+
+import org.jboss.ide.eclipse.as.core.publishers.AbstractJSTPublisher;
+
+
+public class RSEJSTPublisher extends AbstractJSTPublisher {
+
+ @Override
+ protected String getTargetedPublishMethodId() {
+ return RSEPublishMethod.RSE_ID;
+ }
+}
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java
===================================================================
---
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.rse.core;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.rse.core.RSECorePlugin;
+import org.eclipse.rse.core.model.IHost;
+import org.eclipse.rse.core.subsystems.ISubSystem;
+import org.eclipse.rse.services.files.IFileService;
+import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.publishers.AbstractPublishMethod;
+import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
+import
org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+
+public class RSEPublishMethod extends AbstractPublishMethod {
+
+ public static final String RSE_ID = "rse"; //$NON-NLS-1$
+
+ private DeployableServerBehavior behaviour;
+
+ @Override
+ public String getPublishMethodId() {
+ return RSE_ID;
+ }
+
+ private IFileServiceSubSystem fileSubSystem = null;
+ private IPath remoteRootFolder;
+ private IPath remoteTemporaryFolder;
+ public void publishStart(DeployableServerBehavior behaviour,
+ IProgressMonitor monitor) throws CoreException {
+ this.behaviour = behaviour;
+ loadRemoteDeploymentDetails();
+ if (fileSubSystem != null && !fileSubSystem.isConnected()) {
+ try {
+ fileSubSystem.connect(monitor, false);
+ } catch (Exception e) {
+ }
+ }
+ super.publishStart(behaviour, monitor);
+ }
+ public IPath getRemoteRootFolder() {
+ return remoteRootFolder;
+ }
+ public IPath getRemoteTemporaryFolder() {
+ return remoteTemporaryFolder;
+ }
+ public IFileServiceSubSystem getFileServiceSubSystem() {
+ return fileSubSystem;
+ }
+ public IFileService getFileService() {
+ return fileSubSystem.getFileService();
+ }
+
+ public int publishFinish(DeployableServerBehavior behaviour,
+ IProgressMonitor monitor) throws CoreException {
+ return super.publishFinish(behaviour, monitor);
+ }
+
+ protected void loadRemoteDeploymentDetails() throws CoreException{
+ // TODO obviously fix this
+// String homeDir = RSEUtils.getRSEHomeDir(behaviour.getServer());
+// String conf = RSEUtils.getRSEConfigName(behaviour.getServer());
+ String connectionName = RSEUtils.getRSEConnectionName(behaviour.getServer());
+// this.remoteRootFolder = new Path("/home/rob/redhat/deploy"); //$NON-NLS-1$
+// this.remoteTemporaryFolder = new Path("/home/rob/redhat/tmp");
//$NON-NLS-1$
+ JBossServer jbs = ServerConverter.getJBossServer(behaviour.getServer());
+ this.remoteRootFolder = new Path(RSEUtils.getDeployRootFolder(jbs));
+ this.remoteTemporaryFolder = new Path("/home/rob/redhat/tmp"); //$NON-NLS-1$
+
+ IHost host = findHost(connectionName);
+ if( host != null ) {
+ fileSubSystem = findFileTransferSubSystem(host);
+ } else {
+ // TODO error host not found in RSE
+ }
+ }
+
+ protected IHost findHost(String connectionName) {
+ IHost[] allHosts = RSECorePlugin.getTheSystemRegistry().getHosts();
+ for( int i = 0; i < allHosts.length; i++ ) {
+ if( allHosts[i].getAliasName().equals(connectionName))
+ return allHosts[i];
+ }
+ return null;
+ }
+
+ /* approved files subsystems *
+ ftp.files
+ local.files
+ ssh.files
+ */
+ protected static List<String> APPROVED_FILE_SYSTEMS =
+ Arrays.asList(new String[]{ "ftp.files", "local.files",
"ssh.files"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ protected IFileServiceSubSystem findFileTransferSubSystem(IHost host) {
+ ISubSystem[] systems = RSECorePlugin.getTheSystemRegistry().getSubSystems(host);
+ for( int i = 0; i < systems.length; i++ ) {
+ if( APPROVED_FILE_SYSTEMS.contains(systems[i].getConfigurationId()))
+ return (IFileServiceSubSystem)systems[i];
+ }
+ return null;
+ }
+
+ public static IPath findModuleFolderWithDefault(IModule module, IDeployableServer
server, IPath startingPath) {
+ IModule[] moduleTree = new IModule[]{module};
+ String folder = PublishUtil.getDeployRootFolder(
+ moduleTree, server, startingPath.toString(),
+ IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
+ return PublishUtil.getDeployPath(moduleTree, folder).removeLastSegments(1);
+ }
+
+
+ public IPublishCopyCallbackHandler getCallbackHandler(IPath path, IServer server) {
+ return new RSERemotePublishHandler(path, this);
+ }
+
+ public String getPublishDefaultRootFolder(IServer server) {
+ return getRemoteRootFolder().toString();
+ }
+
+}
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java
===================================================================
---
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * TODO: Logging and Progress Monitors
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.rse.core;
+
+import java.io.File;
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
+import org.eclipse.wst.common.project.facet.core.util.internal.ProgressMonitorUtil;
+import org.eclipse.wst.server.core.model.IModuleFile;
+import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
+import
org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
+
+public class RSERemotePublishHandler implements IPublishCopyCallbackHandler {
+ protected IPath root;
+ protected RSEPublishMethod method;
+ private ArrayList<IPath> createdFolders = new ArrayList<IPath>();
+ public RSERemotePublishHandler(IPath path, RSEPublishMethod method) {
+ this.root = path;
+ this.method = method;
+ }
+ public IStatus[] copyFile(IModuleFile mf, IPath path,
+ IProgressMonitor monitor) throws CoreException {
+ File file = PublishUtil.getFile(mf);
+ IPath remotePath = root.append(path);
+ try {
+ method.getFileService().upload(file, remotePath.removeLastSegments(1).toString(),
+ remotePath.lastSegment(), true, null, null, monitor);
+ } catch( SystemMessageException sme ) {
+ System.err.println("failed to copy to " + remotePath.toString());
//$NON-NLS-1$
+ }
+ return null;
+ }
+
+ public IStatus[] deleteResource(IPath path, IProgressMonitor monitor)
+ throws CoreException {
+ IPath remotePath = root.append(path);
+ try {
+ method.getFileService().delete(remotePath.removeLastSegments(1).toString(),
remotePath.lastSegment(), monitor);
+ } catch( SystemMessageException sme ) {
+ System.err.println("failed to delete " + remotePath.toString());
//$NON-NLS-1$
+ }
+ return null;
+ }
+
+ public IStatus[] makeDirectoryIfRequired(IPath dir,
+ IProgressMonitor monitor) throws CoreException {
+ monitor.beginTask("Make directory " + dir.toString(), 100); //$NON-NLS-1$
+ if( dir.segmentCount() > 0 )
+ makeDirectoryIfRequired(dir.removeLastSegments(1), ProgressMonitorUtil.submon(monitor,
70));
+ IPath toMake = root.append(dir);
+ if( createdFolders.contains(toMake))
+ return new IStatus[]{Status.OK_STATUS};
+ try {
+ method.getFileService().createFolder(toMake.removeLastSegments(1).toString(),
+ toMake.lastSegment(), ProgressMonitorUtil.submon(monitor, 30));
+ } catch( SystemMessageException sme ) {
+ System.err.println("failed to make folder " + toMake.toString());
//$NON-NLS-1$
+ }
+ createdFolders.add(toMake);
+ monitor.done();
+ return null;
+ }
+}
+
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSESingleFilePublisher.java
===================================================================
---
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSESingleFilePublisher.java
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSESingleFilePublisher.java 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.rse.core;
+
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
+import org.jboss.ide.eclipse.as.core.publishers.AbstractServerToolsPublisher;
+
+public class RSESingleFilePublisher extends AbstractServerToolsPublisher {
+
+ public boolean accepts(String method, IServer server, IModule[] module) {
+ if( RSEPublishMethod.RSE_ID.equals(method)
+ && module != null && module.length > 0
+ && module[module.length-1] != null
+ &&
module[module.length-1].getModuleType().getId().equals(SingleDeployableFactory.MODULE_TYPE))
+ return true;
+ return false;
+ }
+}
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java
===================================================================
---
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.rse.core;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerAttributes;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
+import org.jboss.ide.eclipse.as.core.util.IConstants;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+
+
+/*
+ * Some of this code will need to be abstracted out from JBossServer
+ * and turned into a proper API, but in as simple a way as possible
+ */
+public class RSEUtils {
+ public static final String RSE_SERVER_CONFIG =
"org.jboss.ide.eclipse.as.rse.core.RSEServerConfig"; //$NON-NLS-1$
+ public static final String RSE_SERVER_HOME_DIR =
"org.jboss.ide.eclipse.as.rse.core.RSEServerHomeDir"; //$NON-NLS-1$
+ public static final String RSE_SERVER_HOST =
"org.jboss.ide.eclipse.as.rse.core.ServerHost"; //$NON-NLS-1$
+ public static final String RSE_SERVER_DEFAULT_HOST = "Local"; //$NON-NLS-1$
+
+ public static String getRSEConnectionName(IServer server) {
+ return server.getAttribute(RSEUtils.RSE_SERVER_HOST, RSE_SERVER_DEFAULT_HOST);
+ }
+
+ public static String getRSEHomeDir(IServerAttributes server) {
+ return server.getAttribute(RSEUtils.RSE_SERVER_HOME_DIR,
server.getRuntime().getLocation().toString());
+ }
+
+ public static String getRSEConfigName(IServerAttributes server) {
+ IJBossServerRuntime runtime = ServerConverter.getJBossRuntime(server);
+ return server.getAttribute(RSEUtils.RSE_SERVER_CONFIG,
runtime.getJBossConfiguration());
+ }
+
+ public static String getDeployRootFolder(JBossServer server) {
+ return getDeployRootFolder(server.getServer(), server.getDeployLocationType());
+ }
+
+ /* Copied from JBossServer.getDeployFolder(etc) */
+ public static String getDeployRootFolder(IServer server, String type) {
+ if( type.equals(JBossServer.DEPLOY_CUSTOM)) {
+ String val = server.getAttribute(JBossServer.DEPLOY_DIRECTORY, (String)null);
+ if( val != null ) {
+ IPath val2 = new Path(val);
+ return makeGlobal(server, val2).toString();
+ }
+ // if no value is set, default to metadata
+ type = JBossServer.DEPLOY_SERVER;
+ }
+ // TODO error here, or sensible default?
+ if( type.equals(JBossServer.DEPLOY_METADATA)) {
+ return JBossServerCorePlugin.getServerStateLocation(server).
+ append(IJBossServerConstants.DEPLOY).makeAbsolute().toString();
+ } else if( type.equals(JBossServer.DEPLOY_SERVER)) {
+ String loc = IConstants.SERVER;
+ String config = getRSEConfigName(server);
+ IPath p = new Path(loc).append(config)
+ .append(IJBossServerConstants.DEPLOY);
+ return makeGlobal(server, p).toString();
+ }
+ return null;
+ }
+
+ public static IPath makeRelative(IServer server, IPath p) {
+ if( p.isAbsolute()) {
+ if(new Path(getRSEHomeDir(server)).isPrefixOf(p)) {
+ int size = new Path(getRSEHomeDir(server)).toOSString().length();
+ return new Path(p.toOSString().substring(size)).makeRelative();
+ }
+ }
+ return p;
+ }
+
+ public static IPath makeGlobal(IServer server, IPath p) {
+ if( !p.isAbsolute()) {
+ return new Path(getRSEHomeDir(server)).append(p).makeAbsolute();
+ }
+ return p;
+ }
+
+
+}
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java
===================================================================
---
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * TODO: Logging and Progress Monitors
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.rse.core.archives;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.model.IModuleResourceDelta;
+import org.jboss.ide.eclipse.archives.webtools.modules.WTPZippedPublisher;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod;
+
+/**
+ * This class is in charge of RSE zipped publishing for flexible projects.
+ * It extends the functionality of the local zipped publishing class
+ * by uploading the file after building it in a temporary directory
+ */
+public class RSEZippedJSTPublisher extends WTPZippedPublisher {
+
+ protected String getPublishMethod() {
+ return RSEPublishMethod.RSE_ID;
+ }
+
+ /**
+ * Here we put the deployment first in a temporary remote deploy folder
+ * Then during the publishModule call, we'll also upload it to remote machine
+ */
+ protected String getDeployRoot(IModule[] module, IDeployableServer ds) {
+ IPath deployRoot = JBossServerCorePlugin.getServerStateLocation(ds.getServer()).
+ append(IJBossServerConstants.TEMP_REMOTE_DEPLOY).makeAbsolute();
+ deployRoot.toFile().mkdirs();
+ return deployRoot.toString();
+ }
+
+ @Override
+ public IStatus publishModule(
+ IJBossServerPublishMethod method,
+ IServer server, IModule[] module,
+ int publishType, IModuleResourceDelta[] delta,
+ IProgressMonitor monitor) throws CoreException {
+
+ // Locally zip it up into the remote tmp folder
+ IStatus sup = super.publishModule(method, server, module, publishType, delta,
monitor);
+
+ // set up needed vars
+ IDeployableServer server2 = ServerConverter.getDeployableServer(server);
+ String remoteTempDeployRoot = getDeployRoot(module,
ServerConverter.getDeployableServer(server));
+ RSEPublishMethod method2 = (RSEPublishMethod)method;
+ IPath sourcePath = PublishUtil.getDeployPath(module, remoteTempDeployRoot);
+ IModule lastMod = module[module.length-1];
+ IPath destFolder = RSEPublishMethod.findModuleFolderWithDefault(lastMod, server2,
method2.getRemoteRootFolder());
+ IPath tempDestFolder = RSEPublishMethod.findModuleFolderWithDefault(lastMod, server2,
method2.getRemoteTemporaryFolder());
+ String name = sourcePath.lastSegment();
+
+ // Now transfer the file to RSE
+ try {
+ method2.getFileService().upload(sourcePath.toFile(), tempDestFolder.toString(), name,
true, null, null, new NullProgressMonitor());
+ method2.getFileService().move(tempDestFolder.toString(), name, destFolder.toString(),
name, new NullProgressMonitor());
+ } catch( SystemMessageException sme ) {
+ // TODO fix or return error
+ sme.printStackTrace();
+ }
+
+ return sup;
+ }
+}
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.classpath
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.classpath
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.classpath 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.project
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.project
(rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.project 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.ide.eclipse.as.rse.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.settings/org.eclipse.jdt.core.prefs 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,8 @@
+#Wed Aug 11 12:55:39 GMT+08:00 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF/MANIFEST.MF
===================================================================
---
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF/MANIFEST.MF
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF/MANIFEST.MF 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,29 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Ui
+Bundle-SymbolicName: org.jboss.ide.eclipse.as.rse.ui;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.ide.eclipse.as.rse.ui.RSEUIPlugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.ui,
+ org.eclipse.rse.core,
+ org.eclipse.rse.subsystems.files.core,
+ org.eclipse.rse.services,
+ org.eclipse.rse.services.files.ftp,
+ org.eclipse.rse.services.local,
+ org.eclipse.rse.services.ssh,
+ org.jboss.ide.eclipse.as.core,
+ org.jboss.ide.eclipse.as.wtp.core,
+ org.eclipse.wst.server.core,
+ org.eclipse.wst.common.project.facet.core,
+ org.eclipse.core.resources,
+ org.eclipse.wst.common.modulecore,
+ org.eclipse.wst.common.emfworkbench.integration,
+ org.eclipse.jem.util,
+ org.jboss.ide.eclipse.as.rse.core,
+ org.jboss.ide.eclipse.as.ui,
+ org.eclipse.rse.files.ui,
+ org.eclipse.rse.ui,
+ org.eclipse.wst.server.ui
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPageCallback.class
===================================================================
(Binary files differ)
Property changes on:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPageCallback.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$1.class
===================================================================
(Binary files differ)
Property changes on:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$1.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$2.class
===================================================================
(Binary files differ)
Property changes on:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$2.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$3.class
===================================================================
(Binary files differ)
Property changes on:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$3.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$4.class
===================================================================
(Binary files differ)
Property changes on:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$4.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$CustomSystemHostCombo$1.class
===================================================================
(Binary files differ)
Property changes on:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$CustomSystemHostCombo$1.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$CustomSystemHostCombo.class
===================================================================
(Binary files differ)
Property changes on:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$CustomSystemHostCombo.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite.class
===================================================================
(Binary files differ)
Property changes on:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.class
===================================================================
(Binary files differ)
Property changes on:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEUIPlugin.class
===================================================================
(Binary files differ)
Property changes on:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEUIPlugin.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/build.properties
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/build.properties
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/build.properties 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/plugin.xml
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/plugin.xml
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/plugin.xml 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.jboss.ide.eclipse.as.ui.DeployMethodUI">
+ <ui
+ class="org.jboss.tools.as.rse.ui.RSEDeploymentPreferenceUI"
+ deployMethodId="rse">
+ </ui>
+ </extension>
+</plugin>
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPageCallback.java
===================================================================
---
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPageCallback.java
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPageCallback.java 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,33 @@
+package org.jboss.ide.eclipse.as.rse.ui;
+
+import java.beans.PropertyChangeEvent;
+
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.jboss.ide.eclipse.as.core.util.IConstants;
+import org.jboss.ide.eclipse.as.rse.core.RSEUtils;
+import org.jboss.ide.eclipse.as.ui.editor.DeploymentModuleOptionCompositeAssistant;
+import
org.jboss.ide.eclipse.as.ui.editor.DeploymentModuleOptionCompositeAssistant.IDeploymentPageCallback;
+
+public class RSEDeploymentPageCallback implements IDeploymentPageCallback {
+ public boolean metadataEnabled() {
+ return false;
+ }
+ public String getServerLocation(IServerWorkingCopy wc) {
+ return IConstants.SERVER;
+ }
+
+ public String getServerConfigName(IServerWorkingCopy wc) {
+ return RSEUtils.getRSEConfigName(wc);
+ }
+ public void propertyChange(PropertyChangeEvent evt,
+ DeploymentModuleOptionCompositeAssistant composite) {
+
+ if( composite.getServerRadio().getSelection() && (
+ evt.getPropertyName().equals( RSEUtils.RSE_SERVER_CONFIG) ||
+ evt.getPropertyName().equals( RSEUtils.RSE_SERVER_HOME_DIR))) {
+ composite.radioSelected(composite.getServerRadio());
+ }
+
+ }
+
+}
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java
===================================================================
---
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,310 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.rse.ui;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.rse.core.RSECorePlugin;
+import org.eclipse.rse.core.events.ISystemModelChangeEvent;
+import org.eclipse.rse.core.events.ISystemModelChangeListener;
+import org.eclipse.rse.core.model.IHost;
+import org.eclipse.rse.files.ui.dialogs.SystemRemoteFileDialog;
+import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.rse.core.RSEUtils;
+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.ide.eclipse.as.ui.editor.ServerModeSection.ChangeServerPropertyCommand;
+
+public class RSEDeploymentPreferenceUI implements IDeploymentTypeUI {
+ public RSEDeploymentPreferenceUI() {
+ // Do nothing
+ }
+
+ @Override
+ public void fillComposite(Composite parent, ServerModeSection modeSection) {
+ parent.setLayout(new FillLayout());
+ new RSEDeploymentPreferenceComposite(parent, SWT.NONE, modeSection);
+ }
+
+ public static class RSEDeploymentPreferenceComposite extends Composite implements
PropertyChangeListener {
+ private ServerModeSection modeSection;
+ private CustomSystemHostCombo combo;
+ private Text rseServerHome,rseServerConfig;
+ private Button rseBrowse;
+ private ModifyListener comboMListener;
+ public RSEDeploymentPreferenceComposite(Composite parent, int style, ServerModeSection
modeSection) {
+ super(parent, style);
+ this.modeSection = modeSection;
+ setLayout(new FormLayout());
+ Composite child = new Composite(this, SWT.None);
+ child.setLayoutData(UIUtil.createFormData2(0, 0, null, 0, 0, 5, 100, 0));
+ child.setLayout(new GridLayout());
+ String current = modeSection.getServer().getAttribute(RSEUtils.RSE_SERVER_HOST,
RSEUtils.RSE_SERVER_DEFAULT_HOST);
+ combo = new CustomSystemHostCombo(child, SWT.NULL, current, "files");
//$NON-NLS-1$
+ /* ISubSystemConfigurationCategories.SUBSYSTEM_CATEGORY_FILES*/
+ // "files");
+ comboMListener = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ rseHostChanged();
+ }
+ };
+ combo.getCombo().addModifyListener(comboMListener);
+ Label serverHomeLabel = new Label(this, SWT.NONE);
+ serverHomeLabel.setText("Remote Server Home: ");
+ rseBrowse = new Button(this, SWT.DEFAULT);
+ rseBrowse.setText("Browse...");
+ rseBrowse.setLayoutData(UIUtil.createFormData2(child, 5, null, 0, null, 0, 100, -5));
+ rseBrowse.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e) {
+ browseClicked();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ browseClicked();
+ }
+ });
+ rseServerHome = new Text(this, SWT.SINGLE | SWT.BORDER);
+ serverHomeLabel.setLayoutData(UIUtil.createFormData2(child, 7, null, 0, 0, 10, null,
0));
+ rseServerHome.setLayoutData(UIUtil.createFormData2(child, 5, null, 0, serverHomeLabel,
5, rseBrowse, -5));
+ rseServerHome.setText(modeSection.getServer().getAttribute(RSEUtils.RSE_SERVER_HOME_DIR,
+ getRuntime().getRuntime().getLocation().toString()));
+ rseServerHome.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e) {
+ serverHomeChanged();
+ }});
+
+ Label serverConfigLabel = new Label(this, SWT.NONE);
+ serverConfigLabel.setText("Remote Server Configuration: ");
+ rseServerConfig= new Text(this, SWT.SINGLE | SWT.BORDER);
+ serverConfigLabel.setLayoutData(UIUtil.createFormData2(rseServerHome, 7, null, 0, 0,
10, null, 0));
+ rseServerConfig.setLayoutData(UIUtil.createFormData2(rseServerHome, 5, null, 0,
serverConfigLabel, 5, 100, -5));
+ rseServerConfig.setText(modeSection.getServer().getAttribute(RSEUtils.RSE_SERVER_CONFIG,
+ getRuntime().getJBossConfiguration()));
+ rseServerConfig.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e) {
+ serverConfigChanged();
+ }});
+ modeSection.getServer().addPropertyChangeListener(this);
+ }
+
+ @Override
+ public void dispose () {
+ super.dispose();
+ modeSection.getServer().removePropertyChangeListener(this);
+ }
+
+ private boolean updatingFromModelChange = false;
+ public void propertyChange(PropertyChangeEvent evt) {
+ updatingFromModelChange = true;
+ if( evt.getPropertyName().equals(RSEUtils.RSE_SERVER_HOME_DIR)) {
+ rseServerHome.setText(evt.getNewValue().toString());
+ } else if( evt.getPropertyName().equals(RSEUtils.RSE_SERVER_CONFIG)) {
+ rseServerConfig.setText(evt.getNewValue().toString());
+ } else if( evt.getPropertyName().equals(RSEUtils.RSE_SERVER_HOST)) {
+ combo.setHostName(evt.getNewValue().toString());
+ }
+ updatingFromModelChange = false;
+ }
+
+ protected void browseClicked() {
+ SystemRemoteFileDialog d = new SystemRemoteFileDialog(
+ rseBrowse.getShell(), "Browse remote system", combo.getHost());
+ if( d.open() == Dialog.OK) {
+ Object o = d.getOutputObject();
+ if( o instanceof IRemoteFile ) {
+ String path = ((IRemoteFile)o).getAbsolutePath();
+ rseServerHome.setText(path);
+ serverHomeChanged();
+ }
+ }
+ }
+
+ protected IJBossServerRuntime getRuntime() {
+ return ServerConverter.getJBossRuntime(modeSection.getServer().getOriginal());
+ }
+
+ protected void rseHostChanged() {
+ if( !updatingFromModelChange ) {
+ String hostName = combo.getHost() == null ? null : combo.getHost().getAliasName();
+ String oldVal = modeSection.getServer().getAttribute(RSEUtils.RSE_SERVER_HOST,
(String)null);
+ if( !hostName.equals(oldVal) && !updatingFromModelChange) {
+ modeSection.getCommandManager().execute(new ChangeServerPropertyCommand(
+ modeSection.getServer(), RSEUtils.RSE_SERVER_HOST, hostName,
+ "Change RSE Host"));
+ modeSection.getCommandManager().execute(new ChangeServerPropertyCommand(
+ modeSection.getServer(), "hostname", combo.getHost().getHostName(),
+ "Change Hostname"));
+ }
+ }
+ }
+
+ protected void serverHomeChanged() {
+ if( !updatingFromModelChange) {
+ modeSection.getCommandManager().execute(new ChangeServerPropertyCommand(
+ modeSection.getServer(), RSEUtils.RSE_SERVER_HOME_DIR, rseServerHome.getText(),
+ "Change RSE Server's Home Directory"));
+ }
+ }
+
+ protected void serverConfigChanged() {
+ if( !updatingFromModelChange ) {
+ modeSection.getCommandManager().execute(new ChangeServerPropertyCommand(
+ modeSection.getServer(), RSEUtils.RSE_SERVER_CONFIG, rseServerConfig.getText(),
+ "Change RSE Server's Configuration"));
+ }
+ }
+
+ public class CustomSystemHostCombo extends Composite implements ModifyListener,
ISystemModelChangeListener {
+ private String fileSubSystem;
+ private Combo combo;
+ private IHost currentHost;
+ private String currentHostName;
+ private IHost[] hosts;
+ private String[] hostsAsStrings;
+ public CustomSystemHostCombo(Composite parent, int style, String initialHostName,
String fileSubSystem) {
+ super(parent, style);
+ this.fileSubSystem = fileSubSystem;
+ this.currentHostName = initialHostName;
+ this.hosts =
RSECorePlugin.getTheSystemRegistry().getHostsBySubSystemConfigurationCategory(fileSubSystem);
+ this.currentHost = findHost(initialHostName);
+ RSECorePlugin.getTheSystemRegistry().addSystemModelChangeListener(this);
+
+ // Where I belong in the parent
+ GridData data = new GridData();
+ // horizontal clues
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ data.widthHint = 200;
+ // vertical clues
+ data.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING; //GridData.CENTER;
+ data.grabExcessVerticalSpace = false; // true;
+ this.setLayoutData(data);
+
+ // What's inside me
+ setLayout(new FormLayout());
+ Label l = new Label(this, SWT.NONE);
+ l.setText("Host");
+ combo = new Combo(this, SWT.DEFAULT | SWT.READ_ONLY);
+ l.setLayoutData(UIUtil.createFormData2(0, 5, null, 0, 0, 0, null, 0));
+ combo.setLayoutData(UIUtil.createFormData2(0, 0, null, 0, l, 5, 100, -5));
+ refreshConnections();
+ combo.addModifyListener(this);
+ }
+
+ public IHost findHost(String name) {
+ for( int i = 0; i < hosts.length; i++ ) {
+ if( hosts[i].getAliasName().equals(name))
+ return hosts[i];
+ }
+ return null;
+ }
+
+ public Combo getCombo() {
+ return combo;
+ }
+
+ public IHost getHost() {
+ return currentHost;
+ }
+
+ public String getHostName() {
+ return currentHostName;
+ }
+
+ public void setHostName(String name) {
+ this.currentHostName = name;
+ this.currentHost = findHost(currentHostName);
+ if( currentHost == null )
+ combo.clearSelection();
+ else {
+ String[] items = combo.getItems();
+ for( int i = 0; i < items.length; i++ ) {
+ if( items[i].equals(currentHost.getAliasName())) {
+ combo.select(i);
+ return;
+ }
+ }
+ }
+ }
+
+ public void refreshConnections() {
+ hosts =
RSECorePlugin.getTheSystemRegistry().getHostsBySubSystemConfigurationCategory(fileSubSystem);
+ hostsAsStrings = new String[hosts.length];
+ int currentHostIndex = -1;
+ for( int i = 0; i < hosts.length; i++ ) {
+ hostsAsStrings[i] = hosts[i].getAliasName();
+ if( currentHostIndex == -1 && currentHostName != null
+ && hostsAsStrings[i].equals(currentHostName)) {
+ currentHostIndex = i;
+ }
+ }
+
+ // refill the combo thingie
+ combo.setItems(hostsAsStrings);
+ if( currentHostIndex != -1 ) // set the current host
+ combo.select(currentHostIndex);
+ else
+ combo.clearSelection();
+ }
+
+ @Override
+ public void modifyText(ModifyEvent e) {
+ int index = combo.getSelectionIndex();
+ if( index != -1 ) {
+ String s = combo.getItem(index);
+ for( int i = 0; i < hosts.length; i++ ) {
+ if( hosts[i].getAliasName().equals(s)) {
+ currentHost = hosts[i];
+ currentHostName = currentHost.getAliasName();
+ return;
+ }
+ }
+ }
+ }
+ public void systemModelResourceChanged(ISystemModelChangeEvent event) {
+ if( combo.isDisposed())
+ return;
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run() {
+ combo.removeModifyListener(comboMListener);
+ refreshConnections();
+ combo.addModifyListener(comboMListener);
+ }
+ });
+ }
+ @Override
+ public void dispose () {
+ super.dispose();
+ RSECorePlugin.getTheSystemRegistry().removeSystemModelChangeListener(this);
+ }
+ }
+ }
+
+}
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEUIPlugin.java
===================================================================
---
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEUIPlugin.java
(rev 0)
+++
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEUIPlugin.java 2010-08-11
08:53:06 UTC (rev 24033)
@@ -0,0 +1,33 @@
+package org.jboss.ide.eclipse.as.rse.ui;
+
+import org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod;
+import org.jboss.ide.eclipse.as.ui.editor.DeploymentModuleOptionCompositeAssistant;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class RSEUIPlugin implements BundleActivator {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ RSEUIPlugin.context = bundleContext;
+ DeploymentModuleOptionCompositeAssistant.addMapping(RSEPublishMethod.RSE_ID, new
RSEDeploymentPageCallback());
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ RSEUIPlugin.context = null;
+ }
+
+}