JBoss Tools SVN: r24457 - in trunk/vpe: tests/org.jboss.tools.vpe.test/scheme and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dvinnichek
Date: 2010-08-26 02:29:45 -0400 (Thu, 26 Aug 2010)
New Revision: 24457
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml
trunk/vpe/tests/org.jboss.tools.vpe.test/scheme/scheme.xsd
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/TemplateSchemeValidateTest.java
Log:
fix org.jboss.tools.vpe.test.TemplateSchemeValidateTest
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml 2010-08-25 22:05:33 UTC (rev 24456)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml 2010-08-26 06:29:45 UTC (rev 24457)
@@ -242,7 +242,7 @@
</vpe:template>
</vpe:tag>
- <vpe:tag name="form:select" case-sensetive="yes">
+ <vpe:tag name="form:select" case-sensitive="yes">
<vpe:template children="yes" modify="yes"
class="org.jboss.tools.vpe.spring.template.SpringFormSelectTemplate">
<vpe:resize>
Modified: trunk/vpe/tests/org.jboss.tools.vpe.test/scheme/scheme.xsd
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.test/scheme/scheme.xsd 2010-08-25 22:05:33 UTC (rev 24456)
+++ trunk/vpe/tests/org.jboss.tools.vpe.test/scheme/scheme.xsd 2010-08-26 06:29:45 UTC (rev 24457)
@@ -327,7 +327,9 @@
<xsd:element name="value" type="vpe:VALUE" minOccurs="0"/>
<xsd:element name="copy" type="vpe:COPY" minOccurs="0"/>
<xsd:element name="input" type="vpe:HTML_INPUT" minOccurs="0" form="unqualified" />
+ <xsd:element name="label" type="vpe:HTML_LABEL" minOccurs="0" form="unqualified" />
</xsd:sequence>
+ <xsd:attribute name="id" type="xsd:string" use="optional"/>
<xsd:attribute name="style" type="xsd:string" use="optional"/>
<xsd:attribute name="class" type="xsd:string" use="optional"/>
<xsd:attribute name="title" type="xsd:string" use="optional"/>
@@ -347,6 +349,7 @@
<xsd:attribute name="border" type="xsd:string" use="optional"/>
<xsd:attribute name="disabled" type="xsd:string" use="optional"/>
<xsd:attribute name="id" type="xsd:string" use="optional"/>
+ <xsd:attribute name="name" type="xsd:string" use="optional"/>
</xsd:complexType>
<!-- -->
<xsd:complexType name="HTML_DIV" mixed="true">
@@ -416,7 +419,12 @@
<xsd:sequence>
<xsd:element name="value" minOccurs="0" type="vpe:VALUE" />
</xsd:sequence>
+ <xsd:attribute name="id" type="xsd:string" use="optional"/>
+ <xsd:attribute name="style" type="xsd:string" use="optional"/>
+ <xsd:attribute name="class" type="xsd:string" use="optional"/>
+ <xsd:attribute name="dir" type="xsd:string" use="optional"/>
<xsd:attribute name="value" type="xsd:string" use="optional"/>
+ <xsd:attribute name="disabled" type="xsd:string" use="optional"/>
<xsd:attribute name="title" type="xsd:string" use="optional"/>
</xsd:complexType>
<!-- -->
@@ -573,7 +581,11 @@
<!-- -->
<xsd:complexType name="HTML_P"/>
<!-- -->
- <xsd:complexType name="HTML_FORM"/>
+ <xsd:complexType name="HTML_FORM">
+ <xsd:attribute name="id" type="xsd:string" use="optional"/>
+ <xsd:attribute name="style" type="xsd:string" use="optional"/>
+ <xsd:attribute name="class" type="xsd:string" use="optional"/>
+ </xsd:complexType>
<!-- -->
<xsd:complexType name="DEFAULT_TEMPLATE">
<xsd:sequence>
Modified: trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/TemplateSchemeValidateTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/TemplateSchemeValidateTest.java 2010-08-25 22:05:33 UTC (rev 24456)
+++ trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/TemplateSchemeValidateTest.java 2010-08-26 06:29:45 UTC (rev 24457)
@@ -15,11 +15,7 @@
import java.io.IOException;
import java.net.URL;
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
@@ -36,16 +32,10 @@
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.RegistryFactory;
-import org.jboss.tools.common.reporting.IProblemReporter;
-import org.jboss.tools.common.reporting.ProblemReporterFactory;
-import org.jboss.tools.vpe.VpePlugin;
-import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
import org.osgi.framework.Bundle;
-import org.w3c.dom.Document;
import org.xml.sax.SAXException;
/**
@@ -54,233 +44,234 @@
* @author Dzmitry Sakovich
*/
public class TemplateSchemeValidateTest extends TestCase {
- /**
- * Extension point ID
- */
- private static final String COM_REDHAT_VPE_TEMPLATES = "org.jboss.tools.vpe.templates";
+ /**
+ * Extension point ID
+ */
+ private static final String COM_REDHAT_VPE_TEMPLATES = "org.jboss.tools.vpe.templates"; //$NON-NLS-1$
- private static final String VPE_TEST_EXTENSION = "org.jboss.tools.vpe.test";
+ private static final String VPE_TEST_EXTENSION = "org.jboss.tools.vpe.test"; //$NON-NLS-1$
- private static final String SCHEME_PATH = "/scheme/scheme.xsd";
+ private static final String SCHEME_PATH = "/scheme/scheme.xsd"; //$NON-NLS-1$
- private static final String PLUGIN_FAILURE_NAME = "testFailure-plugin.xml";
+ private static final String PLUGIN_FAILURE_NAME = "testFailure-plugin.xml"; //$NON-NLS-1$
- private static Schema schema = null;
+ private static Schema schema = null;
- private static final String PLUGIN_OK_NAME = "testOk-plugin.xml";
+ private static final String PLUGIN_OK_NAME = "testOk-plugin.xml"; //$NON-NLS-1$
- private static final String SCHEME_LANGUAGE = "http://www.w3.org/2001/XMLSchema";
+ private static final String SCHEME_LANGUAGE = "http://www.w3.org/2001/XMLSchema"; //$NON-NLS-1$
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- Bundle bundle = VpeTestPlugin.getDefault().getBundle();
- URL url = null;
- url = bundle == null ? null : FileLocator.resolve(bundle
- .getEntry(SCHEME_PATH));
- File schemeFile = new File(url.getPath());
- if (!schemeFile.exists() || !schemeFile.isFile()) {
- fail("scheme is not exist");
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ Bundle bundle = VpeTestPlugin.getDefault().getBundle();
+ URL url = null;
+ url = bundle == null ? null : FileLocator.resolve(bundle
+ .getEntry(SCHEME_PATH));
+ File schemeFile = new File(url.getPath());
+ if (!schemeFile.exists() || !schemeFile.isFile()) {
+ fail("scheme is not exist"); //$NON-NLS-1$
+ }
+ SchemaFactory factory = SchemaFactory.newInstance(SCHEME_LANGUAGE);
+ schema = factory.newSchema(schemeFile);
}
- SchemaFactory factory = SchemaFactory.newInstance(SCHEME_LANGUAGE);
- schema = factory.newSchema(schemeFile);
- }
- /**
- * Test for load all templates
- */
- public void testValidationGlobalTemplates() {
- //
- assertNotNull("Schema is not exist", schema);
- IExtensionRegistry extensionRepository = Platform
- .getExtensionRegistry();
+ /**
+ * Test for load all templates
+ */
+ public void testValidationGlobalTemplates() {
+ //
+ assertNotNull("Schema is not exist", schema); //$NON-NLS-1$
+ IExtensionRegistry extensionRepository = Platform
+ .getExtensionRegistry();
- IExtensionPoint extensionPoint = extensionRepository
- .getExtensionPoint(COM_REDHAT_VPE_TEMPLATES);
- IExtension[] extensions = extensionPoint.getExtensions();
+ IExtensionPoint extensionPoint = extensionRepository
+ .getExtensionPoint(COM_REDHAT_VPE_TEMPLATES);
+ IExtension[] extensions = extensionPoint.getExtensions();
- // iterate for all extensions
- for (int i = 0; i < extensions.length; i++) {
- IExtension extension = extensions[i];
- IConfigurationElement[] elements = extension
- .getConfigurationElements();
- for (int j = 0; j < elements.length; j++) {
- String pathAttrValue = elements[j].getAttribute("path");
- try {
- IPath templateFile = getFullpathForConfigurationElement(
- pathAttrValue, elements[j]);
+ // iterate for all extensions
+ for (int i = 0; i < extensions.length; i++) {
+ IExtension extension = extensions[i];
+ IConfigurationElement[] elements = extension
+ .getConfigurationElements();
+ for (int j = 0; j < elements.length; j++) {
+ String pathAttrValue = elements[j].getAttribute("path"); //$NON-NLS-1$
+ try {
+ IPath templateFile = getFullpathForConfigurationElement(
+ pathAttrValue, elements[j]);
- try {
- Validator validator = schema.newValidator();
- Source source = new StreamSource(templateFile
- .toOSString());
- validator.validate(source);
- } catch (SAXException ex) {
- fail("Sheme " + templateFile.toFile().getName()
- + " is not valid : " + ex.getMessage());
- }
- } catch (IOException e) {
- fail(e.getMessage());
+ try {
+ Validator validator = schema.newValidator();
+ Source source = new StreamSource(
+ templateFile.toOSString());
+ validator.validate(source);
+ } catch (SAXException ex) {
+ fail("Sheme " + templateFile.toFile().getName() //$NON-NLS-1$
+ + " is not valid : " + ex.getMessage()); //$NON-NLS-1$
+ }
+ } catch (IOException e) {
+ fail(e.getMessage());
+ }
+ }
}
- }
+
}
- }
+ public void testValidationIncorrectTemplplates() throws Exception {
- public void testValidationIncorrectTemplplates() throws Exception {
+ assertNotNull("Schema is not exist", schema); //$NON-NLS-1$
+ createTemplatesForTesting(PLUGIN_FAILURE_NAME);
- assertNotNull("Schema is not exist", schema);
- createTemplatesForTesting(PLUGIN_FAILURE_NAME);
+ IExtensionRegistry extensionRepository = Platform
+ .getExtensionRegistry();
- IExtensionRegistry extensionRepository = Platform
- .getExtensionRegistry();
+ IExtensionPoint extensionPoint = extensionRepository
+ .getExtensionPoint(COM_REDHAT_VPE_TEMPLATES);
+ IExtension[] extensions = extensionPoint.getExtensions();
+ for (int i = 0; i < extensions.length; i++) {
+ if (extensions[i].getNamespaceIdentifier().equals(
+ VPE_TEST_EXTENSION)) {
+ IConfigurationElement[] elements = extensions[i]
+ .getConfigurationElements();
+ for (int j = 0; j < elements.length; j++) {
+ String pathAttrValue = elements[j].getAttribute("path"); //$NON-NLS-1$
+ try {
+ IPath templateFile = getFullpathForConfigurationElement(
+ pathAttrValue, elements[j]);
- IExtensionPoint extensionPoint = extensionRepository
- .getExtensionPoint(COM_REDHAT_VPE_TEMPLATES);
- IExtension[] extensions = extensionPoint.getExtensions();
- for (int i = 0; i < extensions.length; i++) {
- if (extensions[i].getNamespaceIdentifier().equals(
- VPE_TEST_EXTENSION)) {
- IConfigurationElement[] elements = extensions[i]
- .getConfigurationElements();
- for (int j = 0; j < elements.length; j++) {
- String pathAttrValue = elements[j].getAttribute("path");
- try {
- IPath templateFile = getFullpathForConfigurationElement(
- pathAttrValue, elements[j]);
-
- try {
- Validator validator = schema.newValidator();
- Source source = new StreamSource(templateFile
- .toOSString());
- validator.validate(source);
- } catch (SAXException ex) {
- assertTrue("Scheme "
- + templateFile.toFile().getName()
- + " is not valid", true);
+ try {
+ Validator validator = schema.newValidator();
+ Source source = new StreamSource(
+ templateFile.toOSString());
+ validator.validate(source);
+ } catch (SAXException ex) {
+ assertTrue("Scheme " //$NON-NLS-1$
+ + templateFile.toFile().getName()
+ + " is not valid", true); //$NON-NLS-1$
+ }
+ } catch (IOException e) {
+ fail(e.getMessage());
+ }
+ }
}
- } catch (IOException e) {
- fail(e.getMessage());
- }
}
- }
+ return;
}
- return;
- }
- public void testValidationCorrectTemplplates() throws Exception {
+ public void testValidationCorrectTemplplates() throws Exception {
- assertNotNull("Schema is not exist", schema);
- createTemplatesForTesting(PLUGIN_OK_NAME);
+ assertNotNull("Schema is not exist", schema); //$NON-NLS-1$
+ createTemplatesForTesting(PLUGIN_OK_NAME);
- IExtensionRegistry extensionRepository = Platform
- .getExtensionRegistry();
+ IExtensionRegistry extensionRepository = Platform
+ .getExtensionRegistry();
- IExtensionPoint extensionPoint = extensionRepository
- .getExtensionPoint(COM_REDHAT_VPE_TEMPLATES);
- IExtension[] extensions = extensionPoint.getExtensions();
- for (int i = 0; i < extensions.length; i++) {
- if (extensions[i].getNamespaceIdentifier().equals(
- VPE_TEST_EXTENSION)) {
- IConfigurationElement[] elements = extensions[i]
- .getConfigurationElements();
- for (int j = 0; j < elements.length; j++) {
- String pathAttrValue = elements[j].getAttribute("path");
- try {
- IPath templateFile = getFullpathForConfigurationElement(
- pathAttrValue, elements[j]);
+ IExtensionPoint extensionPoint = extensionRepository
+ .getExtensionPoint(COM_REDHAT_VPE_TEMPLATES);
+ IExtension[] extensions = extensionPoint.getExtensions();
+ for (int i = 0; i < extensions.length; i++) {
+ if (extensions[i].getNamespaceIdentifier().equals(
+ VPE_TEST_EXTENSION)) {
+ IConfigurationElement[] elements = extensions[i]
+ .getConfigurationElements();
+ for (int j = 0; j < elements.length; j++) {
+ String pathAttrValue = elements[j].getAttribute("path"); //$NON-NLS-1$
+ try {
+ IPath templateFile = getFullpathForConfigurationElement(
+ pathAttrValue, elements[j]);
- try {
- Validator validator = schema.newValidator();
- Source source = new StreamSource(templateFile
- .toOSString());
- validator.validate(source);
- } catch (SAXException ex) {
- fail("Sheme " + templateFile.toFile().getName()
- + " is not valid : " + ex.getMessage());
+ try {
+ Validator validator = schema.newValidator();
+ Source source = new StreamSource(
+ templateFile.toOSString());
+ validator.validate(source);
+ } catch (SAXException ex) {
+ fail("Sheme " + templateFile.toFile().getName() //$NON-NLS-1$
+ + " is not valid : " + ex.getMessage()); //$NON-NLS-1$
+ }
+ } catch (IOException e) {
+ fail(e.getMessage());
+ }
+ }
}
- } catch (IOException e) {
- fail(e.getMessage());
- }
}
- }
+
+ return;
}
- return;
- }
+ /**
+ * Tests possible template
+ *
+ * @throws Exception
+ */
+ private void createTemplatesForTesting(String pluginXmlFileName)
+ throws Exception {
+ IPath iPath = getFullpathForConfigurationElement(pluginXmlFileName,
+ null);
+ File file = iPath.toFile();
+ FileInputStream is = new FileInputStream(file);
+ IExtensionRegistry registry = RegistryFactory.getRegistry();
+ Object key = ((ExtensionRegistry) registry).getTemporaryUserToken();
+ Bundle bundle = VpeTestPlugin.getDefault().getBundle();
+ IContributor contributor = ContributorFactoryOSGi
+ .createContributor(bundle);
+ registry.addContribution(is, contributor, false, null, null, key);
+ }
- /**
- * Tests possible template
- *
- * @throws Exception
- */
- private void createTemplatesForTesting(String pluginXmlFileName)
- throws Exception {
- IPath iPath = getFullpathForConfigurationElement(pluginXmlFileName,
- null);
- File file = iPath.toFile();
- FileInputStream is = new FileInputStream(file);
- IExtensionRegistry registry = RegistryFactory.getRegistry();
- Object key = ((ExtensionRegistry) registry).getTemporaryUserToken();
- Bundle bundle = VpeTestPlugin.getDefault().getBundle();
- IContributor contributor = ContributorFactoryOSGi
- .createContributor(bundle);
- registry.addContribution(is, contributor, false, null, null, key);
- }
+ /**
+ * Get a full path for IConfigurationElement
+ *
+ * @param fileName
+ * a String contain relevant fileName
+ * @param confElement
+ * a IConfigurationElement
+ * @return full path for IConfigurationElement
+ * @throws IOException
+ * if an error occurs during the conversion
+ */
+ private static IPath getFullpathForConfigurationElement(String name,
+ IConfigurationElement confElement) throws IOException {
+ VpeTestPlugin plugin = VpeTestPlugin.getDefault();
- /**
- * Get a full path for IConfigurationElement
- *
- * @param fileName
- * a String contain relevant fileName
- * @param confElement
- * a IConfigurationElement
- * @return full path for IConfigurationElement
- * @throws IOException
- * if an error occurs during the conversion
- */
- private static IPath getFullpathForConfigurationElement(String name,
- IConfigurationElement confElement) throws IOException {
- VpeTestPlugin plugin = VpeTestPlugin.getDefault();
+ Bundle bundle = null;
- Bundle bundle = null;
+ if (confElement == null) {
+ bundle = plugin.getBundle();
+ } else {
+ bundle = Platform.getBundle(confElement.getNamespaceIdentifier());
+ }
- if (confElement == null) {
- bundle = plugin.getBundle();
- } else {
- bundle = Platform.getBundle(confElement.getNamespaceIdentifier());
+ URL url = bundle.getEntry("/"); //$NON-NLS-1$
+
+ IPath path = new Path(FileLocator.toFileURL(url).getFile());
+ path = path.append(name);
+ return path;
}
- URL url = bundle.getEntry("/");
+ /**
+ * Removing extensions from eclipse
+ *
+ * @param extensionPointId
+ * @param extensionId
+ */
+ private void removeExtension(String extensionPointId, String extensionId) {
+ IExtensionRegistry extensionRepository = Platform
+ .getExtensionRegistry();
- IPath path = new Path(FileLocator.toFileURL(url).getFile());
- path = path.append(name);
- return path;
- }
-
- /**
- * Removing extensions from eclipse
- *
- * @param extensionPointId
- * @param extensionId
- */
- private void removeExtension(String extensionPointId, String extensionId) {
- IExtensionRegistry extensionRepository = Platform
- .getExtensionRegistry();
-
- Object token = ((ExtensionRegistry) extensionRepository).getTemporaryUserToken();
- IExtensionPoint extensionPoint = extensionRepository
- .getExtensionPoint(extensionPointId);
- IExtension[] extensions = extensionPoint.getExtensions();
- for (int i = 0; i < extensions.length; i++) {
- if (extensions[i].getNamespaceIdentifier().equals(extensionId))
- extensionRepository.removeExtension(extensions[i], token);
+ Object token = ((ExtensionRegistry) extensionRepository)
+ .getTemporaryUserToken();
+ IExtensionPoint extensionPoint = extensionRepository
+ .getExtensionPoint(extensionPointId);
+ IExtension[] extensions = extensionPoint.getExtensions();
+ for (int i = 0; i < extensions.length; i++) {
+ if (extensions[i].getNamespaceIdentifier().equals(extensionId))
+ extensionRepository.removeExtension(extensions[i], token);
+ }
}
- }
- @Override
- protected void tearDown() throws Exception {
- removeExtension(COM_REDHAT_VPE_TEMPLATES, VPE_TEST_EXTENSION);
- super.tearDown();
- }
+ @Override
+ protected void tearDown() throws Exception {
+ removeExtension(COM_REDHAT_VPE_TEMPLATES, VPE_TEST_EXTENSION);
+ super.tearDown();
+ }
}
15 years, 4 months
JBoss Tools SVN: r24456 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui/views and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: jjohnstn
Date: 2010-08-25 18:05:33 -0400 (Wed, 25 Aug 2010)
New Revision: 24456
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceView.java
Log:
2010-08-25 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java (.menuAboutToShow): New
listener to properly set up pull-down menu.
(contributeToActionBars): Add a menu listener for pull down so we can set enabled/disabled
at pull-down time.
(fillLocalPullDown): Add check for item selected.
* src/org/jboss/tools/deltacloud/ui/views/InstanceView.java (.run): Experiment with RSE.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-08-25 20:45:41 UTC (rev 24455)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-08-25 22:05:33 UTC (rev 24456)
@@ -1,3 +1,12 @@
+2010-08-25 Jeff Johnston <jjohnstn(a)redhat.com>
+
+ * src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java (.menuAboutToShow): New
+ listener to properly set up pull-down menu.
+ (contributeToActionBars): Add a menu listener for pull down so we can set enabled/disabled
+ at pull-down time.
+ (fillLocalPullDown): Add check for item selected.
+ * src/org/jboss/tools/deltacloud/ui/views/InstanceView.java (.run): Experiment with RSE.
+
2010-08-23 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java: New file.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-08-25 20:45:41 UTC (rev 24455)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-08-25 22:05:33 UTC (rev 24456)
@@ -116,7 +116,13 @@
private void contributeToActionBars() {
IActionBars bars = getViewSite().getActionBars();
- fillLocalPullDown(bars.getMenuManager());
+ IMenuManager menuMgr = bars.getMenuManager();
+ menuMgr.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ DeltaCloudView.this.fillLocalPullDown(manager);
+ }
+ });
+ fillLocalPullDown(menuMgr);
fillLocalToolBar(bars.getToolBarManager());
}
@@ -126,6 +132,7 @@
}
private void fillLocalPullDown(IMenuManager manager) {
+ manager.removeAll();
manager.add(removeCloud);
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
CloudViewElement element = (CloudViewElement)selection.getFirstElement();
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceView.java 2010-08-25 20:45:41 UTC (rev 24455)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceView.java 2010-08-25 22:05:33 UTC (rev 24456)
@@ -27,6 +27,7 @@
import org.eclipse.rse.core.IRSECoreRegistry;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.RSECorePlugin;
+import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.model.SystemStartHere;
import org.eclipse.swt.SWT;
@@ -480,7 +481,8 @@
}
String connectionName = instance.getName() + " [" + instance.getId() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
try {
- registry.createHost(sshType, connectionName, hostname, null);
+ @SuppressWarnings("unused")
+ IHost host = registry.createHost(sshType, connectionName, hostname, null);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
15 years, 4 months
JBoss Tools SVN: r24455 - in trunk/documentation/whatsnew: maven and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-08-25 16:45:41 -0400 (Wed, 25 Aug 2010)
New Revision: 24455
Added:
trunk/documentation/whatsnew/images/cdihibernate.png
trunk/documentation/whatsnew/maven/maven-news-3.2.0.M2.html
Log:
https://jira.jboss.org/browse/JBIDE-6886 Create "New and Noteworthy" for 3.2.0.M2
Added: trunk/documentation/whatsnew/images/cdihibernate.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/images/cdihibernate.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/maven/maven-news-3.2.0.M2.html
===================================================================
--- trunk/documentation/whatsnew/maven/maven-news-3.2.0.M2.html (rev 0)
+++ trunk/documentation/whatsnew/maven/maven-news-3.2.0.M2.html 2010-08-25 20:45:41 UTC (rev 24455)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Language" content="en-us" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<link rel="stylesheet" href="../whatsnew.css" />
+<title>What's New in Maven Tools</title>
+</head>
+<body>
+<h1>Maven Tools</h1>
+
+<p align="right"><a href="../index.html">< Main Index</a> <a
+ href="../portlet/portlet-news-1.1.0.CR2.html">Portlet Tools ></a></p>
+<table border="0" cellpadding="10" cellspacing="0" width="80%">
+ <tr>
+ <td colspan="2">
+ <hr />
+ <h3>Maven Integration</h3>
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left"><a name="itemname1" id="itemname1"></a><b>JBoss CDI and Hibernate Maven Configurators</b></td>
+ <td valign="top">
+ <p><img src="../images/cdihibernate.png"/></p>
+ <p><small>
+ See <a href="https://jira.jboss.org/jira/browse/JBIDE-6412">JBIDE-6412</a>
+ and
+ <a href="https://jira.jboss.org/jira/browse/JBIDE-6487">JBIDE-6487</a>
+ </small></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+</table>
+
+</body>
+
+</html>
+
+
15 years, 4 months
JBoss Tools SVN: r24454 - in branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-08-25 16:11:10 -0400 (Wed, 25 Aug 2010)
New Revision: 24454
Modified:
branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/META-INF/MANIFEST.MF
branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/plugin.xml
branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/Activator.java
branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeLocator.java
branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java
branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/preferences/RuntimePreferencePage.java
Log:
https://jira.jboss.org/browse/JBDS-1289 EAP 5.1 cannot be added as a runtime during JBDS installation
Modified: branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/META-INF/MANIFEST.MF 2010-08-25 20:05:20 UTC (rev 24453)
+++ branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/META-INF/MANIFEST.MF 2010-08-25 20:11:10 UTC (rev 24454)
@@ -12,6 +12,7 @@
org.eclipse.ui,
org.eclipse.wst.server.core,
org.eclipse.ui.navigator,
+ org.eclipse.debug.core,
org.eclipse.jdt.launching,
org.eclipse.ui.workbench,
org.eclipse.datatools.connectivity;visibility:=reexport,
Modified: branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/plugin.xml
===================================================================
--- branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/plugin.xml 2010-08-25 20:05:20 UTC (rev 24453)
+++ branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/plugin.xml 2010-08-25 20:11:10 UTC (rev 24454)
@@ -22,7 +22,45 @@
id="org.jboss.tools.runtime.preferences.RuntimePreferencePage"
name="%JBoss_Runtimes"/>
</extension>
-
+
+ <extension
+ point="org.eclipse.ui.preferenceTransfer">
+ <transfer
+ id="org.jboss.tools.runtime.jbossruntime"
+ icon="$nl$/icons/jboss.gif"
+ name="JBoss Runtimes">
+ <mapping
+ scope="instance">
+ <entry
+ node="org.drools.eclipse">
+ <key name="Drools.Runtimes"></key>
+ </entry>
+ <entry
+ node="org.eclipse.wst.server.core">
+ <key name="runtimes"></key>
+ </entry>
+ <entry
+ node="org.jboss.tools.seam.core">
+ <key name="org.jboss.tools.seam.core.runtime.list"></key>
+ </entry>
+ <entry
+ node="org.jboss.tools.jbpm.common">
+ <key name="jbpm-name"></key>
+ </entry>
+ <entry
+ node="org.jboss.tools.runtime">
+ <key name="servers"></key>
+ <key name="jbpms"></key>
+ </entry>
+ <entry
+ node="org.jboss.ide.eclipse.as.ui">
+ </entry>
+ </mapping>
+ <description>
+ Export JBoss Runtimes
+ </description>
+ </transfer>
+ </extension>
<!--
<extension
point="org.eclipse.wst.server.core.runtimeLocators">
Modified: branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/Activator.java
===================================================================
--- branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/Activator.java 2010-08-25 20:05:20 UTC (rev 24453)
+++ branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/Activator.java 2010-08-25 20:11:10 UTC (rev 24454)
@@ -15,6 +15,12 @@
public static final String FIRST_START = "firstStart"; //$NON-NLS-1$
+ public static final String SERVERS = "servers";
+
+ public static final String JBPMS = "jbpms";
+
+ public static final String WORKSPACES = "workspaces";
+
// The shared instance
private static Activator plugin;
Modified: branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeLocator.java
===================================================================
--- branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeLocator.java 2010-08-25 20:05:20 UTC (rev 24453)
+++ branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeLocator.java 2010-08-25 20:11:10 UTC (rev 24454)
@@ -11,8 +11,12 @@
package org.jboss.tools.runtime;
import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -24,6 +28,12 @@
public class JBossRuntimeLocator extends RuntimeLocatorDelegate {
+ public static final String JBPM3 = "jBPM3";
+
+ public static final String JBPM4 = "jBPM4";
+ private final static String seamJarName = "jboss-seam.jar";
+ private final static String seamVersionAttributeName = "Seam-Version";
+
public JBossRuntimeLocator() {
}
@@ -50,6 +60,41 @@
if (!ServerType.UNKNOWN.equals(serverBean.getType())) {
serverDefinitions.add(new ServerDefinition(serverBean));
} else {
+ String seamVersion = getSeamVersionFromManifest(root.getAbsolutePath());
+ if (seamVersion != null) {
+ serverDefinitions.add(new ServerDefinition(root.getName(), seamVersion, JBossRuntimeStartup.SEAM, root.getAbsoluteFile()));
+ } else {
+ String[] files = root.list(new FilenameFilter() {
+
+ public boolean accept(File dir, String name) {
+ if (name.startsWith("drools-api") && name.endsWith(".jar") ) {
+ return true;
+ }
+ return false;
+ }
+ });
+ boolean droolsFound = false;
+ if (files.length > 0) {
+ String version = getImplementationVersion(root,files[0]);
+ if (version != null) {
+ version = version.substring(0,3);
+ serverDefinitions.add(new ServerDefinition(root.getName(), version, JBossRuntimeStartup.DROOLS, root.getAbsoluteFile()));
+ droolsFound = true;
+ }
+ }
+ if (!droolsFound) {
+ boolean isJBPM = isValidJbpmInstallation(root.getAbsolutePath());
+ if (isJBPM) {
+ String version = "unknown";
+ if (isJbpm3(root.getAbsolutePath())) {
+ version = JBPM3;
+ } else if (isJbpm4(root.getAbsolutePath())) {
+ version = JBPM4;
+ }
+ serverDefinitions.add(new ServerDefinition(root.getName(), version, JBossRuntimeStartup.JBPM, root.getAbsoluteFile()));
+ }
+ }
+ }
children = root.listFiles();
}
} else {
@@ -67,6 +112,55 @@
}
}
monitor.done();
+ }
+
+ /**
+ * @param dir
+ * @param string
+ * @return
+ */
+ private String getImplementationVersion(File dir, String file) {
+ File jarFile = new File(dir, file);
+ if(!jarFile.isFile()) {
+ return null;
+ }
+ try {
+ JarFile jar = new JarFile(jarFile);
+ Attributes attributes = jar.getManifest().getMainAttributes();
+ String version = attributes.getValue("Implementation-Version");
+ return version;
+ } catch (IOException e) {
+ return null;
+ }
}
+ public static String getSeamVersionFromManifest(String seamHome) {
+ File jarFile = new File(seamHome, "lib/" + seamJarName);
+ if(!jarFile.isFile()) {
+ jarFile = new File(seamHome, seamJarName);
+ if(!jarFile.isFile()) {
+ return null;
+ }
+ }
+ try {
+ JarFile jar = new JarFile(jarFile);
+ Attributes attributes = jar.getManifest().getMainAttributes();
+ String version = attributes.getValue(seamVersionAttributeName);
+ return version;
+ } catch (IOException e) {
+ return null;
+ }
+ }
+
+ public static boolean isJbpm3(String location) {
+ return new Path(location).append("/src/resources/gpd/version.info.xml").toFile().exists();
+ }
+
+ public static boolean isJbpm4(String location) {
+ return new Path(location).append("/jbpm.jar").toFile().exists();
+ }
+
+ private boolean isValidJbpmInstallation(String location) {
+ return isJbpm3(location) || isJbpm4(location);
+ }
}
Modified: branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java
===================================================================
--- branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java 2010-08-25 20:05:20 UTC (rev 24453)
+++ branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java 2010-08-25 20:11:10 UTC (rev 24454)
@@ -7,6 +7,7 @@
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
@@ -16,6 +17,8 @@
import org.drools.eclipse.util.DroolsRuntime;
import org.drools.eclipse.util.DroolsRuntimeManager;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -26,6 +29,7 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.preferences.ConfigurationScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.datatools.connectivity.ConnectionProfileConstants;
@@ -57,6 +61,7 @@
import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
import org.jboss.ide.eclipse.as.core.util.JBossServerType;
import org.jboss.ide.eclipse.as.core.util.ServerBeanLoader;
+import org.jboss.tools.jbpm.preferences.JbpmInstallation;
import org.jboss.tools.jbpm.preferences.PreferencesManager;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamUtil;
@@ -64,9 +69,15 @@
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.core.project.facet.SeamVersion;
import org.osgi.framework.Bundle;
+import org.osgi.service.prefs.BackingStoreException;
public class JBossRuntimeStartup implements IStartup {
+ /**
+ *
+ */
+ private static final String DEFAULT_DS = "DefaultDS";
+
private static final String RUNTIME = Messages.JBossRuntimeStartup_Runtime;
private static final String EAP = "EAP"; //$NON-NLS-1$
@@ -78,6 +89,10 @@
private static final String EPP = "EPP"; //$NON-NLS-1$
private static final String EWP = "EWP"; //$NON-NLS-1$
+
+ public static final String SEAM = "SEAM"; // NON-NLS-1$
+
+ public static final String DROOLS = "DROOLS"; // NON-NLS-1$
public static final String JBOSS_EAP_HOME = "../../../../jboss-eap/jboss-as"; // JBoss AS home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
@@ -102,11 +117,7 @@
public static final String SEAM_2_0_HOME_CONFIGURATION_CP = "../../jboss-eap/seam2"; //$NON-NLS-1$
public static final String[] SEAM_HOME_FOLDER_OPTIONS = {"seam","seam1","seam2","seamfp"};
-
-
- private static final String JBPM_VERSION="jBPM3"; //$NON-NLS-1$
-
// This constants are made to avoid dependency with org.jboss.ide.eclipse.as.core plugin
public static final String JBOSS_AS_RUNTIME_TYPE_ID[] = {
"org.jboss.ide.eclipse.as.runtime.32", //$NON-NLS-1$
@@ -177,22 +188,79 @@
= "org.eclipse.datatools.connectivity.db.URL"; //$NON-NLS-1$
private static final String HSQL_PROFILE_ID = "org.eclipse.datatools.enablement.hsqldb.connectionProfile";
+
+ public static final String JBPM = "JBPM";
private List<ServerDefinition> serverDefinitions = new ArrayList<ServerDefinition>();
+
+ private IEclipsePreferences preferences;
public void earlyStartup() {
if (!isJBDS()) {
return;
}
- boolean firstStart = Activator.getDefault().getPreferenceStore().getBoolean(Activator.FIRST_START);
- if (!firstStart) {
+ if (!willBeInitialized()) {
return;
}
- Activator.getDefault().getPreferenceStore().setValue(Activator.FIRST_START, false);
parseServerFile();
initializeRuntimes(serverDefinitions);
+ saveWorkspacePreferences();
}
+ private void saveWorkspacePreferences() {
+ String workspaces = getWorkspaces();
+ String newWorkspaces = "";
+ if (workspaces == null || workspaces.trim().length() == 0) {
+ newWorkspaces = getWorkspace();
+ } else {
+ newWorkspaces = workspaces + "," + getWorkspace();
+ }
+ IEclipsePreferences prefs = getPreferences();
+ prefs.put(Activator.WORKSPACES, newWorkspaces);
+ try {
+ prefs.flush();
+ } catch (BackingStoreException e) {
+ Activator.log(e);
+ }
+ }
+
+ /**
+ * @return
+ */
+ private boolean willBeInitialized() {
+ String workspaces = getWorkspaces();
+ if (workspaces == null || workspaces.trim().length() == 0) {
+ return true;
+ }
+ StringTokenizer tokenizer = new StringTokenizer(workspaces, ",");
+ while (tokenizer.hasMoreTokens()) {
+ String workspace = tokenizer.nextToken();
+ if (workspace.equals(getWorkspace())) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private String getWorkspaces() {
+ IEclipsePreferences prefs = getPreferences();
+ String workspaces = prefs.get(Activator.WORKSPACES, "");
+ return workspaces;
+ }
+
+ private String getWorkspace() {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IPath workspacePath = root.getLocation();
+ return workspacePath.toOSString();
+ }
+
+ private IEclipsePreferences getPreferences() {
+ if (preferences == null) {
+ preferences = new ConfigurationScope().getNode(Activator.PLUGIN_ID);
+ }
+ return preferences;
+ }
+
private boolean isJBDS() {
Bundle jbdsProduct = Platform.getBundle("com.jboss.jbds.product");
return jbdsProduct != null;
@@ -236,11 +304,7 @@
}
public void initializeSeam(List<ServerDefinition> serverDefinitions) {
- IEclipsePreferences node = (IEclipsePreferences)
- Platform.getPreferencesService()
- .getRootNode()
- .node(InstanceScope.SCOPE)
- .node(SeamCorePlugin.PLUGIN_ID);
+
Map<String, SeamRuntime> map = new HashMap<String,SeamRuntime>();
// to fix https://jira.jboss.org/jira/browse/JBDS-682
@@ -326,17 +390,33 @@
}
private void addSeam(Map<String, SeamRuntime> map, String seamPath,SeamVersion seamVersion, String name) {
- File seamFolder = new File(seamPath);
- if(seamFolder.exists() && seamFolder.isDirectory()) {
- SeamRuntime rt = new SeamRuntime();
- rt.setHomeDir(seamPath);
- rt.setName(name);
- rt.setDefault(true);
- rt.setVersion(seamVersion);
- SeamRuntimeManager.getInstance().addRuntime(rt);
+ if (!seamExists(seamPath)) {
+ File seamFolder = new File(seamPath);
+ if(seamFolder.exists() && seamFolder.isDirectory()) {
+ SeamRuntime rt = new SeamRuntime();
+ rt.setHomeDir(seamPath);
+ rt.setName(name);
+ rt.setDefault(true);
+ rt.setVersion(seamVersion);
+ SeamRuntimeManager.getInstance().addRuntime(rt);
+ }
}
}
+ /**
+ * @param seamPath
+ * @return
+ */
+ private boolean seamExists(String seamPath) {
+ SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance().getRuntimes();
+ for (SeamRuntime sr:seamRuntimes) {
+ if (seamPath != null && seamPath.equals(sr.getHomeDir())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
private String getSeamGenBuildPath(String seamHomePath,
String seamHomePathConfiguration) {
try {
@@ -409,7 +489,10 @@
index = 6;
} else if ("5.0".equals(version)) { //$NON-NLS-1$
index = 7;
- }
+ } else if ("5.1".equals(version)) { //$NON-NLS-1$
+ // FIXME - this needs to be changed when adding a new runtime type for JBoss EAP 5.1
+ index = 7;
+ }
}
return index;
}
@@ -581,14 +664,20 @@
* @throws CoreException
*/
private static IServerWorkingCopy createServer(IProgressMonitor progressMonitor, IRuntime runtime, int index, String name) throws CoreException {
+ if (name == null) {
+ name = JBOSS_AS_NAME[index];
+ }
+ IServer[] servers = ServerCore.getServers();
+ for (IServer server:servers) {
+ if (name.equals(server.getName()) ) {
+ return null;
+ }
+ }
IServerType serverType = ServerCore.findServerType(JBOSS_AS_TYPE_ID[index]);
IServerWorkingCopy server = serverType.createServer(null, null, runtime, progressMonitor);
server.setHost(JBOSS_AS_HOST);
- if(name != null)
- server.setName(name);
- else
- server.setName(JBOSS_AS_NAME[index]);
+ server.setName(name);
// JBossServer.DEPLOY_DIRECTORY
String deployVal = runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("deploy").toOSString(); //$NON-NLS-1$ //$NON-NLS-2$
@@ -606,8 +695,6 @@
return server;
}
- private static boolean driverIsCreated = false;
-
/**
* Creates HSQL DB Driver
* @param jbossASLocation location of JBoss AS
@@ -616,7 +703,7 @@
* @return driver instance
*/
private static void createDriver(String jbossASLocation, int index) throws ConnectionProfileException {
- if(driverIsCreated) {
+ if(ProfileManager.getInstance().getProfileByName(DEFAULT_DS) != null) {
// Don't create the driver a few times
return;
}
@@ -656,7 +743,7 @@
}
driver = DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
- if (driver != null && ProfileManager.getInstance().getProfileByName("DefaultDS") == null) { //$NON-NLS-1$
+ if (driver != null && ProfileManager.getInstance().getProfileByName(DEFAULT_DS) == null) { //$NON-NLS-1$
// create profile
Properties props = new Properties();
props.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, HSQL_DRIVER_DEFINITION_ID);
@@ -670,26 +757,30 @@
props.setProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID));
props.setProperty(IDBDriverDefinitionConstants.URL_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.URL_PROP_ID));
- ProfileManager.getInstance().createProfile("DefaultDS", Messages.JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database, HSQL_PROFILE_ID, props, "", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ ProfileManager.getInstance().createProfile(DEFAULT_DS, Messages.JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database, HSQL_PROFILE_ID, props, "", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- if(driver!=null) {
- driverIsCreated = true;
- }
+
}
public void initializeDroolsRuntime(List<ServerDefinition> serverDefinitions) {
List<DroolsRuntime> droolsRuntimes = new ArrayList<DroolsRuntime>();
for (ServerDefinition serverDefinition : serverDefinitions) {
String type = serverDefinition.getType();
- if (SOA_P.equals(type)) {
- File droolsRoot = serverDefinition.getLocation(); //$NON-NLS-1$
- if (droolsRoot.isDirectory()) {
- DroolsRuntime runtime = new DroolsRuntime();
- runtime.setName("Drools - " + serverDefinition.getName()); //$NON-NLS-1$
- runtime.setPath(droolsRoot.getAbsolutePath());
- DroolsRuntimeManager.recognizeJars(runtime);
- runtime.setDefault(true);
- droolsRuntimes.add(runtime);
+ if (!droolsExists(serverDefinition)) {
+ if (SOA_P.equals(type) || DROOLS.equals(type)) {
+ File droolsRoot = serverDefinition.getLocation(); //$NON-NLS-1$
+ if (droolsRoot.isDirectory()) {
+ DroolsRuntime runtime = new DroolsRuntime();
+ if (SOA_P.equals(type)) {
+ runtime.setName("Drools - " + serverDefinition.getName()); //$NON-NLS-1$
+ } else {
+ runtime.setName("Drools " + serverDefinition.getVersion()+ " - " + serverDefinition.getName()); //$NON-NLS-1$
+ }
+ runtime.setPath(droolsRoot.getAbsolutePath());
+ DroolsRuntimeManager.recognizeJars(runtime);
+ runtime.setDefault(true);
+ droolsRuntimes.add(runtime);
+ }
}
}
}
@@ -700,17 +791,56 @@
}
+ /**
+ * @param serverDefinition
+ * @return
+ */
+ private boolean droolsExists(ServerDefinition serverDefinition) {
+ DroolsRuntime[] droolsRuntimes = DroolsRuntimeManager.getDroolsRuntimes();
+ for (DroolsRuntime dr:droolsRuntimes) {
+ String location = dr.getPath();
+ if (location != null && location.equals(serverDefinition.getLocation().getAbsolutePath())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
public void initializeJbpmRuntime(List<ServerDefinition> serverDefinitions) {
for (ServerDefinition serverDefinition : serverDefinitions) {
- String type = serverDefinition.getType();
- if (SOA_P.equals(type)) {
- File jbpmRoot = new File(serverDefinition.getLocation(),"jbpm-jpdl"); //$NON-NLS-1$
- if (jbpmRoot.isDirectory()) {
- PreferencesManager.getInstance().initializeDefaultJbpmInstallation(serverDefinition.getName(), jbpmRoot.getAbsolutePath(), JBPM_VERSION);
+ if (!jbpmExists(serverDefinition)) {
+ String type = serverDefinition.getType();
+ if (SOA_P.equals(type)) {
+ File jbpmRoot = new File(serverDefinition.getLocation(),"jbpm-jpdl"); //$NON-NLS-1$
+ if (jbpmRoot.isDirectory()) {
+ String version = JBossRuntimeLocator.JBPM3;
+ if (JBossRuntimeLocator.isJbpm4(serverDefinition.getLocation().getAbsolutePath())) {
+ version = JBossRuntimeLocator.JBPM4;
+ }
+ PreferencesManager.getInstance().initializeDefaultJbpmInstallation(serverDefinition.getName(), jbpmRoot.getAbsolutePath(), version);
+ }
+ } else if (JBPM.equals(type)) {
+ PreferencesManager.getInstance().addJbpmInstallation(serverDefinition.getName(), serverDefinition.getLocation().getAbsolutePath(), serverDefinition.getVersion());
}
}
}
}
+ /**
+ * @param serverDefinition
+ * @return
+ */
+ private boolean jbpmExists(ServerDefinition serverDefinition) {
+ Map<String, JbpmInstallation> jbpmMap = PreferencesManager.getInstance().getJbpmInstallationMap();
+ Collection<JbpmInstallation> jbpmInstalations = jbpmMap.values();
+ for (JbpmInstallation jbpm:jbpmInstalations) {
+ String location = jbpm.location;
+ if (location != null && location.equals(serverDefinition.getLocation().getAbsolutePath())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
}
\ No newline at end of file
Modified: branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/preferences/RuntimePreferencePage.java
===================================================================
--- branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/preferences/RuntimePreferencePage.java 2010-08-25 20:05:20 UTC (rev 24453)
+++ branches/jbosstools-3.2.0.M2/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/preferences/RuntimePreferencePage.java 2010-08-25 20:11:10 UTC (rev 24454)
@@ -10,8 +10,17 @@
************************************************************************************/
package org.jboss.tools.runtime.preferences;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -20,6 +29,9 @@
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -34,7 +46,17 @@
import org.eclipse.swt.widgets.Link;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.ui.internal.wizards.preferences.PreferencesExportWizard;
+import org.eclipse.ui.internal.wizards.preferences.PreferencesImportWizard;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.internal.IMemento;
+import org.eclipse.wst.server.core.internal.Server;
+import org.eclipse.wst.server.core.internal.ServerPlugin;
+import org.eclipse.wst.server.core.internal.XMLMemento;
+import org.jboss.tools.jbpm.preferences.JbpmInstallation;
+import org.jboss.tools.jbpm.preferences.PreferencesManager;
import org.jboss.tools.runtime.Activator;
import org.jboss.tools.runtime.JBossRuntimeLocator;
@@ -45,12 +67,15 @@
public class RuntimePreferencePage extends PreferencePage implements
IWorkbenchPreferencePage {
+ private static final String SERVER_DATA_FILE = "servers.xml";
+
private static final String LASTPATH = "lastPath";
public static final String SEAM_PREFERENCES_ID = "org.jboss.tools.common.model.ui.seam"; //$NON-NLS-1$
public static final String WTP_PREFERENCES_ID = "org.eclipse.wst.server.ui.runtime.preferencePage"; //$NON-NLS-1$
private static final String DROOLS_PREFERENCES_ID = "org.drools.eclipse.preferences.DroolsRuntimesPreferencePage";
private static final String JBPM_PREFERENCES_ID = "org.jboss.tools.jbpm.locations";
+ protected Map<String, Object> map = new HashMap<String, Object>();
/*
* (non-Javadoc)
@@ -67,10 +92,6 @@
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(1, false);
- //layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- //layout.marginWidth= 0;
- //layout.verticalSpacing= convertVerticalDLUsToPixels(10);
- //layout.horizontalSpacing= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
composite.setLayout(layout);
createLink(composite, "See <a>WTP Runtime</a>", WTP_PREFERENCES_ID);
@@ -125,13 +146,117 @@
}
private void exportRuntimes() {
- // TODO Auto-generated method stub
+ exportServers();
+ exportJbpms();
+ PreferencesExportWizard wizard = new PreferencesExportWizard();
+ wizard.init(PlatformUI.getWorkbench(), new StructuredSelection());
+ WizardDialog dialog = new WizardDialog(getShell(), wizard);
+ dialog.create();
+ dialog.open();
}
+ private void exportJbpms() {
+ File file = org.jboss.tools.jbpm.Activator.getDefault().getStateLocation().append("jbpm-installations.xml").toFile();
+ if (!file.exists()) {
+ Activator.getDefault().getPreferenceStore().setValue(Activator.JBPMS, "");
+ return;
+ }
+ try {
+ XMLMemento memento = (XMLMemento) XMLMemento.loadMemento(file.getAbsolutePath());
+ String xmlString = memento.saveToString();
+ Activator.getDefault().getPreferenceStore().setValue(Activator.JBPMS, xmlString);
+ Activator.getDefault().savePluginPreferences();
+ } catch (Exception e) {
+ Activator.log (e);
+ }
+ }
+
+ private void exportServers() {
+ String filename = ServerPlugin.getInstance().getStateLocation().append(SERVER_DATA_FILE).toOSString();
+ if ( !(new File(filename).exists()) ) {
+ Activator.getDefault().getPreferenceStore().setValue(Activator.SERVERS, "");
+ return;
+ }
+ try {
+ XMLMemento memento = (XMLMemento) XMLMemento.loadMemento(filename);
+ String xmlString = memento.saveToString();
+ Activator.getDefault().getPreferenceStore().setValue(Activator.SERVERS, xmlString);
+ Activator.getDefault().savePluginPreferences();
+ } catch (Exception e) {
+ Activator.log (e);
+ }
+ }
+
private void importRuntimes() {
- // TODO Auto-generated method stub
+ PreferencesImportWizard wizard = new PreferencesImportWizard();
+ wizard.init(PlatformUI.getWorkbench(), new StructuredSelection());
+ WizardDialog dialog = new WizardDialog(getShell(), wizard);
+ dialog.create();
+ int ok = dialog.open();
+ if (ok == Window.OK) {
+ String jbpms = Activator.getDefault().getPreferenceStore().getString(Activator.JBPMS);
+ if (jbpms != null && jbpms.trim().length() > 0) {
+ loadJBPMInstalations(jbpms);
+ }
+ String servers = Activator.getDefault().getPreferenceStore().getString(Activator.SERVERS);
+ if (servers != null && servers.trim().length() > 0) {
+ loadServerInstalations(servers);
+ }
+ }
}
+ /**
+ * @param servers
+ */
+ private void loadServerInstalations(String servers) {
+ InputStream in = null;
+ try {
+ in = new ByteArrayInputStream(servers.getBytes("UTF-8"));
+ IMemento memento = XMLMemento.loadMemento(in);
+
+ IMemento[] children = memento.getChildren("server");
+ int size = children.length;
+
+ for (int i = 0; i < size; i++) {
+ ServerEx server = new ServerEx(null);
+ server.loadFromMemento(children[i], null);
+ IServerWorkingCopy wc = server.createWorkingCopy();
+ wc.save(false, null);
+ }
+ } catch (Exception e) {
+ Activator.log(e);
+ }
+ }
+
+ /**
+ * @param jbpms
+ */
+ private void loadJBPMInstalations(String jbpms) {
+ InputStream in = null;
+ try {
+ in = new ByteArrayInputStream(jbpms.getBytes("UTF-8"));
+ IMemento memento = XMLMemento.loadMemento(in);
+ IMemento[] children = memento.getChildren("installation");
+ for (int i = 0; i < children.length; i++) {
+ JbpmInstallation installation = new JbpmInstallation();
+ installation.name = children[i].getString("name");
+ installation.location = children[i].getString("location");
+ installation.version = children[i].getString("version");
+ PreferencesManager.getInstance().getJbpmInstallationMap()
+ .put(installation.name, installation);
+ }
+ } catch (Exception e) {
+ Activator.log(e);
+ } finally {
+ try {
+ if (in != null) {
+ in.close();
+ }
+ } catch (IOException e) {
+ }
+ }
+ }
+
private Button createButton(Composite parent, String labelText, String buttonText) {
GridLayout layout;
Composite composite = new Composite(parent,SWT.NONE);
@@ -156,10 +281,10 @@
}
private void createLink(Composite composite, String text, final String preferencesId) {
- Link wtpRuntime = new Link(composite, SWT.NONE);
- wtpRuntime.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
- wtpRuntime.setText(text);
- wtpRuntime.addSelectionListener(new SelectionAdapter() {
+ Link link = new Link(composite, SWT.NONE);
+ link.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
+ link.setText(text);
+ link.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(),preferencesId, new String[] {preferencesId},null);
if (dialog != null) {
@@ -217,5 +342,20 @@
((GridData)gd).horizontalAlignment = GridData.FILL;
}
}
+
+ private static class ServerEx extends Server {
+ /**
+ * @param file
+ */
+ public ServerEx(IFile file) {
+ super(file);
+ }
+
+ @Override
+ public void loadFromMemento(IMemento memento, IProgressMonitor monitor) {
+ super.loadFromMemento(memento, monitor);
+ }
+
+ }
}
15 years, 4 months
JBoss Tools SVN: r24453 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-08-25 16:05:20 -0400 (Wed, 25 Aug 2010)
New Revision: 24453
Modified:
trunk/build/target-platform/e36-wtp32.target
Log:
add GWT req to target platform
Modified: trunk/build/target-platform/e36-wtp32.target
===================================================================
--- trunk/build/target-platform/e36-wtp32.target 2010-08-25 20:04:59 UTC (rev 24452)
+++ trunk/build/target-platform/e36-wtp32.target 2010-08-25 20:05:20 UTC (rev 24453)
@@ -167,6 +167,10 @@
<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
<repository location="http://download.jboss.org/jbosstools/builds/nightly/3.2.helios/jbosstools..."/>
</location>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="com.google.gdt.eclipse.suite.e36.feature.feature.group" version="1.3.3.v201006111317"/>
+<repository location="http://dl.google.com/eclipse/plugin/3.6/"/>
+</location>
</locations>
<includeBundles>
<feature id="org.drools.eclipse.feature" />
15 years, 4 months
JBoss Tools SVN: r24452 - in trunk/runtime/plugins/org.jboss.tools.runtime: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-08-25 16:04:59 -0400 (Wed, 25 Aug 2010)
New Revision: 24452
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime/META-INF/MANIFEST.MF
trunk/runtime/plugins/org.jboss.tools.runtime/plugin.xml
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/Activator.java
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeLocator.java
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/preferences/RuntimePreferencePage.java
Log:
https://jira.jboss.org/browse/JBDS-1289 EAP 5.1 cannot be added as a runtime during JBDS installation
Modified: trunk/runtime/plugins/org.jboss.tools.runtime/META-INF/MANIFEST.MF
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/META-INF/MANIFEST.MF 2010-08-25 20:00:29 UTC (rev 24451)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/META-INF/MANIFEST.MF 2010-08-25 20:04:59 UTC (rev 24452)
@@ -8,10 +8,11 @@
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources,
org.jboss.tools.seam.core,
- org.drools.eclipse,
+ org.drools.eclipse;resolution:=optional,
org.eclipse.ui,
org.eclipse.wst.server.core,
org.eclipse.ui.navigator,
+ org.eclipse.debug.core,
org.eclipse.jdt.launching,
org.eclipse.ui.workbench,
org.eclipse.datatools.connectivity;visibility:=reexport,
Modified: trunk/runtime/plugins/org.jboss.tools.runtime/plugin.xml
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/plugin.xml 2010-08-25 20:00:29 UTC (rev 24451)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/plugin.xml 2010-08-25 20:04:59 UTC (rev 24452)
@@ -22,7 +22,45 @@
id="org.jboss.tools.runtime.preferences.RuntimePreferencePage"
name="%JBoss_Runtimes"/>
</extension>
-
+
+ <extension
+ point="org.eclipse.ui.preferenceTransfer">
+ <transfer
+ id="org.jboss.tools.runtime.jbossruntime"
+ icon="$nl$/icons/jboss.gif"
+ name="JBoss Runtimes">
+ <mapping
+ scope="instance">
+ <entry
+ node="org.drools.eclipse">
+ <key name="Drools.Runtimes"></key>
+ </entry>
+ <entry
+ node="org.eclipse.wst.server.core">
+ <key name="runtimes"></key>
+ </entry>
+ <entry
+ node="org.jboss.tools.seam.core">
+ <key name="org.jboss.tools.seam.core.runtime.list"></key>
+ </entry>
+ <entry
+ node="org.jboss.tools.jbpm.common">
+ <key name="jbpm-name"></key>
+ </entry>
+ <entry
+ node="org.jboss.tools.runtime">
+ <key name="servers"></key>
+ <key name="jbpms"></key>
+ </entry>
+ <entry
+ node="org.jboss.ide.eclipse.as.ui">
+ </entry>
+ </mapping>
+ <description>
+ Export JBoss Runtimes
+ </description>
+ </transfer>
+ </extension>
<!--
<extension
point="org.eclipse.wst.server.core.runtimeLocators">
Modified: trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/Activator.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/Activator.java 2010-08-25 20:00:29 UTC (rev 24451)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/Activator.java 2010-08-25 20:04:59 UTC (rev 24452)
@@ -15,6 +15,12 @@
public static final String FIRST_START = "firstStart"; //$NON-NLS-1$
+ public static final String SERVERS = "servers";
+
+ public static final String JBPMS = "jbpms";
+
+ public static final String WORKSPACES = "workspaces";
+
// The shared instance
private static Activator plugin;
Modified: trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeLocator.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeLocator.java 2010-08-25 20:00:29 UTC (rev 24451)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeLocator.java 2010-08-25 20:04:59 UTC (rev 24452)
@@ -11,8 +11,12 @@
package org.jboss.tools.runtime;
import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -24,6 +28,12 @@
public class JBossRuntimeLocator extends RuntimeLocatorDelegate {
+ public static final String JBPM3 = "jBPM3";
+
+ public static final String JBPM4 = "jBPM4";
+ private final static String seamJarName = "jboss-seam.jar";
+ private final static String seamVersionAttributeName = "Seam-Version";
+
public JBossRuntimeLocator() {
}
@@ -50,6 +60,41 @@
if (!ServerType.UNKNOWN.equals(serverBean.getType())) {
serverDefinitions.add(new ServerDefinition(serverBean));
} else {
+ String seamVersion = getSeamVersionFromManifest(root.getAbsolutePath());
+ if (seamVersion != null) {
+ serverDefinitions.add(new ServerDefinition(root.getName(), seamVersion, JBossRuntimeStartup.SEAM, root.getAbsoluteFile()));
+ } else {
+ String[] files = root.list(new FilenameFilter() {
+
+ public boolean accept(File dir, String name) {
+ if (name.startsWith("drools-api") && name.endsWith(".jar") ) {
+ return true;
+ }
+ return false;
+ }
+ });
+ boolean droolsFound = false;
+ if (files.length > 0) {
+ String version = getImplementationVersion(root,files[0]);
+ if (version != null) {
+ version = version.substring(0,3);
+ serverDefinitions.add(new ServerDefinition(root.getName(), version, JBossRuntimeStartup.DROOLS, root.getAbsoluteFile()));
+ droolsFound = true;
+ }
+ }
+ if (!droolsFound) {
+ boolean isJBPM = isValidJbpmInstallation(root.getAbsolutePath());
+ if (isJBPM) {
+ String version = "unknown";
+ if (isJbpm3(root.getAbsolutePath())) {
+ version = JBPM3;
+ } else if (isJbpm4(root.getAbsolutePath())) {
+ version = JBPM4;
+ }
+ serverDefinitions.add(new ServerDefinition(root.getName(), version, JBossRuntimeStartup.JBPM, root.getAbsoluteFile()));
+ }
+ }
+ }
children = root.listFiles();
}
} else {
@@ -67,6 +112,55 @@
}
}
monitor.done();
+ }
+
+ /**
+ * @param dir
+ * @param string
+ * @return
+ */
+ private String getImplementationVersion(File dir, String file) {
+ File jarFile = new File(dir, file);
+ if(!jarFile.isFile()) {
+ return null;
+ }
+ try {
+ JarFile jar = new JarFile(jarFile);
+ Attributes attributes = jar.getManifest().getMainAttributes();
+ String version = attributes.getValue("Implementation-Version");
+ return version;
+ } catch (IOException e) {
+ return null;
+ }
}
+ public static String getSeamVersionFromManifest(String seamHome) {
+ File jarFile = new File(seamHome, "lib/" + seamJarName);
+ if(!jarFile.isFile()) {
+ jarFile = new File(seamHome, seamJarName);
+ if(!jarFile.isFile()) {
+ return null;
+ }
+ }
+ try {
+ JarFile jar = new JarFile(jarFile);
+ Attributes attributes = jar.getManifest().getMainAttributes();
+ String version = attributes.getValue(seamVersionAttributeName);
+ return version;
+ } catch (IOException e) {
+ return null;
+ }
+ }
+
+ public static boolean isJbpm3(String location) {
+ return new Path(location).append("/src/resources/gpd/version.info.xml").toFile().exists();
+ }
+
+ public static boolean isJbpm4(String location) {
+ return new Path(location).append("/jbpm.jar").toFile().exists();
+ }
+
+ private boolean isValidJbpmInstallation(String location) {
+ return isJbpm3(location) || isJbpm4(location);
+ }
}
Modified: trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java 2010-08-25 20:00:29 UTC (rev 24451)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java 2010-08-25 20:04:59 UTC (rev 24452)
@@ -7,6 +7,7 @@
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
@@ -16,6 +17,8 @@
import org.drools.eclipse.util.DroolsRuntime;
import org.drools.eclipse.util.DroolsRuntimeManager;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -26,6 +29,7 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.preferences.ConfigurationScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.datatools.connectivity.ConnectionProfileConstants;
@@ -57,6 +61,7 @@
import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
import org.jboss.ide.eclipse.as.core.util.JBossServerType;
import org.jboss.ide.eclipse.as.core.util.ServerBeanLoader;
+import org.jboss.tools.jbpm.preferences.JbpmInstallation;
import org.jboss.tools.jbpm.preferences.PreferencesManager;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamUtil;
@@ -64,9 +69,15 @@
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.core.project.facet.SeamVersion;
import org.osgi.framework.Bundle;
+import org.osgi.service.prefs.BackingStoreException;
public class JBossRuntimeStartup implements IStartup {
+ /**
+ *
+ */
+ private static final String DEFAULT_DS = "DefaultDS";
+
private static final String RUNTIME = Messages.JBossRuntimeStartup_Runtime;
private static final String EAP = "EAP"; //$NON-NLS-1$
@@ -78,6 +89,10 @@
private static final String EPP = "EPP"; //$NON-NLS-1$
private static final String EWP = "EWP"; //$NON-NLS-1$
+
+ public static final String SEAM = "SEAM"; // NON-NLS-1$
+
+ public static final String DROOLS = "DROOLS"; // NON-NLS-1$
public static final String JBOSS_EAP_HOME = "../../../../jboss-eap/jboss-as"; // JBoss AS home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
@@ -102,11 +117,7 @@
public static final String SEAM_2_0_HOME_CONFIGURATION_CP = "../../jboss-eap/seam2"; //$NON-NLS-1$
public static final String[] SEAM_HOME_FOLDER_OPTIONS = {"seam","seam1","seam2","seamfp"};
-
-
- private static final String JBPM_VERSION="jBPM3"; //$NON-NLS-1$
-
// This constants are made to avoid dependency with org.jboss.ide.eclipse.as.core plugin
public static final String JBOSS_AS_RUNTIME_TYPE_ID[] = {
"org.jboss.ide.eclipse.as.runtime.32", //$NON-NLS-1$
@@ -177,22 +188,79 @@
= "org.eclipse.datatools.connectivity.db.URL"; //$NON-NLS-1$
private static final String HSQL_PROFILE_ID = "org.eclipse.datatools.enablement.hsqldb.connectionProfile";
+
+ public static final String JBPM = "JBPM";
private List<ServerDefinition> serverDefinitions = new ArrayList<ServerDefinition>();
+
+ private IEclipsePreferences preferences;
public void earlyStartup() {
if (!isJBDS()) {
return;
}
- boolean firstStart = Activator.getDefault().getPreferenceStore().getBoolean(Activator.FIRST_START);
- if (!firstStart) {
+ if (!willBeInitialized()) {
return;
}
- Activator.getDefault().getPreferenceStore().setValue(Activator.FIRST_START, false);
parseServerFile();
initializeRuntimes(serverDefinitions);
+ saveWorkspacePreferences();
}
+ private void saveWorkspacePreferences() {
+ String workspaces = getWorkspaces();
+ String newWorkspaces = "";
+ if (workspaces == null || workspaces.trim().length() == 0) {
+ newWorkspaces = getWorkspace();
+ } else {
+ newWorkspaces = workspaces + "," + getWorkspace();
+ }
+ IEclipsePreferences prefs = getPreferences();
+ prefs.put(Activator.WORKSPACES, newWorkspaces);
+ try {
+ prefs.flush();
+ } catch (BackingStoreException e) {
+ Activator.log(e);
+ }
+ }
+
+ /**
+ * @return
+ */
+ private boolean willBeInitialized() {
+ String workspaces = getWorkspaces();
+ if (workspaces == null || workspaces.trim().length() == 0) {
+ return true;
+ }
+ StringTokenizer tokenizer = new StringTokenizer(workspaces, ",");
+ while (tokenizer.hasMoreTokens()) {
+ String workspace = tokenizer.nextToken();
+ if (workspace.equals(getWorkspace())) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private String getWorkspaces() {
+ IEclipsePreferences prefs = getPreferences();
+ String workspaces = prefs.get(Activator.WORKSPACES, "");
+ return workspaces;
+ }
+
+ private String getWorkspace() {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IPath workspacePath = root.getLocation();
+ return workspacePath.toOSString();
+ }
+
+ private IEclipsePreferences getPreferences() {
+ if (preferences == null) {
+ preferences = new ConfigurationScope().getNode(Activator.PLUGIN_ID);
+ }
+ return preferences;
+ }
+
private boolean isJBDS() {
Bundle jbdsProduct = Platform.getBundle("com.jboss.jbds.product");
return jbdsProduct != null;
@@ -236,11 +304,7 @@
}
public void initializeSeam(List<ServerDefinition> serverDefinitions) {
- IEclipsePreferences node = (IEclipsePreferences)
- Platform.getPreferencesService()
- .getRootNode()
- .node(InstanceScope.SCOPE)
- .node(SeamCorePlugin.PLUGIN_ID);
+
Map<String, SeamRuntime> map = new HashMap<String,SeamRuntime>();
// to fix https://jira.jboss.org/jira/browse/JBDS-682
@@ -326,17 +390,33 @@
}
private void addSeam(Map<String, SeamRuntime> map, String seamPath,SeamVersion seamVersion, String name) {
- File seamFolder = new File(seamPath);
- if(seamFolder.exists() && seamFolder.isDirectory()) {
- SeamRuntime rt = new SeamRuntime();
- rt.setHomeDir(seamPath);
- rt.setName(name);
- rt.setDefault(true);
- rt.setVersion(seamVersion);
- SeamRuntimeManager.getInstance().addRuntime(rt);
+ if (!seamExists(seamPath)) {
+ File seamFolder = new File(seamPath);
+ if(seamFolder.exists() && seamFolder.isDirectory()) {
+ SeamRuntime rt = new SeamRuntime();
+ rt.setHomeDir(seamPath);
+ rt.setName(name);
+ rt.setDefault(true);
+ rt.setVersion(seamVersion);
+ SeamRuntimeManager.getInstance().addRuntime(rt);
+ }
}
}
+ /**
+ * @param seamPath
+ * @return
+ */
+ private boolean seamExists(String seamPath) {
+ SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance().getRuntimes();
+ for (SeamRuntime sr:seamRuntimes) {
+ if (seamPath != null && seamPath.equals(sr.getHomeDir())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
private String getSeamGenBuildPath(String seamHomePath,
String seamHomePathConfiguration) {
try {
@@ -409,7 +489,10 @@
index = 6;
} else if ("5.0".equals(version)) { //$NON-NLS-1$
index = 7;
- }
+ } else if ("5.1".equals(version)) { //$NON-NLS-1$
+ // FIXME - this needs to be changed when adding a new runtime type for JBoss EAP 5.1
+ index = 7;
+ }
}
return index;
}
@@ -581,14 +664,20 @@
* @throws CoreException
*/
private static IServerWorkingCopy createServer(IProgressMonitor progressMonitor, IRuntime runtime, int index, String name) throws CoreException {
+ if (name == null) {
+ name = JBOSS_AS_NAME[index];
+ }
+ IServer[] servers = ServerCore.getServers();
+ for (IServer server:servers) {
+ if (name.equals(server.getName()) ) {
+ return null;
+ }
+ }
IServerType serverType = ServerCore.findServerType(JBOSS_AS_TYPE_ID[index]);
IServerWorkingCopy server = serverType.createServer(null, null, runtime, progressMonitor);
server.setHost(JBOSS_AS_HOST);
- if(name != null)
- server.setName(name);
- else
- server.setName(JBOSS_AS_NAME[index]);
+ server.setName(name);
// JBossServer.DEPLOY_DIRECTORY
String deployVal = runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("deploy").toOSString(); //$NON-NLS-1$ //$NON-NLS-2$
@@ -606,8 +695,6 @@
return server;
}
- private static boolean driverIsCreated = false;
-
/**
* Creates HSQL DB Driver
* @param jbossASLocation location of JBoss AS
@@ -616,7 +703,7 @@
* @return driver instance
*/
private static void createDriver(String jbossASLocation, int index) throws ConnectionProfileException {
- if(driverIsCreated) {
+ if(ProfileManager.getInstance().getProfileByName(DEFAULT_DS) != null) {
// Don't create the driver a few times
return;
}
@@ -656,7 +743,7 @@
}
driver = DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
- if (driver != null && ProfileManager.getInstance().getProfileByName("DefaultDS") == null) { //$NON-NLS-1$
+ if (driver != null && ProfileManager.getInstance().getProfileByName(DEFAULT_DS) == null) { //$NON-NLS-1$
// create profile
Properties props = new Properties();
props.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, HSQL_DRIVER_DEFINITION_ID);
@@ -670,26 +757,30 @@
props.setProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID));
props.setProperty(IDBDriverDefinitionConstants.URL_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.URL_PROP_ID));
- ProfileManager.getInstance().createProfile("DefaultDS", Messages.JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database, HSQL_PROFILE_ID, props, "", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ ProfileManager.getInstance().createProfile(DEFAULT_DS, Messages.JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database, HSQL_PROFILE_ID, props, "", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- if(driver!=null) {
- driverIsCreated = true;
- }
+
}
public void initializeDroolsRuntime(List<ServerDefinition> serverDefinitions) {
List<DroolsRuntime> droolsRuntimes = new ArrayList<DroolsRuntime>();
for (ServerDefinition serverDefinition : serverDefinitions) {
String type = serverDefinition.getType();
- if (SOA_P.equals(type)) {
- File droolsRoot = serverDefinition.getLocation(); //$NON-NLS-1$
- if (droolsRoot.isDirectory()) {
- DroolsRuntime runtime = new DroolsRuntime();
- runtime.setName("Drools - " + serverDefinition.getName()); //$NON-NLS-1$
- runtime.setPath(droolsRoot.getAbsolutePath());
- DroolsRuntimeManager.recognizeJars(runtime);
- runtime.setDefault(true);
- droolsRuntimes.add(runtime);
+ if (!droolsExists(serverDefinition)) {
+ if (SOA_P.equals(type) || DROOLS.equals(type)) {
+ File droolsRoot = serverDefinition.getLocation(); //$NON-NLS-1$
+ if (droolsRoot.isDirectory()) {
+ DroolsRuntime runtime = new DroolsRuntime();
+ if (SOA_P.equals(type)) {
+ runtime.setName("Drools - " + serverDefinition.getName()); //$NON-NLS-1$
+ } else {
+ runtime.setName("Drools " + serverDefinition.getVersion()+ " - " + serverDefinition.getName()); //$NON-NLS-1$
+ }
+ runtime.setPath(droolsRoot.getAbsolutePath());
+ DroolsRuntimeManager.recognizeJars(runtime);
+ runtime.setDefault(true);
+ droolsRuntimes.add(runtime);
+ }
}
}
}
@@ -700,17 +791,56 @@
}
+ /**
+ * @param serverDefinition
+ * @return
+ */
+ private boolean droolsExists(ServerDefinition serverDefinition) {
+ DroolsRuntime[] droolsRuntimes = DroolsRuntimeManager.getDroolsRuntimes();
+ for (DroolsRuntime dr:droolsRuntimes) {
+ String location = dr.getPath();
+ if (location != null && location.equals(serverDefinition.getLocation().getAbsolutePath())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
public void initializeJbpmRuntime(List<ServerDefinition> serverDefinitions) {
for (ServerDefinition serverDefinition : serverDefinitions) {
- String type = serverDefinition.getType();
- if (SOA_P.equals(type)) {
- File jbpmRoot = new File(serverDefinition.getLocation(),"jbpm-jpdl"); //$NON-NLS-1$
- if (jbpmRoot.isDirectory()) {
- PreferencesManager.getInstance().initializeDefaultJbpmInstallation(serverDefinition.getName(), jbpmRoot.getAbsolutePath(), JBPM_VERSION);
+ if (!jbpmExists(serverDefinition)) {
+ String type = serverDefinition.getType();
+ if (SOA_P.equals(type)) {
+ File jbpmRoot = new File(serverDefinition.getLocation(),"jbpm-jpdl"); //$NON-NLS-1$
+ if (jbpmRoot.isDirectory()) {
+ String version = JBossRuntimeLocator.JBPM3;
+ if (JBossRuntimeLocator.isJbpm4(serverDefinition.getLocation().getAbsolutePath())) {
+ version = JBossRuntimeLocator.JBPM4;
+ }
+ PreferencesManager.getInstance().initializeDefaultJbpmInstallation(serverDefinition.getName(), jbpmRoot.getAbsolutePath(), version);
+ }
+ } else if (JBPM.equals(type)) {
+ PreferencesManager.getInstance().addJbpmInstallation(serverDefinition.getName(), serverDefinition.getLocation().getAbsolutePath(), serverDefinition.getVersion());
}
}
}
}
+ /**
+ * @param serverDefinition
+ * @return
+ */
+ private boolean jbpmExists(ServerDefinition serverDefinition) {
+ Map<String, JbpmInstallation> jbpmMap = PreferencesManager.getInstance().getJbpmInstallationMap();
+ Collection<JbpmInstallation> jbpmInstalations = jbpmMap.values();
+ for (JbpmInstallation jbpm:jbpmInstalations) {
+ String location = jbpm.location;
+ if (location != null && location.equals(serverDefinition.getLocation().getAbsolutePath())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
}
\ No newline at end of file
Modified: trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/preferences/RuntimePreferencePage.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/preferences/RuntimePreferencePage.java 2010-08-25 20:00:29 UTC (rev 24451)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/preferences/RuntimePreferencePage.java 2010-08-25 20:04:59 UTC (rev 24452)
@@ -10,8 +10,17 @@
************************************************************************************/
package org.jboss.tools.runtime.preferences;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -20,6 +29,9 @@
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -34,7 +46,17 @@
import org.eclipse.swt.widgets.Link;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.ui.internal.wizards.preferences.PreferencesExportWizard;
+import org.eclipse.ui.internal.wizards.preferences.PreferencesImportWizard;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.internal.IMemento;
+import org.eclipse.wst.server.core.internal.Server;
+import org.eclipse.wst.server.core.internal.ServerPlugin;
+import org.eclipse.wst.server.core.internal.XMLMemento;
+import org.jboss.tools.jbpm.preferences.JbpmInstallation;
+import org.jboss.tools.jbpm.preferences.PreferencesManager;
import org.jboss.tools.runtime.Activator;
import org.jboss.tools.runtime.JBossRuntimeLocator;
@@ -45,12 +67,15 @@
public class RuntimePreferencePage extends PreferencePage implements
IWorkbenchPreferencePage {
+ private static final String SERVER_DATA_FILE = "servers.xml";
+
private static final String LASTPATH = "lastPath";
public static final String SEAM_PREFERENCES_ID = "org.jboss.tools.common.model.ui.seam"; //$NON-NLS-1$
public static final String WTP_PREFERENCES_ID = "org.eclipse.wst.server.ui.runtime.preferencePage"; //$NON-NLS-1$
private static final String DROOLS_PREFERENCES_ID = "org.drools.eclipse.preferences.DroolsRuntimesPreferencePage";
private static final String JBPM_PREFERENCES_ID = "org.jboss.tools.jbpm.locations";
+ protected Map<String, Object> map = new HashMap<String, Object>();
/*
* (non-Javadoc)
@@ -67,10 +92,6 @@
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(1, false);
- //layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- //layout.marginWidth= 0;
- //layout.verticalSpacing= convertVerticalDLUsToPixels(10);
- //layout.horizontalSpacing= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
composite.setLayout(layout);
createLink(composite, "See <a>WTP Runtime</a>", WTP_PREFERENCES_ID);
@@ -125,13 +146,117 @@
}
private void exportRuntimes() {
- // TODO Auto-generated method stub
+ exportServers();
+ exportJbpms();
+ PreferencesExportWizard wizard = new PreferencesExportWizard();
+ wizard.init(PlatformUI.getWorkbench(), new StructuredSelection());
+ WizardDialog dialog = new WizardDialog(getShell(), wizard);
+ dialog.create();
+ dialog.open();
}
+ private void exportJbpms() {
+ File file = org.jboss.tools.jbpm.Activator.getDefault().getStateLocation().append("jbpm-installations.xml").toFile();
+ if (!file.exists()) {
+ Activator.getDefault().getPreferenceStore().setValue(Activator.JBPMS, "");
+ return;
+ }
+ try {
+ XMLMemento memento = (XMLMemento) XMLMemento.loadMemento(file.getAbsolutePath());
+ String xmlString = memento.saveToString();
+ Activator.getDefault().getPreferenceStore().setValue(Activator.JBPMS, xmlString);
+ Activator.getDefault().savePluginPreferences();
+ } catch (Exception e) {
+ Activator.log (e);
+ }
+ }
+
+ private void exportServers() {
+ String filename = ServerPlugin.getInstance().getStateLocation().append(SERVER_DATA_FILE).toOSString();
+ if ( !(new File(filename).exists()) ) {
+ Activator.getDefault().getPreferenceStore().setValue(Activator.SERVERS, "");
+ return;
+ }
+ try {
+ XMLMemento memento = (XMLMemento) XMLMemento.loadMemento(filename);
+ String xmlString = memento.saveToString();
+ Activator.getDefault().getPreferenceStore().setValue(Activator.SERVERS, xmlString);
+ Activator.getDefault().savePluginPreferences();
+ } catch (Exception e) {
+ Activator.log (e);
+ }
+ }
+
private void importRuntimes() {
- // TODO Auto-generated method stub
+ PreferencesImportWizard wizard = new PreferencesImportWizard();
+ wizard.init(PlatformUI.getWorkbench(), new StructuredSelection());
+ WizardDialog dialog = new WizardDialog(getShell(), wizard);
+ dialog.create();
+ int ok = dialog.open();
+ if (ok == Window.OK) {
+ String jbpms = Activator.getDefault().getPreferenceStore().getString(Activator.JBPMS);
+ if (jbpms != null && jbpms.trim().length() > 0) {
+ loadJBPMInstalations(jbpms);
+ }
+ String servers = Activator.getDefault().getPreferenceStore().getString(Activator.SERVERS);
+ if (servers != null && servers.trim().length() > 0) {
+ loadServerInstalations(servers);
+ }
+ }
}
+ /**
+ * @param servers
+ */
+ private void loadServerInstalations(String servers) {
+ InputStream in = null;
+ try {
+ in = new ByteArrayInputStream(servers.getBytes("UTF-8"));
+ IMemento memento = XMLMemento.loadMemento(in);
+
+ IMemento[] children = memento.getChildren("server");
+ int size = children.length;
+
+ for (int i = 0; i < size; i++) {
+ ServerEx server = new ServerEx(null);
+ server.loadFromMemento(children[i], null);
+ IServerWorkingCopy wc = server.createWorkingCopy();
+ wc.save(false, null);
+ }
+ } catch (Exception e) {
+ Activator.log(e);
+ }
+ }
+
+ /**
+ * @param jbpms
+ */
+ private void loadJBPMInstalations(String jbpms) {
+ InputStream in = null;
+ try {
+ in = new ByteArrayInputStream(jbpms.getBytes("UTF-8"));
+ IMemento memento = XMLMemento.loadMemento(in);
+ IMemento[] children = memento.getChildren("installation");
+ for (int i = 0; i < children.length; i++) {
+ JbpmInstallation installation = new JbpmInstallation();
+ installation.name = children[i].getString("name");
+ installation.location = children[i].getString("location");
+ installation.version = children[i].getString("version");
+ PreferencesManager.getInstance().getJbpmInstallationMap()
+ .put(installation.name, installation);
+ }
+ } catch (Exception e) {
+ Activator.log(e);
+ } finally {
+ try {
+ if (in != null) {
+ in.close();
+ }
+ } catch (IOException e) {
+ }
+ }
+ }
+
private Button createButton(Composite parent, String labelText, String buttonText) {
GridLayout layout;
Composite composite = new Composite(parent,SWT.NONE);
@@ -156,10 +281,10 @@
}
private void createLink(Composite composite, String text, final String preferencesId) {
- Link wtpRuntime = new Link(composite, SWT.NONE);
- wtpRuntime.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
- wtpRuntime.setText(text);
- wtpRuntime.addSelectionListener(new SelectionAdapter() {
+ Link link = new Link(composite, SWT.NONE);
+ link.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
+ link.setText(text);
+ link.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(),preferencesId, new String[] {preferencesId},null);
if (dialog != null) {
@@ -217,5 +342,20 @@
((GridData)gd).horizontalAlignment = GridData.FILL;
}
}
+
+ private static class ServerEx extends Server {
+ /**
+ * @param file
+ */
+ public ServerEx(IFile file) {
+ super(file);
+ }
+
+ @Override
+ public void loadFromMemento(IMemento memento, IProgressMonitor monitor) {
+ super.loadFromMemento(memento, monitor);
+ }
+
+ }
}
15 years, 4 months
JBoss Tools SVN: r24450 - trunk/documentation/whatsnew/as.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-08-25 15:25:56 -0400 (Wed, 25 Aug 2010)
New Revision: 24450
Added:
trunk/documentation/whatsnew/as/as-news-3.2.0.M2.html
Log:
https://jira.jboss.org/browse/JBIDE-6894 AS Component N&N
html file for m2 features added
Added: trunk/documentation/whatsnew/as/as-news-3.2.0.M2.html
===================================================================
--- trunk/documentation/whatsnew/as/as-news-3.2.0.M2.html (rev 0)
+++ trunk/documentation/whatsnew/as/as-news-3.2.0.M2.html 2010-08-25 19:25:56 UTC (rev 24450)
@@ -0,0 +1,69 @@
+<html>
+
+<head>
+<link rel="stylesheet" href="../whatsnew.css">
+<title>JBoss AS Tools 2.2.0.M2 News</title>
+</head>
+
+<body>
+
+<h1>JBoss AS Tools 2.2.0.M2 - New and Noteworthy</h1>
+
+ <p align="right"><a href="../index.html">< Main Index</a> <a href="../hibernate/hibernate-news-3.4.0.M2.html">Hibernate Tools ></a></p>
+
+<table border="0" cellpadding="10" cellspacing="0" width="80%">
+
+ <tr>
+ <td colspan="2">
+ <hr/>
+ <h3>Server</h3>
+ <hr/>
+ </td>
+ </tr>
+
+ <tr>
+ <td valign="top" align="left">
+ <p align="right">
+ <b>Name1</b></td>
+ <td valign="top" width="90%">
+ <p></p>
+
+ <p></p>
+
+ <p></p>
+
+ <p><small><a href="https://jira.jboss.org/jira/browse">Related jira</a></small></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr/>
+ </td>
+ </tr>
+
+ <tr>
+ <td valign="top" align="left">
+ <p align="right">
+ <b>Name2</b></td>
+ <td valign="top">
+ <p></p>
+ <p></p>
+ <p></p>
+ <p><small><a href="https://jira.jboss.org/jira/browse/">Related jira</a></small></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr/>
+ </td>
+ </tr>
+
+</table>
+
+</body>
+
+</html>
+
+
Property changes on: trunk/documentation/whatsnew/as/as-news-3.2.0.M2.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 4 months
JBoss Tools SVN: r24449 - trunk/documentation/whatsnew.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-08-25 15:24:52 -0400 (Wed, 25 Aug 2010)
New Revision: 24449
Modified:
trunk/documentation/whatsnew/index.html
Log:
https://jira.jboss.org/browse/JBIDE-6886 Create "New and Noteworthy" for 3.2.0.M2
index for M2 updated
Modified: trunk/documentation/whatsnew/index.html
===================================================================
--- trunk/documentation/whatsnew/index.html 2010-08-25 19:19:37 UTC (rev 24448)
+++ trunk/documentation/whatsnew/index.html 2010-08-25 19:24:52 UTC (rev 24449)
@@ -25,16 +25,19 @@
<p align="right"><b>3.2.0.M2</b>
<td valign="top">
<p><a href="core/core-news-3.2.0.M2.html">Core/General</a></p>
+ <p><a href="as/as-news-3.2.0.M2.html">JBoss AS Tools</a></p>
<p><a href="hibernate/hibernate-news-3.4.0.M2.html">Hibernate Tools</a></p>
<p><a href="jst/jst-news-3.2.0.M2.html">JST/JSF Tools</a></p>
<p><a href="vpe/vpe-news-3.2.0.M2.html">Visual Page Editor</a></p>
<p><a href="cdi/cdi-news-3.2.0.M2.html">CDI (JSR-299) Tools</a></p>
<p><a href="seam/seam-news-3.2.0.M2.html">Seam Tools</a></p>
<p><a href="bpel/bpel-news-1.1.0.M2.html">BPEL Tools</a></p>
- <p><a href="drools/guvnor-tools-news-5.1.0.M2.html">Drools/Guvnor Tools</a></p>
+ <p><a href="esb/esb-news-1.4.0.M2.html">ESB Tools</a></p>
+ <p><a href="drools/drools-news-5.1.0.M2-full.html">Drools Tools</a></p>
+ <p><a href="drools/guvnor-tools-news-5.1.0.M2.html">Drools Guvnor Tools</a></p>
<p><a href="jbpm/jbpm-news-3.2.0.M2.html">jBPM Tools</a></p>
<p><a href="ws/ws-news-1.2.0.M2.html">JBoss Webservice Tools</a></p>
- <p><a href="deltacloud/deltacloud-news-1.1.0.M2.html">Deltacloud Development Tools</a></p>
+ <p><a href="deltacloud/deltacloud-news-1.0.0.M2.html">Deltacloud Development Tools</a></p>
<p><a href="gwt/gwt-news-1.0.0.M2.html">GWT Integration</a></p>
</td>
</tr>
15 years, 4 months
JBoss Tools SVN: r24448 - branches/jbosstools-3.2.0.M2.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-08-25 15:19:37 -0400 (Wed, 25 Aug 2010)
New Revision: 24448
Modified:
branches/jbosstools-3.2.0.M2/parent-pom.xml
branches/jbosstools-3.2.0.M2/pom.xml
Log:
backport drools exclusion from trunk to M2
Modified: branches/jbosstools-3.2.0.M2/parent-pom.xml
===================================================================
--- branches/jbosstools-3.2.0.M2/parent-pom.xml 2010-08-25 19:05:23 UTC (rev 24447)
+++ branches/jbosstools-3.2.0.M2/parent-pom.xml 2010-08-25 19:19:37 UTC (rev 24448)
@@ -196,6 +196,18 @@
</releases>
</repository-->
<repository>
+ <id>eclipse36</id>
+ <url>http://download.eclipse.org/eclipse/updates/3.6.x/
+ </url>
+ <layout>p2</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ <repository>
<id>jboss-helios</id>
<url>http://download.jboss.org/jbosstools/updates/requirements/helios/</url>
<layout>p2</layout>
@@ -240,6 +252,18 @@
<enabled>true</enabled>
</releases>
</repository>
+ <repository>
+ <id>jboss-drools-nightly</id>
+ <url>http://download.jboss.org/jbosstools/builds/nightly/3.2.helios/jbosstools...
+ </url>
+ <layout>p2</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
<!--repository>
<id>swtbot-helios</id>
<url>http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site/
Modified: branches/jbosstools-3.2.0.M2/pom.xml
===================================================================
--- branches/jbosstools-3.2.0.M2/pom.xml 2010-08-25 19:05:23 UTC (rev 24447)
+++ branches/jbosstools-3.2.0.M2/pom.xml 2010-08-25 19:19:37 UTC (rev 24448)
@@ -50,7 +50,11 @@
and build/aggregate/site/site.xml or the build will break! -->
<module>gwt</module>
<module>deltacloud</module>
- <module>drools</module>
+ <!-- NOTE: To build drools, must first bootstrap with ant script: cd drools;
+ ant -q -->
+ <!-- IF YOU REMOVE A MODULE, be sure to also remove it from site/site.xml
+ and build/aggregate/site/site.xml or the build will break! -->
+ <!-- module>drools</module -->
<module>runtime</module>
<module>usage</module>
<module>site</module>
15 years, 4 months