Author: rob.stryker(a)jboss.com
Date: 2011-08-31 05:26:48 -0400 (Wed, 31 Aug 2011)
New Revision: 34436
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7RuntimeWizardFragment.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7ServerWizardFragment.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
Log:
JBIDE-9609 - as7 ui workflow, JBIDE-9607 management poller failing, TRUNK
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF 2011-08-31
07:51:55 UTC (rev 34435)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF 2011-08-31
09:26:48 UTC (rev 34436)
@@ -7,6 +7,7 @@
Require-Bundle: org.jboss.ide.eclipse.as.core;bundle-version="2.3.0",
org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
org.eclipse.wst.server.core;bundle-version="1.1.302"
+Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: .,
jboss-as-controller-client-7.0.0.Final.jar,
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7RuntimeWizardFragment.java
(from rev 34380,
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7ServerWizardFragment.java)
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7RuntimeWizardFragment.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7RuntimeWizardFragment.java 2011-08-31
09:26:48 UTC (rev 34436)
@@ -0,0 +1,130 @@
+package org.jboss.ide.eclipse.as.ui.wizards;
+
+import java.io.File;
+import java.text.MessageFormat;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.TaskModel;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.bean.JBossServerType;
+import org.jboss.ide.eclipse.as.ui.IPreferenceKeys;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
+import org.jboss.ide.eclipse.as.ui.Messages;
+
+public class JBoss7RuntimeWizardFragment extends JBossRuntimeWizardFragment {
+
+ @Override
+ public boolean hasComposite() {
+ return true;
+ }
+
+ @Override
+ protected void updateModels() {
+ updateJREs();
+ }
+
+ @Override
+ protected void createWidgets(Composite main) {
+ createExplanation(main);
+ createNameComposite(main);
+ createHomeComposite(main);
+ createJREComposite(main);
+ }
+
+ protected void fillWidgets() {
+ IRuntime rt = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
+
+ if (rt != null) {
+ try {
+ fillNameWidgets(rt);
+ fillHomeDir(rt);
+ fillJREWidgets(rt);
+ } catch (Exception e) {
+ IStatus status = new Status(IStatus.ERROR, JBossServerUIPlugin.PLUGIN_ID,
MessageFormat.format(Messages.JBoss7ServerWizardFragment_could_not_create_ui,
rt.getName()), e);
+ JBossServerUIPlugin.getDefault().getLog().log(status);
+ }
+ }
+ }
+
+ @Override
+ protected void updatePage() {
+ int sel = jreCombo.getSelectionIndex();
+ int offset = -1;
+ if( sel + offset >= 0 )
+ selectedVM = installedJREs.get(sel + offset);
+ else // if sel < 0 or sel == 0 and offset == -1
+ selectedVM = null;
+ updateErrorMessage();
+ }
+
+ protected String getErrorString() {
+ if (nameText == null)
+ // not yet initialized. no errors
+ return null;
+
+ if (getRuntime(name) != null)
+ return Messages.rwf_NameInUse;
+
+ if (!isHomeValid())
+ return NLS.bind(Messages.rwf_homeMissingFiles, getSystemJarPath());
+
+ if (name == null || name.equals("")) //$NON-NLS-1$
+ return Messages.rwf_nameTextBlank;
+
+ return null;
+ }
+
+ @Override
+ protected boolean isHomeValid() {
+ if (homeDir == null || homeDir.length() == 0 || !(new File(homeDir).exists()))
+ return false;
+ return standaloneScriptExists();
+ }
+
+ private boolean standaloneScriptExists() {
+ String standaloneScriptPath = new StringBuilder(homeDir)
+ .append(File.separator)
+ .append("bin") //$NON-NLS-1$
+ .append(File.separator)
+ .append("standalone.sh") //$NON-NLS-1$
+ .toString();
+ return new File(standaloneScriptPath).exists();
+ }
+ @Override
+ protected String getSystemJarPath() {
+ return JBossServerType.AS7.getSystemJarPath();
+ }
+
+ @Override
+ public void performFinish(IProgressMonitor monitor) throws CoreException {
+ IRuntime rt = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
+ ((IRuntimeWorkingCopy) rt).setLocation(new Path(homeDir));
+ }
+
+ @Override
+ public void exit() {
+ IRuntime r = (IRuntime) getTaskModel()
+ .getObject(TaskModel.TASK_RUNTIME);
+ IRuntimeWorkingCopy runtimeWC = r.isWorkingCopy() ? ((IRuntimeWorkingCopy) r)
+ : r.createWorkingCopy();
+
+ runtimeWC.setName(name);
+ runtimeWC.setLocation(new Path(homeDir));
+ IJBossServerRuntime srt = (IJBossServerRuntime) runtimeWC.loadAdapter(
+ IJBossServerRuntime.class, new NullProgressMonitor());
+ srt.setVM(selectedVM);
+
+ getTaskModel().putObject(TaskModel.TASK_RUNTIME, runtimeWC);
+ }
+}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7ServerWizardFragment.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7ServerWizardFragment.java 2011-08-31
07:51:55 UTC (rev 34435)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7ServerWizardFragment.java 2011-08-31
09:26:48 UTC (rev 34436)
@@ -1,130 +0,0 @@
-package org.jboss.ide.eclipse.as.ui.wizards;
-
-import java.io.File;
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.TaskModel;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.server.bean.JBossServerType;
-import org.jboss.ide.eclipse.as.ui.IPreferenceKeys;
-import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
-import org.jboss.ide.eclipse.as.ui.Messages;
-
-public class JBoss7ServerWizardFragment extends JBossRuntimeWizardFragment {
-
- @Override
- public boolean hasComposite() {
- return true;
- }
-
- @Override
- protected void updateModels() {
- updateJREs();
- }
-
- @Override
- protected void createWidgets(Composite main) {
- createExplanation(main);
- createNameComposite(main);
- createHomeComposite(main);
- createJREComposite(main);
- }
-
- protected void fillWidgets() {
- IRuntime rt = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
-
- if (rt != null) {
- try {
- fillNameWidgets(rt);
- fillHomeDir(rt);
- fillJREWidgets(rt);
- } catch (Exception e) {
- IStatus status = new Status(IStatus.ERROR, JBossServerUIPlugin.PLUGIN_ID,
MessageFormat.format(Messages.JBoss7ServerWizardFragment_could_not_create_ui,
rt.getName()), e);
- JBossServerUIPlugin.getDefault().getLog().log(status);
- }
- }
- }
-
- @Override
- protected void updatePage() {
- int sel = jreCombo.getSelectionIndex();
- int offset = -1;
- if( sel + offset >= 0 )
- selectedVM = installedJREs.get(sel + offset);
- else // if sel < 0 or sel == 0 and offset == -1
- selectedVM = null;
- updateErrorMessage();
- }
-
- protected String getErrorString() {
- if (nameText == null)
- // not yet initialized. no errors
- return null;
-
- if (getRuntime(name) != null)
- return Messages.rwf_NameInUse;
-
- if (!isHomeValid())
- return NLS.bind(Messages.rwf_homeMissingFiles, getSystemJarPath());
-
- if (name == null || name.equals("")) //$NON-NLS-1$
- return Messages.rwf_nameTextBlank;
-
- return null;
- }
-
- @Override
- protected boolean isHomeValid() {
- if (homeDir == null || homeDir.length() == 0 || !(new File(homeDir).exists()))
- return false;
- return standaloneScriptExists();
- }
-
- private boolean standaloneScriptExists() {
- String standaloneScriptPath = new StringBuilder(homeDir)
- .append(File.separator)
- .append("bin") //$NON-NLS-1$
- .append(File.separator)
- .append("standalone.sh") //$NON-NLS-1$
- .toString();
- return new File(standaloneScriptPath).exists();
- }
- @Override
- protected String getSystemJarPath() {
- return JBossServerType.AS7.getSystemJarPath();
- }
-
- @Override
- public void performFinish(IProgressMonitor monitor) throws CoreException {
- IRuntime rt = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
- ((IRuntimeWorkingCopy) rt).setLocation(new Path(homeDir));
- }
-
- @Override
- public void exit() {
- IRuntime r = (IRuntime) getTaskModel()
- .getObject(TaskModel.TASK_RUNTIME);
- IRuntimeWorkingCopy runtimeWC = r.isWorkingCopy() ? ((IRuntimeWorkingCopy) r)
- : r.createWorkingCopy();
-
- runtimeWC.setName(name);
- runtimeWC.setLocation(new Path(homeDir));
- IJBossServerRuntime srt = (IJBossServerRuntime) runtimeWC.loadAdapter(
- IJBossServerRuntime.class, new NullProgressMonitor());
- srt.setVM(selectedVM);
-
- getTaskModel().putObject(TaskModel.TASK_RUNTIME, runtimeWC);
- }
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.properties 2011-08-31 07:51:55 UTC
(rev 34435)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.properties 2011-08-31 09:26:48 UTC
(rev 34436)
@@ -29,4 +29,5 @@
RuntimeTypesJBoss6OrLower=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
ServerTypesJBoss6OrLower=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
ServerTypesJBoss6OrHigher=org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70
-ServerTypesJBoss7=org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.60
\ No newline at end of file
+ServerTypesJBoss7=org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.60
+RuntimeTypesJBoss7=org.jboss.ide.eclipse.as.runtime.70,org.jboss.ide.eclipse.as.runtime.eap.60
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2011-08-31 07:51:55 UTC (rev
34435)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2011-08-31 09:26:48 UTC (rev
34436)
@@ -34,14 +34,18 @@
typeIds="%RuntimeTypesJBoss6OrLower"
id="org.jboss.ide.eclipse.as.ui.JBossRuntimeWizardFragment"/>
<fragment
-
class="org.jboss.ide.eclipse.as.ui.wizards.JBoss7ServerWizardFragment"
- id="org.jboss.ide.eclipse.as.ui.jboss7ServerWizardFragment"
- typeIds="%ServerTypesJBoss7"/>
- <fragment
class="org.jboss.ide.eclipse.as.ui.wizards.JBossServerWizardFragment"
id="org.jboss.ide.eclipse.as.ui.jbossServerWizardFragment"
typeIds="%ServerTypesJBoss6OrLower"/>
<fragment
+
class="org.jboss.ide.eclipse.as.ui.wizards.JBoss7RuntimeWizardFragment"
+ id="org.jboss.ide.eclipse.as.ui.jboss7RuntimeWizardFragment"
+ typeIds="%RuntimeTypesJBoss7"/>
+ <fragment
+
class="org.jboss.ide.eclipse.as.ui.wizards.JBossServerWizardFragment"
+ id="org.jboss.ide.eclipse.as.ui.jboss7ServerWizardFragment"
+ typeIds="%ServerTypesJBoss7"/>
+ <fragment
class="org.jboss.ide.eclipse.as.ui.wizards.StrippedServerWizardFragment"
id="org.jboss.ide.eclipse.as.ui.strippedServerWizardFragment"
typeIds="org.jboss.ide.eclipse.as.systemCopyServer"/>