Author: rob.stryker(a)jboss.com
Date: 2009-12-16 18:37:40 -0500 (Wed, 16 Dec 2009)
New Revision: 19372
Added:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossESBRuntime.java
Removed:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossLibraryListFieldEditor.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java
Log:
The classname for an esb runtime was way off and should clearly mention it being an ESB
runtime
Copied:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossESBRuntime.java
(from rev 19370,
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java)
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossESBRuntime.java
(rev 0)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossESBRuntime.java 2009-12-16
23:37:40 UTC (rev 19372)
@@ -0,0 +1,147 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.tools.esb.core.runtime;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Denny Xu
+ */
+public class JBossESBRuntime {
+
+ String name = null;
+
+ String homeDir = null;
+
+ String version = null;
+
+ String configuration = "";
+
+ boolean defaultRt = false;
+
+ List<String> libraries;
+
+ private boolean userConfigClasspath;
+
+ /**
+ * Default constructor
+ */
+ public JBossESBRuntime() {
+ libraries = new ArrayList<String>();
+ }
+
+ /**
+ * Get JBossWSRuntime name
+ *
+ * @return name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Get path to home directory
+ *
+ * @return home directory path as string
+ */
+ public String getHomeDir() {
+ return homeDir;
+ }
+
+
+ /**
+ * Get jboss server configuration
+ *
+ * @return JBoss configuration as string
+ */
+ public String getConfiguration(){
+ return configuration;
+ }
+
+ /**
+ * Set JBossWSRuntime name
+ *
+ * @param name
+ * new JBossWSRuntime name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Set home directory
+ *
+ * @param homeDir
+ * new JBossWSRuntime's home directory
+ */
+ public void setHomeDir(String homeDir) {
+ this.homeDir = homeDir;
+ }
+
+
+
+ /**
+ * Set JBoss server configuration, it is only for jboss AS contained ESB runtime
+ *
+ * @param configuration
+ * new JBossWSRuntime's configuration
+ */
+ public void setConfiguration(String configuration){
+ this.configuration = configuration;
+ }
+
+ /**
+ * Mark runtime as default
+ *
+ * @param b
+ * new value for default property
+ */
+ public void setDefault(boolean b) {
+ this.defaultRt = b;
+ }
+
+ /**
+ * Get default flag
+ *
+ * @return default property
+ */
+ public boolean isDefault() {
+ return defaultRt;
+ }
+
+ public List<String> getLibraries(){
+
+ return this.libraries;
+ }
+
+ public void setLibraries(List<String> libraries){
+ this.libraries = libraries;
+ }
+
+ public boolean isUserConfigClasspath(){
+ return this.userConfigClasspath;
+ }
+
+ public void setUserConfigClasspath(boolean userConfigClasspath){
+ this.userConfigClasspath = userConfigClasspath;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+}
Deleted:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java 2009-12-16
23:34:11 UTC (rev 19371)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java 2009-12-16
23:37:40 UTC (rev 19372)
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.tools.esb.core.runtime;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Denny Xu
- */
-public class JBossRuntime {
-
- String name = null;
-
- String homeDir = null;
-
- String version = null;
-
- String configuration = "";
-
- boolean defaultRt = false;
-
- List<String> libraries;
-
- private boolean userConfigClasspath;
-
- /**
- * Default constructor
- */
- public JBossRuntime() {
- libraries = new ArrayList<String>();
- }
-
- /**
- * Get JBossWSRuntime name
- *
- * @return name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Get path to home directory
- *
- * @return home directory path as string
- */
- public String getHomeDir() {
- return homeDir;
- }
-
-
- /**
- * Get jboss server configuration
- *
- * @return JBoss configuration as string
- */
- public String getConfiguration(){
- return configuration;
- }
-
- /**
- * Set JBossWSRuntime name
- *
- * @param name
- * new JBossWSRuntime name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Set home directory
- *
- * @param homeDir
- * new JBossWSRuntime's home directory
- */
- public void setHomeDir(String homeDir) {
- this.homeDir = homeDir;
- }
-
-
-
- /**
- * Set JBoss server configuration, it is only for jboss AS contained ESB runtime
- *
- * @param configuration
- * new JBossWSRuntime's configuration
- */
- public void setConfiguration(String configuration){
- this.configuration = configuration;
- }
-
- /**
- * Mark runtime as default
- *
- * @param b
- * new value for default property
- */
- public void setDefault(boolean b) {
- this.defaultRt = b;
- }
-
- /**
- * Get default flag
- *
- * @return default property
- */
- public boolean isDefault() {
- return defaultRt;
- }
-
- public List<String> getLibraries(){
-
- return this.libraries;
- }
-
- public void setLibraries(List<String> libraries){
- this.libraries = libraries;
- }
-
- public boolean isUserConfigClasspath(){
- return this.userConfigClasspath;
- }
-
- public void setUserConfigClasspath(boolean userConfigClasspath){
- this.userConfigClasspath = userConfigClasspath;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
-}
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java 2009-12-16
23:34:11 UTC (rev 19371)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java 2009-12-16
23:37:40 UTC (rev 19372)
@@ -149,7 +149,7 @@
} else {
- JBossRuntime jbws = JBossRuntimeManager.getInstance()
+ JBossESBRuntime jbws = JBossRuntimeManager.getInstance()
.findRuntimeByName(segment);
if (jbws != null) {
jars = JBossRuntimeManager.getInstance().getAllRuntimeJars(
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java 2009-12-16
23:34:11 UTC (rev 19371)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java 2009-12-16
23:37:40 UTC (rev 19372)
@@ -51,9 +51,9 @@
* TODO - write converter from old serialization format to XML?
* TODO - handle errors in string format
*/
- public Map<String, JBossRuntime> getMap(String input) {
+ public Map<String, JBossESBRuntime> getMap(String input) {
- Map<String, JBossRuntime> result = new HashMap<String, JBossRuntime>();
+ Map<String, JBossESBRuntime> result = new HashMap<String,
JBossESBRuntime>();
if (input == null || EMPTY_STRING.equals(input.trim())) {
return result;
}
@@ -61,7 +61,7 @@
while (runtimes.hasMoreTokens()) {
String runtime = runtimes.nextToken();
String[] map = runtime.split(REGEXP_ESCAPE + FIELD_SEPARATOR);
- JBossRuntime rt = new JBossRuntime();
+ JBossESBRuntime rt = new JBossESBRuntime();
final int step = 2;
for (int i = 0; i < map.length; i += step) {
String name = map[i];
@@ -124,10 +124,10 @@
* @return
* String representation of String to JBossWS Runtime map
*/
- public String getString(Map<String, JBossRuntime> runtimeMap) {
+ public String getString(Map<String, JBossESBRuntime> runtimeMap) {
StringBuffer buffer = new StringBuffer();
- JBossRuntime[] runtimes = runtimeMap.values().toArray(
- new JBossRuntime[runtimeMap.size()]);
+ JBossESBRuntime[] runtimes = runtimeMap.values().toArray(
+ new JBossESBRuntime[runtimeMap.size()]);
for (int i = 0; i < runtimes.length; i++) {
buffer.append(NAME).append(FIELD_SEPARATOR);
buffer.append(runtimes[i].getName());
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2009-12-16
23:34:11 UTC (rev 19371)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2009-12-16
23:37:40 UTC (rev 19372)
@@ -42,7 +42,7 @@
private static JBossRuntimeListConverter converter = new JBossRuntimeListConverter();
- private Map<String, JBossRuntime> runtimes = new HashMap<String,
JBossRuntime>();
+ private Map<String, JBossESBRuntime> runtimes = new HashMap<String,
JBossESBRuntime>();
static final String PLUGIN_ID = "org.jboss.tools.esb.project.core";
//$NON-NLS-1$
@@ -84,9 +84,9 @@
*
* @return JBossWSRuntime[]
*/
- public JBossRuntime[] getRuntimes() {
- Collection<JBossRuntime> c = runtimes.values();
- return c.toArray(new JBossRuntime[runtimes.size()]);
+ public JBossESBRuntime[] getRuntimes() {
+ Collection<JBossESBRuntime> c = runtimes.values();
+ return c.toArray(new JBossESBRuntime[runtimes.size()]);
}
/**
@@ -95,12 +95,12 @@
* @param runtime
* JBossWSRuntime
*/
- public void addRuntime(JBossRuntime runtime) {
+ public void addRuntime(JBossESBRuntime runtime) {
if (runtimes.size() == 0) {
runtime.setDefault(true);
}
- JBossRuntime oldDefaultRuntime = getDefaultRuntime();
+ JBossESBRuntime oldDefaultRuntime = getDefaultRuntime();
if (oldDefaultRuntime != null && runtime.isDefault()) {
oldDefaultRuntime.setDefault(false);
}
@@ -122,7 +122,7 @@
*/
public void addRuntime(String name, String path, String version,
boolean defaultRt) {
- JBossRuntime jbossWSRt = new JBossRuntime();
+ JBossESBRuntime jbossWSRt = new JBossESBRuntime();
jbossWSRt.setHomeDir(path);
jbossWSRt.setName(name);
jbossWSRt.setVersion(version);
@@ -137,8 +137,8 @@
* String - JBossWSRuntime name
* @return JBossWSRuntime - found JBossWSRuntime instance or null
*/
- public JBossRuntime findRuntimeByName(String name) {
- for (JBossRuntime jbossWSRuntime : runtimes.values()) {
+ public JBossESBRuntime findRuntimeByName(String name) {
+ for (JBossESBRuntime jbossWSRuntime : runtimes.values()) {
if (jbossWSRuntime.getName().equals(name)) {
return jbossWSRuntime;
}
@@ -146,20 +146,20 @@
return null;
}
- public JBossRuntime[] findRuntimeByVersion(String version) {
+ public JBossESBRuntime[] findRuntimeByVersion(String version) {
if(version == null || "".equals(version)){
return getRuntimes();
}
- List<JBossRuntime> rts = new ArrayList<JBossRuntime>();
- for (JBossRuntime jbossWSRuntime : runtimes.values()) {
+ List<JBossESBRuntime> rts = new ArrayList<JBossESBRuntime>();
+ for (JBossESBRuntime jbossWSRuntime : runtimes.values()) {
if (jbossWSRuntime.getVersion().equals(version)) {
rts.add(jbossWSRuntime);
}
}
- return rts.toArray(new JBossRuntime[]{});
+ return rts.toArray(new JBossESBRuntime[]{});
}
- public List<String> getAllRuntimeJars(JBossRuntime rt, String esbVersion){
+ public List<String> getAllRuntimeJars(JBossESBRuntime rt, String esbVersion){
List<String> jarList = new ArrayList<String>();
if (rt != null) {
if (rt.isUserConfigClasspath()) {
@@ -200,7 +200,7 @@
* @param rt
* JBossWSRuntime
*/
- public void removeRuntime(JBossRuntime rt) {
+ public void removeRuntime(JBossESBRuntime rt) {
runtimes.remove(rt.getName());
}
@@ -227,8 +227,8 @@
*
* @param runtime
*/
- public void setDefaultRuntime(JBossRuntime runtime) {
- JBossRuntime[] runtimes = getRuntimes();
+ public void setDefaultRuntime(JBossESBRuntime runtime) {
+ JBossESBRuntime[] runtimes = getRuntimes();
for (int i = 0; i < runtimes.length; i++) {
runtimes[i].setDefault(false);
}
@@ -240,8 +240,8 @@
*
* @return JBossWSRuntime
*/
- public JBossRuntime getDefaultRuntime() {
- for (JBossRuntime rt : runtimes.values()) {
+ public JBossESBRuntime getDefaultRuntime() {
+ for (JBossESBRuntime rt : runtimes.values()) {
if (rt.isDefault()) {
return rt;
}
@@ -255,9 +255,9 @@
* @return List<String>
*/
public List<String> getRuntimeNames() {
- JBossRuntime[] rts = getRuntimes();
+ JBossESBRuntime[] rts = getRuntimes();
List<String> result = new ArrayList<String>();
- for (JBossRuntime jbossWSRuntime : rts) {
+ for (JBossESBRuntime jbossWSRuntime : rts) {
result.add(jbossWSRuntime.getName());
}
return result;
@@ -269,9 +269,9 @@
* @return List of all runtime names
*/
public List<String> getAllRuntimeNames() {
- JBossRuntime[] rts = getRuntimes();
+ JBossESBRuntime[] rts = getRuntimes();
List<String> result = new ArrayList<String>();
- for (JBossRuntime jbossWSRuntime : rts) {
+ for (JBossESBRuntime jbossWSRuntime : rts) {
result.add(jbossWSRuntime.getName());
}
return result;
@@ -286,7 +286,7 @@
* new runtime name
*/
public void changeRuntimeName(String oldName, String newName) {
- JBossRuntime o = findRuntimeByName(oldName);
+ JBossESBRuntime o = findRuntimeByName(oldName);
if (o == null) {
return;
}
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java 2009-12-16
23:34:11 UTC (rev 19371)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java 2009-12-16
23:37:40 UTC (rev 19372)
@@ -22,7 +22,7 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.jboss.tools.esb.core.runtime.JBossRuntime;
+import org.jboss.tools.esb.core.runtime.JBossESBRuntime;
import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
@@ -40,7 +40,7 @@
private static final int COLUMNS = 3;
JBossRuntimeListFieldEditor jbossRuntimes = new JBossRuntimeListFieldEditor(
- "rtlist", JBossESBUIMessages.JBoss_Preference_Page_Runtimes, new
ArrayList<JBossRuntime>(Arrays.asList(JBossRuntimeManager.getInstance().getRuntimes())));
//$NON-NLS-1$
+ "rtlist", JBossESBUIMessages.JBoss_Preference_Page_Runtimes, new
ArrayList<JBossESBRuntime>(Arrays.asList(JBossRuntimeManager.getInstance().getRuntimes())));
//$NON-NLS-1$
/**
* Create contents of JBoss ESB preferences page. list editor
@@ -73,18 +73,18 @@
*/
@Override
protected void performApply() {
- for (JBossRuntime rt : jbossRuntimes.getAddedJBossRuntimes()) {
+ for (JBossESBRuntime rt : jbossRuntimes.getAddedJBossRuntimes()) {
JBossRuntimeManager.getInstance().addRuntime(rt);
}
jbossRuntimes.getAddedJBossRuntimes().clear();
- for (JBossRuntime rt : jbossRuntimes.getRemoved()) {
+ for (JBossESBRuntime rt : jbossRuntimes.getRemoved()) {
JBossRuntimeManager.getInstance().removeRuntime(rt);
}
jbossRuntimes.getRemoved().clear();
- JBossRuntime defaultRuntime = jbossRuntimes
+ JBossESBRuntime defaultRuntime = jbossRuntimes
.getDefaultJBossRuntime();
// reset default runtime
- for (JBossRuntime jbossWSRuntime : JBossRuntimeManager
+ for (JBossESBRuntime jbossWSRuntime : JBossRuntimeManager
.getInstance().getRuntimes()) {
jbossWSRuntime.setDefault(false);
}
@@ -93,10 +93,10 @@
defaultRuntime.setDefault(true);
}
jbossRuntimes.setDefaultJBossRuntime(null);
- Map<JBossRuntime, JBossRuntime> changed = jbossRuntimes
+ Map<JBossESBRuntime, JBossESBRuntime> changed = jbossRuntimes
.getChangedJBossRuntimes();
- for (JBossRuntime c : changed.keySet()) {
- JBossRuntime o = changed.get(c);
+ for (JBossESBRuntime c : changed.keySet()) {
+ JBossESBRuntime o = changed.get(c);
o.setHomeDir(c.getHomeDir());
o.setVersion(c.getVersion());
o.setConfiguration(c.getConfiguration());
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossLibraryListFieldEditor.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossLibraryListFieldEditor.java 2009-12-16
23:34:11 UTC (rev 19371)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossLibraryListFieldEditor.java 2009-12-16
23:37:40 UTC (rev 19372)
@@ -48,7 +48,7 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Group;
-import org.jboss.tools.esb.core.runtime.JBossRuntime;
+import org.jboss.tools.esb.core.runtime.JBossESBRuntime;
import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
import org.jboss.tools.esb.project.ui.preference.JBossESBUIPlugin;
@@ -78,7 +78,7 @@
private ActionPanel actionPanel;
- private JBossRuntime tempJbesb;
+ private JBossESBRuntime tempJbesb;
@@ -100,9 +100,9 @@
* Object
*/
public JBossLibraryListFieldEditor(String name, String label,
- JBossRuntime jbws) {
+ JBossESBRuntime jbws) {
super(name, label, jbws);
- this.tempJbesb = new JBossRuntime();
+ this.tempJbesb = new JBossESBRuntime();
if(jbws != null){
this.tempJbesb.setUserConfigClasspath(jbws.isUserConfigClasspath());
this.tempJbesb.getLibraries().addAll(jbws.getLibraries());
@@ -203,8 +203,8 @@
listView.setContentProvider(new ITreeContentProvider() {
public Object[] getElements(Object inputElement) {
- if (inputElement instanceof JBossRuntime) {
- return ((JBossRuntime) inputElement).getLibraries().toArray();
+ if (inputElement instanceof JBossESBRuntime) {
+ return ((JBossESBRuntime) inputElement).getLibraries().toArray();
} else {
throw new IllegalArgumentException(
JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Inputelement_Must_Be_List);
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2009-12-16
23:34:11 UTC (rev 19371)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2009-12-16
23:37:40 UTC (rev 19372)
@@ -65,7 +65,7 @@
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.jboss.tools.esb.core.ESBProjectConstant;
-import org.jboss.tools.esb.core.runtime.JBossRuntime;
+import org.jboss.tools.esb.core.runtime.JBossESBRuntime;
import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
@@ -95,13 +95,13 @@
private ActionPanel actionPanel;
- private Map<JBossRuntime, JBossRuntime> changed = new HashMap<JBossRuntime,
JBossRuntime>();
+ private Map<JBossESBRuntime, JBossESBRuntime> changed = new
HashMap<JBossESBRuntime, JBossESBRuntime>();
- private JBossRuntime checkedElement = new JBossRuntime();
+ private JBossESBRuntime checkedElement = new JBossESBRuntime();
- private List<JBossRuntime> added = new ArrayList<JBossRuntime>();
+ private List<JBossESBRuntime> added = new ArrayList<JBossESBRuntime>();
- private List<JBossRuntime> removed = new ArrayList<JBossRuntime>();
+ private List<JBossESBRuntime> removed = new ArrayList<JBossESBRuntime>();
// ------------------------------------------------------------------------
// Constructors
@@ -127,11 +127,11 @@
*
* @return JBossRuntime;
*/
- public JBossRuntime getDefaultJBossRuntime() {
+ public JBossESBRuntime getDefaultJBossRuntime() {
return checkedElement;
}
- public void setDefaultJBossRuntime(JBossRuntime rt) {
+ public void setDefaultJBossRuntime(JBossESBRuntime rt) {
checkedElement = rt;
}
@@ -140,7 +140,7 @@
*
* @return List<JBossRuntime>
*/
- public List<JBossRuntime> getAddedJBossRuntimes() {
+ public List<JBossESBRuntime> getAddedJBossRuntimes() {
return added;
}
@@ -149,7 +149,7 @@
*
* @return List<JBossRuntime>
*/
- public Map<JBossRuntime, JBossRuntime> getChangedJBossRuntimes() {
+ public Map<JBossESBRuntime, JBossESBRuntime> getChangedJBossRuntimes() {
return changed;
}
@@ -158,7 +158,7 @@
*
* @return List<JBossRuntime>
*/
- public List<JBossRuntime> getRemoved() {
+ public List<JBossESBRuntime> getRemoved() {
return removed;
}
@@ -223,7 +223,7 @@
public Object[] getElements(Object inputElement) {
if (inputElement instanceof List) {
- return ((List<JBossRuntime>) inputElement).toArray();
+ return ((List<JBossESBRuntime>) inputElement).toArray();
} else {
throw new IllegalArgumentException(
JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Inputelement_Must_Be_List);
@@ -264,7 +264,7 @@
}
public String getColumnText(Object element, int columnIndex) {
- JBossRuntime rt = (JBossRuntime) element;
+ JBossESBRuntime rt = (JBossESBRuntime) element;
if (columnIndex == TC_DEFAULT_NUMBER) {
return ""; //$NON-NLS-1$
}
@@ -286,13 +286,13 @@
tableView.getTable().setHeaderVisible(true);
tableView.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
- JBossRuntime selRt = (JBossRuntime) event.getElement();
+ JBossESBRuntime selRt = (JBossESBRuntime) event.getElement();
if (event.getChecked()) {
- JBossRuntime deselRt = null;
+ JBossESBRuntime deselRt = null;
Object[] selRts = tableView.getCheckedElements();
for (int i = 0; i < selRts.length; i++) {
- JBossRuntime rt = (JBossRuntime) selRts[i];
+ JBossESBRuntime rt = (JBossESBRuntime) selRts[i];
if (rt != selRt) {
deselRt = rt;
break;
@@ -304,7 +304,7 @@
checkedElement = null;
int i = 0;
for (Object object : selRts) {
- JBossRuntime rt = (JBossRuntime) object;
+ JBossESBRuntime rt = (JBossESBRuntime) object;
if (rt == selRt) {
newChecked[i] = rt;
checkedElement = rt;
@@ -313,7 +313,7 @@
}
tableView.setCheckedElements(newChecked);
} else {
- checkedElement = (JBossRuntime) event.getElement();
+ checkedElement = (JBossESBRuntime) event.getElement();
}
} else {
if (checkedElement == selRt) {
@@ -324,7 +324,7 @@
}
});
- for (JBossRuntime rt : (List<JBossRuntime>) getValue()) {
+ for (JBossESBRuntime rt : (List<JBossESBRuntime>) getValue()) {
if (rt.isDefault()) {
tableView.setChecked(rt, true);
checkedElement = rt;
@@ -343,9 +343,9 @@
*/
@SuppressWarnings("unchecked")
private void setDefaultRuntime() {
- List<JBossRuntime> runtimes = (List<JBossRuntime>) getValue();
+ List<JBossESBRuntime> runtimes = (List<JBossESBRuntime>) getValue();
boolean checked = false;
- for (JBossRuntime jbossRuntime : runtimes) {
+ for (JBossESBRuntime jbossRuntime : runtimes) {
if (checkedElement == jbossRuntime) {
checked = true;
@@ -421,7 +421,7 @@
private static final int GL_PARENT_COLUMNS = 1;
private static final int GL_CONTENT_COLUMNS = 3;
- List<JBossRuntime> value = null;
+ List<JBossESBRuntime> value = null;
IFieldEditor name = createTextEditor(SRT_NAME,
JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Name2, "");
//$NON-NLS-1$
@@ -438,11 +438,11 @@
JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Home_Folder,
""); //$NON-NLS-1$
- JBossRuntime current = null;
- JBossRuntime source = null;
+ JBossESBRuntime current = null;
+ JBossESBRuntime source = null;
IFieldEditor jars = null;
- public JBossWSRuntimeWizardPage(List<JBossRuntime> editedList, JBossRuntime
source) {
+ public JBossWSRuntimeWizardPage(List<JBossESBRuntime> editedList, JBossESBRuntime
source) {
super(
JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_New_Runtime);
@@ -547,7 +547,7 @@
setPageComplete(false);
return;
}
- for (JBossRuntime rt : value) {
+ for (JBossESBRuntime rt : value) {
if (current != null && current.getName().equals(rt.getName())) {
continue;
}
@@ -560,7 +560,7 @@
}
}
- JBossRuntime jarJbws = (JBossRuntime) jars.getValue();
+ JBossESBRuntime jarJbws = (JBossESBRuntime) jars.getValue();
if (current != null
&& current.getName().equals(name.getValueAsString())
&& current.getHomeDir().equals(homeDir.getValueAsString())
@@ -678,13 +678,13 @@
*
* @return JBossRuntime instance
*/
- public JBossRuntime getRuntime() {
- JBossRuntime newRt = new JBossRuntime();
+ public JBossESBRuntime getRuntime() {
+ JBossESBRuntime newRt = new JBossESBRuntime();
newRt.setName(name.getValueAsString());
newRt.setVersion(version.getValueAsString());
newRt.setHomeDir(homeDir.getValueAsString());
newRt.setConfiguration(configuration.getText());
- JBossRuntime rt = (JBossRuntime) jars.getValue();
+ JBossESBRuntime rt = (JBossESBRuntime) jars.getValue();
newRt.setLibraries(rt.getLibraries());
newRt.setUserConfigClasspath(rt.isUserConfigClasspath());
return newRt;
@@ -772,11 +772,11 @@
public static class JBossRuntimeNewWizard extends Wizard {
JBossWSRuntimeWizardPage page1 = null;
- List<JBossRuntime> added = null;
- List<JBossRuntime> value = null;
+ List<JBossESBRuntime> added = null;
+ List<JBossESBRuntime> value = null;
- public JBossRuntimeNewWizard(List<JBossRuntime> exist,
- List<JBossRuntime> added) {
+ public JBossRuntimeNewWizard(List<JBossESBRuntime> exist,
+ List<JBossESBRuntime> added) {
super();
setWindowTitle(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_New_Runtime);
page1 = new JBossWSRuntimeWizardPage(exist, null);
@@ -792,14 +792,14 @@
*/
@Override
public boolean performFinish() {
- JBossRuntime rt = page1.getRuntime();
+ JBossESBRuntime rt = page1.getRuntime();
added.add(rt);
value.add(rt);
return true;
}
- protected JBossRuntime getRuntime() {
+ protected JBossESBRuntime getRuntime() {
return page1.getRuntime();
}
@@ -812,10 +812,10 @@
*/
public static class JBossWSRuntimeEditWizard extends Wizard {
JBossWSRuntimeWizardPage page1 = null;
- List<JBossRuntime> added = null;
- Map<JBossRuntime, JBossRuntime> changed = null;
- List<JBossRuntime> value = null;
- JBossRuntime source = null;
+ List<JBossESBRuntime> added = null;
+ Map<JBossESBRuntime, JBossESBRuntime> changed = null;
+ List<JBossESBRuntime> value = null;
+ JBossESBRuntime source = null;
/**
* Constructor with almost all initialization parameters
@@ -830,9 +830,9 @@
* @param changed
* List<JBossRuntime> - TBD
*/
- public JBossWSRuntimeEditWizard(List<JBossRuntime> existing,
- JBossRuntime source, List<JBossRuntime> added,
- Map<JBossRuntime, JBossRuntime> changed) {
+ public JBossWSRuntimeEditWizard(List<JBossESBRuntime> existing,
+ JBossESBRuntime source, List<JBossESBRuntime> added,
+ Map<JBossESBRuntime, JBossESBRuntime> changed) {
super();
setWindowTitle(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Edit_Runtime);
page1 = new JBossWSRuntimeWizardPage(existing, source);
@@ -858,7 +858,7 @@
*/
@Override
public boolean performFinish() {
- JBossRuntime rt = page1.getRuntime();
+ JBossESBRuntime rt = page1.getRuntime();
if (added.contains(source) || changed.containsKey(source)) {
source.setName(rt.getName());
@@ -1018,7 +1018,7 @@
*/
public abstract class BaseAction extends Action {
- JBossRuntime[] runtimes = new JBossRuntime[0];
+ JBossESBRuntime[] runtimes = new JBossESBRuntime[0];
/**
* Constructor creates action with provided name
@@ -1039,13 +1039,13 @@
*/
public void setSelection(ISelection selection) {
if (selection instanceof IStructuredSelection) {
- List<JBossRuntime> rts = new ArrayList<JBossRuntime>();
+ List<JBossESBRuntime> rts = new ArrayList<JBossESBRuntime>();
for (Object rt : ((IStructuredSelection) selection).toArray()) {
- rts.add((JBossRuntime) rt);
+ rts.add((JBossESBRuntime) rt);
}
- runtimes = rts.toArray(new JBossRuntime[] {});
+ runtimes = rts.toArray(new JBossESBRuntime[] {});
} else {
- runtimes = new JBossRuntime[0];
+ runtimes = new JBossESBRuntime[0];
}
updateEnablement();
}
@@ -1085,7 +1085,7 @@
@Override
public void run() {
Wizard wiz = new JBossRuntimeNewWizard(
- (List<JBossRuntime>) getValue(), added);
+ (List<JBossESBRuntime>) getValue(), added);
WizardDialog dialog = new WizardDialog(Display.getCurrent()
.getActiveShell(), wiz);
dialog.open();
@@ -1128,15 +1128,15 @@
@SuppressWarnings("unchecked")
@Override
public void run() {
- JBossRuntime selected = runtimes[0];
+ JBossESBRuntime selected = runtimes[0];
Wizard wiz = new JBossWSRuntimeEditWizard(
- (List<JBossRuntime>) getValue(), runtimes[0], added,
+ (List<JBossESBRuntime>) getValue(), runtimes[0], added,
changed);
WizardDialog dialog = new WizardDialog(Display.getCurrent()
.getActiveShell(), wiz);
dialog.open();
tableView.refresh();
- JBossRuntime c = null;
+ JBossESBRuntime c = null;
if (changed.containsValue(selected)) {
c = findChangedRuntime(selected);
if (c != null) {
@@ -1149,8 +1149,8 @@
setDefaultRuntime();
}
- private JBossRuntime findChangedRuntime(JBossRuntime source) {
- for (JBossRuntime r : changed.keySet()) {
+ private JBossESBRuntime findChangedRuntime(JBossESBRuntime source) {
+ for (JBossESBRuntime r : changed.keySet()) {
if (source == changed.get(r)) {
return r;
}
@@ -1185,7 +1185,7 @@
*/
@Override
public void run() {
- for (JBossRuntime rt : runtimes) {
+ for (JBossESBRuntime rt : runtimes) {
removeRuntime(rt);
}
tableView.refresh();
@@ -1193,7 +1193,7 @@
}
@SuppressWarnings("unchecked")
- private void removeRuntime(JBossRuntime r) {
+ private void removeRuntime(JBossESBRuntime r) {
boolean used = JBossRuntimeManager.isRuntimeUsed(r.getName());
String title = JBossESBUIMessages.JBoss_Runtime_Delete_Confirm_Title;
String message = (used) ? NLS.bind(
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2009-12-16
23:34:11 UTC (rev 19371)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2009-12-16
23:37:40 UTC (rev 19372)
@@ -60,7 +60,7 @@
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.tools.esb.core.ESBProjectConstant;
import org.jboss.tools.esb.core.facet.IJBossESBFacetDataModelProperties;
-import org.jboss.tools.esb.core.runtime.JBossRuntime;
+import org.jboss.tools.esb.core.runtime.JBossESBRuntime;
import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
import org.jboss.tools.esb.project.ui.ESBProjectPlugin;
import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
@@ -283,7 +283,7 @@
cmbRuntimes.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
String runtimeName = cmbRuntimes.getText();
- JBossRuntime jr = (JBossRuntime) cmbRuntimes
+ JBossESBRuntime jr = (JBossESBRuntime) cmbRuntimes
.getData(runtimeName);
saveJBossESBRuntimeToModel(jr);
changePageStatus();
@@ -339,7 +339,7 @@
if(runtimename == null || runtimename.equals("")){ //$NON-NLS-1$
hasRuntime = false;
}
- JBossRuntime jbRuntime =
JBossRuntimeManager.getInstance().findRuntimeByName(runtimename);
+ JBossESBRuntime jbRuntime =
JBossRuntimeManager.getInstance().findRuntimeByName(runtimename);
if (jbRuntime != null) {
@@ -424,13 +424,13 @@
* create a new jboss ESB runtime and set user supplied runtime to the new one
*/
protected void newJBossRuntime() {
- List<JBossRuntime> exists = new
ArrayList<JBossRuntime>(Arrays.asList(JBossRuntimeManager.getInstance().getRuntimes()));
- List<JBossRuntime> added = new ArrayList<JBossRuntime>();
+ List<JBossESBRuntime> exists = new
ArrayList<JBossESBRuntime>(Arrays.asList(JBossRuntimeManager.getInstance().getRuntimes()));
+ List<JBossESBRuntime> added = new ArrayList<JBossESBRuntime>();
JBossRuntimeListFieldEditor.JBossRuntimeNewWizard newRtwizard = new
JBossRuntimeListFieldEditor.JBossRuntimeNewWizard(
exists, added) {
public boolean performFinish() {
- JBossRuntime rt = getRuntime();
+ JBossESBRuntime rt = getRuntime();
rt.setDefault(true);
JBossRuntimeManager.getInstance().addRuntime(rt);
JBossRuntimeManager.getInstance().save();
@@ -446,8 +446,8 @@
}
protected void initializeRuntimesCombo(Combo cmRuntime, String runtimeName, String
version) {
- JBossRuntime selectedJbRuntime = null;
- JBossRuntime defaultJbws = null;
+ JBossESBRuntime selectedJbRuntime = null;
+ JBossESBRuntime defaultJbws = null;
int selectIndex = 0;
int defaultIndex = 0;
@@ -455,10 +455,10 @@
if(runtimeName == null || "".equals(runtimeName)){ //$NON-NLS-1$
runtimeName = model.getStringProperty(IJBossESBFacetDataModelProperties.RUNTIME_ID);
}
- JBossRuntime[] runtimes = JBossRuntimeManager.getInstance()
+ JBossESBRuntime[] runtimes = JBossRuntimeManager.getInstance()
.findRuntimeByVersion(version);
for (int i = 0; i < runtimes.length; i++) {
- JBossRuntime jr = runtimes[i];
+ JBossESBRuntime jr = runtimes[i];
cmRuntime.add(jr.getName());
cmRuntime.setData(jr.getName(), jr);
@@ -508,7 +508,7 @@
}
- protected void saveJBossESBRuntimeToModel(JBossRuntime jbws) {
+ protected void saveJBossESBRuntimeToModel(JBossESBRuntime jbws) {
if (jbws != null) {
model.setStringProperty(
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java 2009-12-16
23:34:11 UTC (rev 19371)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java 2009-12-16
23:37:40 UTC (rev 19372)
@@ -46,7 +46,7 @@
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.ui.ServerUICore;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
-import org.jboss.tools.esb.core.runtime.JBossRuntime;
+import org.jboss.tools.esb.core.runtime.JBossESBRuntime;
import org.jboss.tools.esb.core.runtime.JBossRuntimeClassPathInitializer;
import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
import org.jboss.tools.esb.project.ui.ESBProjectPlugin;
@@ -123,8 +123,8 @@
if(obj instanceof IRuntime){
path =
path.append(JBossRuntimeClassPathInitializer.JBOSS_ESB_RUNTIME_CLASSPATH_SERVER_SUPPLIED);
path = path.append(((IRuntime)obj).getId());
- }else if(obj instanceof JBossRuntime){
- path = path.append(((JBossRuntime)obj).getName());
+ }else if(obj instanceof JBossESBRuntime){
+ path = path.append(((JBossESBRuntime)obj).getName());
}
entry = JavaCore.newContainerEntry(path);
return true;
@@ -141,9 +141,9 @@
private List getAllAvailableESBRuntimes(){
List runtimes = new ArrayList();
- JBossRuntime[] preRuntimes = JBossRuntimeManager.getInstance().getRuntimes();
+ JBossESBRuntime[] preRuntimes = JBossRuntimeManager.getInstance().getRuntimes();
IRuntime[] serverRuntimes = ServerCore.getRuntimes();
- List<JBossRuntime> preList = Arrays.asList(preRuntimes);
+ List<JBossESBRuntime> preList = Arrays.asList(preRuntimes);
List<IRuntime> serverRuntimeList = Arrays.asList(serverRuntimes);
runtimes.addAll(preList);
runtimes.addAll(serverRuntimeList);
@@ -198,14 +198,14 @@
case 0:
if(element instanceof IRuntime){
return serverLabel.getText(element);
- }else if(element instanceof JBossRuntime){
- return ((JBossRuntime)element).getName();
+ }else if(element instanceof JBossESBRuntime){
+ return ((JBossESBRuntime)element).getName();
}
break;
case 1:
if(element instanceof IRuntime){
return
JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_RuntimeType_ServerContained;
- }else if(element instanceof JBossRuntime){
+ }else if(element instanceof JBossESBRuntime){
return
JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_RuntimeType_ESBLibrariesOnly;
}
break;