JBoss Tools SVN: r12570 - branches/jbosstools-3.0.0.CR1/jst/plugins/org.jboss.tools.jst.jsp.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-12-12 09:58:57 -0500 (Fri, 12 Dec 2008)
New Revision: 12570
Modified:
branches/jbosstools-3.0.0.CR1/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
Log:
JBIDE-1967 Editor do not recognize .jsf extension for the JSF files
Issue is fixed
Modified: branches/jbosstools-3.0.0.CR1/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
===================================================================
--- branches/jbosstools-3.0.0.CR1/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2008-12-12 14:57:26 UTC (rev 12569)
+++ branches/jbosstools-3.0.0.CR1/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2008-12-12 14:58:57 UTC (rev 12570)
@@ -350,6 +350,9 @@
<file-association
content-type="org.eclipse.jst.jsp.core.jspsource"
file-extensions="inc"/>
+ <file-association
+ content-type="org.eclipse.wst.html.core.htmlsource"
+ file-extensions="jsf"/>
</extension>
<extension
17 years, 4 months
JBoss Tools SVN: r12569 - workspace/grid/esb-example.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-12-12 09:57:26 -0500 (Fri, 12 Dec 2008)
New Revision: 12569
Modified:
workspace/grid/esb-example/transform_CSV2XML.zip
workspace/grid/esb-example/transform_XML2XML_simple.zip
Log:
change some esb samples
Modified: workspace/grid/esb-example/transform_CSV2XML.zip
===================================================================
(Binary files differ)
Modified: workspace/grid/esb-example/transform_XML2XML_simple.zip
===================================================================
(Binary files differ)
17 years, 4 months
JBoss Tools SVN: r12568 - trunk/jst/plugins/org.jboss.tools.jst.jsp.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-12-12 09:42:27 -0500 (Fri, 12 Dec 2008)
New Revision: 12568
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
Log:
JBIDE-1967 Editor do not recognize .jsf extension for the JSF files
Issue is fixed
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2008-12-12 14:25:52 UTC (rev 12567)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2008-12-12 14:42:27 UTC (rev 12568)
@@ -350,6 +350,9 @@
<file-association
content-type="org.eclipse.jst.jsp.core.jspsource"
file-extensions="inc"/>
+ <file-association
+ content-type="org.eclipse.wst.html.core.htmlsource"
+ file-extensions="jsf"/>
</extension>
<extension
17 years, 4 months
JBoss Tools SVN: r12567 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-12-12 09:25:52 -0500 (Fri, 12 Dec 2008)
New Revision: 12567
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/editor/PaletteDialog.java
Log:
JBIDE-2712
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/editor/PaletteDialog.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/editor/PaletteDialog.java 2008-12-12 09:02:37 UTC (rev 12566)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/editor/PaletteDialog.java 2008-12-12 14:25:52 UTC (rev 12567)
@@ -17,19 +17,27 @@
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.common.meta.XAttribute;
import org.jboss.tools.common.meta.action.XActionItem;
import org.jboss.tools.common.meta.action.XActionList;
import org.jboss.tools.common.meta.action.XActionItem.Acceptor;
import org.jboss.tools.common.meta.help.HelpUtil;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.event.XModelTreeEvent;
import org.jboss.tools.common.model.event.XModelTreeListener;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.options.SharableConstants;
+import org.jboss.tools.common.model.options.SharableElement;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.navigator.FilteredTreeContentProvider;
import org.jboss.tools.common.model.ui.navigator.NavigatorLabelProvider;
@@ -47,6 +55,8 @@
protected XModelTreeListener listener2 = new ObjectListener();
protected XModelTreeListenerSWTSync syncListener2 = new XModelTreeListenerSWTSync(listener2);
+ Button restoreDefaults = null;
+
TreeViewerMenuInvoker menu = new TreeViewerMenuInvoker() {
protected XActionList getActionList(XModelObject o) {
XActionList l = super.getActionList(o);
@@ -124,8 +134,35 @@
treeViewer.getTree().addKeyListener(menu);
treeViewer.getTree().addSelectionListener(sl);
treeViewer.getTree().setVisible(true);
- treeViewer.setAutoExpandLevel(2);
- objectEditor.createControl(panel);
+ treeViewer.setAutoExpandLevel(2);
+
+ Composite right = new Composite(panel, SWT.NONE);
+ right.setLayoutData(new GridData(GridData.FILL_BOTH));
+ GridLayout layout = new GridLayout(1, false);
+ layout.marginTop = 0;
+ layout.marginLeft = 0;
+ layout.marginRight = 0;
+ layout.marginBottom = 0;
+ right.setLayout(layout);
+
+ Control c = objectEditor.createControl(right);
+ c.setLayoutData(new GridData(GridData.FILL_BOTH));
+ restoreDefaults = new Button(right, SWT.NONE);
+ restoreDefaults.setText("Restore Defaults");
+ GridData gd = new GridData();
+ gd.horizontalAlignment = SWT.END;
+ restoreDefaults.setLayoutData(gd);
+
+ restoreDefaults.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ public void widgetSelected(SelectionEvent e) {
+ restoreDefaults();
+ }
+
+ });
+
activate();
treeViewer.setAutoExpandLevel(2);
}
@@ -138,7 +175,12 @@
class SL extends SelectionAdapter {
public void widgetSelected(SelectionEvent e) {
- objectEditor.setModelObject(menu.getSelectedModelObject());
+ XModelObject o = menu.getSelectedModelObject();
+ objectEditor.setModelObject(o);
+ if(restoreDefaults != null && !restoreDefaults.isDisposed()) {
+ SharableElement element = getSelectedElementWithGeneralScope(o);
+ restoreDefaults.setEnabled(element != null);
+ }
}
}
@@ -182,5 +224,39 @@
public void structureChanged(XModelTreeEvent event) {}
}
+
+ private SharableElement getSelectedElementWithGeneralScope(XModelObject o) {
+ if(!(o instanceof SharableElement)) return null;
+ SharableElement e = (SharableElement)o;
+ return e.scopeExists(SharableConstants.GENERAL) ? e : null;
+ }
+ private void restoreDefaults() {
+ XModelObject o = menu.getSelectedModelObject();
+ SharableElement e = getSelectedElementWithGeneralScope(o);
+ if(e == null) return;
+ restoreDefaults(e);
+ }
+ private void restoreDefaults(SharableElement e) {
+ if(!e.scopeExists(SharableConstants.GENERAL)) return;
+ XAttribute[] as = e.getModelEntity().getAttributes();
+ for (int i = 0; i < as.length; i++) {
+ if(!as[i].isVisible()) continue;
+ String n = as[i].getName();
+ if("name".equals(n)) continue;
+ String v = e.getAttributeValue(n, SharableConstants.GENERAL);
+ String cv = e.getAttributeValue(n);
+ if(cv != null && cv.equals(v)) continue;
+ try {
+ e.getModel().editObjectAttribute(e, n, v);
+ } catch (XModelException exc) {
+ ModelPlugin.getPluginLog().logError(exc);
+ }
+ }
+ SharableElement[] cs = e.getSharableChildren();
+ for (int i = 0; i < cs.length; i++) {
+ restoreDefaults(cs[i]);
+ }
+ }
+
}
17 years, 4 months
JBoss Tools SVN: r12566 - workspace/examples.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-12-12 04:02:37 -0500 (Fri, 12 Dec 2008)
New Revision: 12566
Modified:
workspace/examples/projectExamples.xml
Log:
change the file for adding some esb examples
Modified: workspace/examples/projectExamples.xml
===================================================================
--- workspace/examples/projectExamples.xml 2008-12-12 09:01:41 UTC (rev 12565)
+++ workspace/examples/projectExamples.xml 2008-12-12 09:02:37 UTC (rev 12566)
@@ -197,5 +197,109 @@
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/grid/esb-example/webs...
</url>
- </project>
+ </project>
+
+ <project>
+ <category>ESB</category>
+ <name>transform_CSV2XML</name>
+ <shortDescription>JBoss ESB Smooks CSV->XML Example</shortDescription>
+ <description>This sample demonstrates how to transform a comma separated value (CSV) file to an xml.
+ The tranformation is done by configuring Smooks and performing two transformation, one
+ transformation from CSV to an intermediate xml format, and a second transformation from
+ the intermediate xml format to the target xml.</description>
+ <size>9500</size>
+ <url>
+ http://anonsvn.jboss.org/repos/jbosstools/workspace/grid/esb-example/tran...
+ </url>
+ </project>
+
+ <project>
+ <category>ESB</category>
+ <name>transform_CSV2XML_client</name>
+ <shortDescription>JBoss ESB Smooks CSV->XML Example - Client</shortDescription>
+ <description>This sample is to test the JBoss ESB smooks CSV->XML transformation.It requires the transform_CSV2XML project.</description>
+ <size>16600</size>
+ <url>
+ http://anonsvn.jboss.org/repos/jbosstools/workspace/grid/esb-example/tran...
+ </url>
+ </project>
+
+ <project>
+ <category>ESB</category>
+ <name>transform_XML2POJO</name>
+ <shortDescription>JBoss ESB Smooks XML->POJO Example</shortDescription>
+ <description>The purpose of the simple_transformation sample is to illustrate the
+use of Smooks performing a simple transformation by converting a XML file into
+Java POJOs.</description>
+ <size>26600</size>
+ <url>
+ http://anonsvn.jboss.org/repos/jbosstools/workspace/grid/esb-example/tran...
+ </url>
+ </project>
+
+ <project>
+ <category>ESB</category>
+ <name>transform_XML2POJO_client</name>
+ <shortDescription>JBoss ESB Smooks XML->POJO Example - Client</shortDescription>
+ <description>This sample is to test the JBoss ESB smooks XML->POJO transformation.It requires the transform_XML2POJO project.</description>
+ <size>22400</size>
+ <url>
+ http://anonsvn.jboss.org/repos/jbosstools/workspace/grid/esb-example/tran...
+ </url>
+ </project>
+
+ <project>
+ <category>ESB</category>
+ <name>transform_XML2XML_date_manipulation</name>
+ <shortDescription>JBoss ESB Smooks XML->XML date-manipulation Example</shortDescription>
+ <description>This is another simple sample of how to manually define and apply a Message
+ Transformation within JBoss ESB.
+
+ This sample is an extension of the "transformation_XML2XML_simple"
+ Quickstart, demonstrating how JBoss ESB Transformations can simplify your
+ XSLT transformations by combining the power of XSLT with Java. In this
+ Quickstart, we use Java to perform the ugly string manipulation on the
+ SampleOrder date field (see OrderDate.java) and use XSLT for what it's good at
+ i.e. Templating. Again, the transformed SampleOrder.xml message is just
+ printed to the Java console (message before and after).</description>
+ <size>13600</size>
+ <url>
+ http://anonsvn.jboss.org/repos/jbosstools/workspace/grid/esb-example/tran...
+ </url>
+ </project>
+
+ <project>
+ <category>ESB</category>
+ <name>transform_XML2XML_date_manipulation_client</name>
+ <shortDescription>JBoss ESB Smooks XML->XML date-manipulation Example - Client</shortDescription>
+ <description>This sample is to test the JBoss ESB XML->XML date-manipulation transformation.It requires the transform_XML2XML_date_manipulation project.</description>
+ <size>18600</size>
+ <url>
+ http://anonsvn.jboss.org/repos/jbosstools/workspace/grid/esb-example/tran...
+ </url>
+ </project>
+
+ <project>
+ <category>ESB</category>
+ <name>transform_XML2XML_simple</name>
+ <shortDescription>JBoss ESB Smooks XML->XML Example</shortDescription>
+ <description>This is a very basic sample of how to manually define and apply a Message
+ Transformation within JBoss ESB. It applies a very simple XSLT to a
+ SampleOrder.xml message and prints the before and after XML to the console.</description>
+ <size>9300</size>
+ <url>
+ http://anonsvn.jboss.org/repos/jbosstools/workspace/grid/esb-example/tran...
+ </url>
+ </project>
+
+ <project>
+ <category>ESB</category>
+ <name>transform_XML2XML_simple_client</name>
+ <shortDescription>JBoss ESB Smooks XML->XML Example - Client</shortDescription>
+ <description>This sample is to test the JBoss ESB XML->XML transformation.It requires the transform_XML2XML_simple project.</description>
+ <size>17800</size>
+ <url>
+ http://anonsvn.jboss.org/repos/jbosstools/workspace/grid/esb-example/tran...
+ </url>
+ </project>
</projects>
17 years, 4 months
JBoss Tools SVN: r12565 - workspace/grid/esb-example.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-12-12 04:01:41 -0500 (Fri, 12 Dec 2008)
New Revision: 12565
Added:
workspace/grid/esb-example/transform_CSV2XML.zip
workspace/grid/esb-example/transform_CSV2XML_client.zip
workspace/grid/esb-example/transform_XML2POJO.zip
workspace/grid/esb-example/transform_XML2POJO_client.zip
workspace/grid/esb-example/transform_XML2XML_date_manipulation.zip
workspace/grid/esb-example/transform_XML2XML_date_manipulation_client.zip
workspace/grid/esb-example/transform_XML2XML_simple.zip
workspace/grid/esb-example/transform_XML2XML_simple_client.zip
Log:
add some esb examples
Added: workspace/grid/esb-example/transform_CSV2XML.zip
===================================================================
(Binary files differ)
Property changes on: workspace/grid/esb-example/transform_CSV2XML.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/esb-example/transform_CSV2XML_client.zip
===================================================================
(Binary files differ)
Property changes on: workspace/grid/esb-example/transform_CSV2XML_client.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/esb-example/transform_XML2POJO.zip
===================================================================
(Binary files differ)
Property changes on: workspace/grid/esb-example/transform_XML2POJO.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/esb-example/transform_XML2POJO_client.zip
===================================================================
(Binary files differ)
Property changes on: workspace/grid/esb-example/transform_XML2POJO_client.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/esb-example/transform_XML2XML_date_manipulation.zip
===================================================================
(Binary files differ)
Property changes on: workspace/grid/esb-example/transform_XML2XML_date_manipulation.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/esb-example/transform_XML2XML_date_manipulation_client.zip
===================================================================
(Binary files differ)
Property changes on: workspace/grid/esb-example/transform_XML2XML_date_manipulation_client.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/esb-example/transform_XML2XML_simple.zip
===================================================================
(Binary files differ)
Property changes on: workspace/grid/esb-example/transform_XML2XML_simple.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/esb-example/transform_XML2XML_simple_client.zip
===================================================================
(Binary files differ)
Property changes on: workspace/grid/esb-example/transform_XML2XML_simple_client.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 4 months
JBoss Tools SVN: r12564 - branches/jbosstools-3.0.0.CR1/jst/plugins/org.jboss.tools.jst.firstrun/src/org/jboss/tools/jst/firstrun.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-12-12 01:42:18 -0500 (Fri, 12 Dec 2008)
New Revision: 12564
Modified:
branches/jbosstools-3.0.0.CR1/jst/plugins/org.jboss.tools.jst.firstrun/src/org/jboss/tools/jst/firstrun/JBossASAdapterInitializer.java
Log:
https://jira.jboss.org/jira/browse/JBDS-516 fixed
Modified: branches/jbosstools-3.0.0.CR1/jst/plugins/org.jboss.tools.jst.firstrun/src/org/jboss/tools/jst/firstrun/JBossASAdapterInitializer.java
===================================================================
--- branches/jbosstools-3.0.0.CR1/jst/plugins/org.jboss.tools.jst.firstrun/src/org/jboss/tools/jst/firstrun/JBossASAdapterInitializer.java 2008-12-12 06:12:55 UTC (rev 12563)
+++ branches/jbosstools-3.0.0.CR1/jst/plugins/org.jboss.tools.jst.firstrun/src/org/jboss/tools/jst/firstrun/JBossASAdapterInitializer.java 2008-12-12 06:42:18 UTC (rev 12564)
@@ -11,7 +11,9 @@
package org.jboss.tools.jst.firstrun;
+import java.io.BufferedInputStream;
import java.io.File;
+import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
@@ -27,13 +29,13 @@
import org.eclipse.datatools.connectivity.ConnectionProfileConstants;
import org.eclipse.datatools.connectivity.ConnectionProfileException;
import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.datatools.connectivity.db.generic.IDBConnectionProfileConstants;
-import org.eclipse.datatools.connectivity.db.generic.IDBDriverDefinitionConstants;
import org.eclipse.datatools.connectivity.drivers.DriverInstance;
import org.eclipse.datatools.connectivity.drivers.DriverManager;
import org.eclipse.datatools.connectivity.drivers.IDriverMgmtConstants;
import org.eclipse.datatools.connectivity.drivers.IPropertySet;
import org.eclipse.datatools.connectivity.drivers.PropertySetImpl;
+import org.eclipse.datatools.connectivity.drivers.jdbc.IJDBCConnectionProfileConstants;
+import org.eclipse.datatools.connectivity.drivers.jdbc.IJDBCDriverDefinitionConstants;
import org.eclipse.datatools.connectivity.drivers.models.TemplateDescriptor;
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.JavaRuntime;
@@ -52,38 +54,29 @@
/**
* @author eskimo
- *
+ *
*/
public class JBossASAdapterInitializer implements IStartup {
- public static final String JBOSS_AS_HOME = "../../../../jboss-eap/jboss-as"; // JBoss AS home directory (relative to plugin)- <RHDS_HOME>/jbossas.
-
+ public static final String JBOSS_AS_HOME = "../../../../jboss-eap/jboss-as"; // JBoss
public static final String SERVERS_FILE = "../../../../studio/application_platforms.properties";
-
-
- // This constants are made to avoid dependency with org.jboss.ide.eclipse.as.core plugin
+
+ // 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",
- "org.jboss.ide.eclipse.as.runtime.40",
- "org.jboss.ide.eclipse.as.runtime.42",
- "org.jboss.ide.eclipse.as.runtime.50"
- };
+ "org.jboss.ide.eclipse.as.runtime.32",
+ "org.jboss.ide.eclipse.as.runtime.40",
+ "org.jboss.ide.eclipse.as.runtime.42",
+ "org.jboss.ide.eclipse.as.runtime.50" };
public static final String JBOSS_AS_TYPE_ID[] = {
- "org.jboss.ide.eclipse.as.32",
- "org.jboss.ide.eclipse.as.40",
- "org.jboss.ide.eclipse.as.42",
- "org.jboss.ide.eclipse.as.50"
- };
-
+ "org.jboss.ide.eclipse.as.32", "org.jboss.ide.eclipse.as.40",
+ "org.jboss.ide.eclipse.as.42", "org.jboss.ide.eclipse.as.50" };
public static final String JBOSS_AS_NAME[] = {
- "JBoss Application Server 3.2",
- "JBoss Application Server 4.0",
- "JBoss Application Server 4.2",
- "JBoss Application Server 5.0"
- };
-
+ "JBoss Application Server 3.2", "JBoss Application Server 4.0",
+ "JBoss Application Server 4.2", "JBoss Application Server 5.0" };
+
private static final int installedASIndex = 2;
public static final String JBOSS_AS_HOST = "localhost";
@@ -92,93 +85,81 @@
public static final String FIRST_START_PREFERENCE_NAME = "FIRST_START";
- public static final String HSQL_DRIVER_DEFINITION_ID
- = "DriverDefn.Hypersonic DB";
+ public static final String HSQL_DRIVER_DEFINITION_ID = "DriverDefn.Hypersonic DB";
public static final String HSQL_DRIVER_NAME = "Hypersonic DB";
- public static final String HSQL_DRIVER_TEMPLATE_ID
- = "org.eclipse.datatools.enablement.hsqldb.1_8.driver";
+ public static final String HSQL_DRIVER_TEMPLATE_ID = "org.eclipse.datatools.enablement.hsqldb.1_8.driver";
- public static final String DTP_DB_URL_PROPERTY_ID
- = "org.eclipse.datatools.connectivity.db.URL";
+ public static final String DTP_DB_URL_PROPERTY_ID = "org.eclipse.datatools.connectivity.db.URL";
+
/**
* @see org.eclipse.ui.IStartup#earlyStartup()
*/
public void earlyStartup() {
/*
- * If there are any problems with EAP not functioning the same as
+ * If there are any problems with EAP not functioning the same as
* servers created from scratch, THIS is the method to go to.
*
* Compare this method with JBossServerWizardFragment#performFinish()
*/
try {
- JstFirstRunPlugin.getDefault().getPreferenceStore().setDefault(FIRST_START_PREFERENCE_NAME, true);
- boolean firstStart = JstFirstRunPlugin.getDefault().getPreferenceStore().getBoolean(FIRST_START_PREFERENCE_NAME);
+ JstFirstRunPlugin.getDefault().getPreferenceStore().setDefault(
+ FIRST_START_PREFERENCE_NAME, true);
+ boolean firstStart = JstFirstRunPlugin.getDefault()
+ .getPreferenceStore().getBoolean(
+ FIRST_START_PREFERENCE_NAME);
+
if (!firstStart) {
return;
}
- JstFirstRunPlugin.getDefault().getPreferenceStore().setValue(FIRST_START_PREFERENCE_NAME, false);
- String pluginLocation = FileLocator.resolve(JstFirstRunPlugin.getDefault().getBundle().getEntry("/")).getPath();
- File serversFile = new File(pluginLocation, SERVERS_FILE).getCanonicalFile();
- if(serversFile.exists()){
- String str = FileUtil.readFile(serversFile);
+ JstFirstRunPlugin.getDefault().getPreferenceStore().setValue(
+ FIRST_START_PREFERENCE_NAME, false);
+ String pluginLocation = FileLocator.resolve(
+ JstFirstRunPlugin.getDefault().getBundle().getEntry("/"))
+ .getPath();
+ File serversFile = new File(pluginLocation, SERVERS_FILE)
+ .getCanonicalFile();
+ if (serversFile.exists()) {
+ Properties servers = new Properties();
+ servers.load(new BufferedInputStream(new FileInputStream(serversFile)));
int position = 0;
- while(true){
+ for (Object iterable_element : servers.keySet()) {
+ String str = servers.getProperty(iterable_element.toString());
String jbossASLocation = null;
-
- // server name
- int namePosition = str.indexOf("=",position+1);
- if(namePosition < 0) break;
-
- // server type
- int typePosition = str.indexOf(",",namePosition+1);
- if(position < 0) break;
-
- String name = str.substring(namePosition+1,typePosition).trim();
+ String[] params = str.split(",");
- // server version
- int versionPosition = str.indexOf(",",typePosition+1);
- if(versionPosition < 0) break;
+ String name = params[0];
+ String type = params[1];
+ String version = params[2];
+ jbossASLocation = params[3].trim();
- String type = str.substring(typePosition+1,versionPosition).trim();
-
- // server location
- position = str.indexOf(",",versionPosition+1);
- if(position < 0) break;
-
- String version = str.substring(versionPosition+1,position);
-
int index = 0;
- if(type.startsWith("AS")){
- if(version.startsWith("3.2"))
+ if (type.startsWith("AS")) {
+ if (version.startsWith("3.2")) {
index = 0;
- else if(version.startsWith("4.0"))
+ } else if (version.startsWith("4.0")) {
index = 1;
- else if(version.startsWith("4.2") || version.startsWith("4.3"))
+ } else if (version.startsWith("4.2")
+ || version.startsWith("4.3")) {
index = 2;
- else if(version.startsWith("5.0"))
+ } else if (version.startsWith("5.0")) {
index = 3;
- }else
+ }
+ } else {
index = 2;
+ }
+
+ if (!"AS".equals(type)) {
+ jbossASLocation = jbossASLocation + File.separatorChar + "jboss-as";
+ }
- int next = str.indexOf("server",position+1);
+ IRuntime runtime = createRuntime(name + " Runtime",
+ jbossASLocation, new NullProgressMonitor(), index);
- if(next < 0)
- jbossASLocation = str.substring(position+1,str.length()-1);
- else
- jbossASLocation = str.substring(position+1,next);
-
- jbossASLocation = jbossASLocation.trim();
-
- IRuntime runtime = null;
- IProgressMonitor progressMonitor = new NullProgressMonitor();
- if (runtime == null) {
- runtime = createRuntime(name + " Runtime", jbossASLocation, progressMonitor, index);
- }
if (runtime != null) {
- createServer(progressMonitor, runtime, index, name);
+ createServer(new NullProgressMonitor(), runtime, index, name);
}
createDriver(jbossASLocation);
@@ -186,8 +167,9 @@
}
String jbossASLocation = null;
-
- File jbossASDir = new File(pluginLocation, JBOSS_AS_HOME).getCanonicalFile();
+
+ File jbossASDir = new File(pluginLocation, JBOSS_AS_HOME)
+ .getCanonicalFile();
if (jbossASDir.isDirectory()) {
jbossASLocation = jbossASDir.getAbsolutePath();
} else {
@@ -199,7 +181,8 @@
IServer[] servers = ServerCore.getServers();
for (int i = 0; i < servers.length; i++) {
IRuntime runtime = servers[i].getRuntime();
- if(runtime != null && runtime.getLocation().equals(jbossAsLocationPath)) {
+ if (runtime != null
+ && runtime.getLocation().equals(jbossAsLocationPath)) {
return;
}
}
@@ -215,7 +198,8 @@
IProgressMonitor progressMonitor = new NullProgressMonitor();
if (runtime == null) {
- runtime = createRuntime(null, jbossASLocation, progressMonitor, 2);
+ runtime = createRuntime(null, jbossASLocation, progressMonitor,
+ 2);
}
if (runtime != null) {
createServer(progressMonitor, runtime, 2, null);
@@ -223,28 +207,42 @@
createDriver(jbossASLocation);
} catch (CoreException e) {
- JstFirstRunPlugin.getPluginLog().log(new Status(IStatus.ERROR,
- JstFirstRunPlugin.PLUGIN_ID, "Can't create new JBoss Server", e));
+ JstFirstRunPlugin.getPluginLog().log(
+ new Status(IStatus.ERROR, JstFirstRunPlugin.PLUGIN_ID,
+ "Can't create new JBoss Server", e));
} catch (IOException e) {
- JstFirstRunPlugin.getPluginLog().log(new Status(IStatus.ERROR,
- JstFirstRunPlugin.PLUGIN_ID, "Can't create new JBoss Server", e));
+ JstFirstRunPlugin.getPluginLog().log(
+ new Status(IStatus.ERROR, JstFirstRunPlugin.PLUGIN_ID,
+ "Can't create new JBoss Server", e));
} catch (ConnectionProfileException e) {
- JstFirstRunPlugin.getPluginLog().log(new Status(IStatus.ERROR,
- JstFirstRunPlugin.PLUGIN_ID, "Can't create new DTP "
- + "Connection Profile for JBoss AS Hypersonic embedded database", e));
+ JstFirstRunPlugin
+ .getPluginLog()
+ .log(
+ new Status(
+ IStatus.ERROR,
+ JstFirstRunPlugin.PLUGIN_ID,
+ "Can't create new DTP "
+ + "Connection Profile for JBoss AS Hypersonic embedded database",
+ e));
}
}
/**
* Creates new JBoss AS Runtime, Server and hsqldb driver
- * @param jbossASLocation location of JBoss Server
- * @param progressMonitor to report progress
+ *
+ * @param jbossASLocation
+ * location of JBoss Server
+ * @param progressMonitor
+ * to report progress
* @return server working copy
* @throws CoreException
* @throws ConnectionProfileException
*/
- public static IServerWorkingCopy initJBossAS(String jbossASLocation, IProgressMonitor progressMonitor) throws CoreException, ConnectionProfileException {
- IRuntime runtime = createRuntime(null, jbossASLocation, progressMonitor, 2);
+ public static IServerWorkingCopy initJBossAS(String jbossASLocation,
+ IProgressMonitor progressMonitor) throws CoreException,
+ ConnectionProfileException {
+ IRuntime runtime = createRuntime(null, jbossASLocation,
+ progressMonitor, 2);
IServerWorkingCopy server = null;
if (runtime != null) {
server = createServer(progressMonitor, runtime, 2, null);
@@ -255,31 +253,40 @@
/**
* Creates new JBoss AS Runtime
- * @param jbossASLocation location of JBoss AS
+ *
+ * @param jbossASLocation
+ * location of JBoss AS
* @param progressMonitor
* @return runtime working copy
* @throws CoreException
*/
- private static IRuntime createRuntime(String runtimeName, String jbossASLocation, IProgressMonitor progressMonitor, int index) throws CoreException {
+ private static IRuntime createRuntime(String runtimeName,
+ String jbossASLocation, IProgressMonitor progressMonitor, int index)
+ throws CoreException {
IRuntimeWorkingCopy runtime = null;
String type = null;
String version = null;
String runtimeId = null;
IPath jbossAsLocationPath = new Path(jbossASLocation);
- IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(type, version, JBOSS_AS_RUNTIME_TYPE_ID[index]);
+ IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(type, version,
+ JBOSS_AS_RUNTIME_TYPE_ID[index]);
if (runtimeTypes.length > 0) {
runtime = runtimeTypes[0].createRuntime(runtimeId, progressMonitor);
runtime.setLocation(jbossAsLocationPath);
- if(runtimeName!=null) {
- runtime.setName(runtimeName);
+ if (runtimeName != null) {
+ runtime.setName(runtimeName);
}
IVMInstall defaultVM = JavaRuntime.getDefaultVMInstall();
// IJBossServerRuntime.PROPERTY_VM_ID
- ((RuntimeWorkingCopy) runtime).setAttribute("PROPERTY_VM_ID", defaultVM.getId());
+ ((RuntimeWorkingCopy) runtime).setAttribute("PROPERTY_VM_ID",
+ defaultVM.getId());
// IJBossServerRuntime.PROPERTY_VM_TYPE_ID
- ((RuntimeWorkingCopy) runtime).setAttribute("PROPERTY_VM_TYPE_ID", defaultVM.getVMInstallType().getId());
+ ((RuntimeWorkingCopy) runtime).setAttribute("PROPERTY_VM_TYPE_ID",
+ defaultVM.getVMInstallType().getId());
// IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME
- ((RuntimeWorkingCopy) runtime).setAttribute("org.jboss.ide.eclipse.as.core.runtime.configurationName", JBOSS_AS_DEFAULT_CONFIGURATION_NAME);
+ ((RuntimeWorkingCopy) runtime).setAttribute(
+ "org.jboss.ide.eclipse.as.core.runtime.configurationName",
+ JBOSS_AS_DEFAULT_CONFIGURATION_NAME);
return runtime.save(false, progressMonitor);
}
@@ -288,32 +295,49 @@
/**
* Creates new JBoss Server
+ *
* @param progressMonitor
- * @param runtime parent JBoss AS Runtime
+ * @param runtime
+ * parent JBoss AS Runtime
* @return server working copy
* @throws CoreException
*/
- private static IServerWorkingCopy createServer(IProgressMonitor progressMonitor, IRuntime runtime, int index, String name) throws CoreException {
- IServerType serverType = ServerCore.findServerType(JBOSS_AS_TYPE_ID[index]);
- IServerWorkingCopy server = serverType.createServer(null, null, runtime, progressMonitor);
+ private static IServerWorkingCopy createServer(
+ IProgressMonitor progressMonitor, IRuntime runtime, int index,
+ String name) throws CoreException {
+ 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)
+ if (name != null) {
server.setName(name);
- else
+ } else {
server.setName(JBOSS_AS_NAME[installedASIndex]);
-
+ }
+
// JBossServer.DEPLOY_DIRECTORY
- String deployVal = runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("deploy").toOSString();
- ((ServerWorkingCopy) server).setAttribute("org.jboss.ide.eclipse.as.core.server.deployDirectory", deployVal);
+ String deployVal = runtime.getLocation().append("server").append(
+ JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("deploy")
+ .toOSString();
+ ((ServerWorkingCopy) server).setAttribute(
+ "org.jboss.ide.eclipse.as.core.server.deployDirectory",
+ deployVal);
// IDeployableServer.TEMP_DEPLOY_DIRECTORY
- String deployTmpFolderVal = runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("tmp").append("jbosstoolsTemp").toOSString();
- ((ServerWorkingCopy) server).setAttribute("org.jboss.ide.eclipse.as.core.server.tempDeployDirectory", deployTmpFolderVal);
+ String deployTmpFolderVal = runtime.getLocation().append("server")
+ .append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("tmp")
+ .append("jbosstoolsTemp").toOSString();
+ ((ServerWorkingCopy) server).setAttribute(
+ "org.jboss.ide.eclipse.as.core.server.tempDeployDirectory",
+ deployTmpFolderVal);
// If we'd need to set up a username / pw for JMX, do it here.
-// ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_USERNAME, authUser);
-// ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_PASSWORD, authPass);
+ // ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_USERNAME,
+ // authUser);
+ // ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_PASSWORD,
+ // authPass);
server.save(false, progressMonitor);
return server;
@@ -323,28 +347,36 @@
/**
* Creates HSQL DB Driver
- * @param jbossASLocation location of JBoss AS
+ *
+ * @param jbossASLocation
+ * location of JBoss AS
* @throws ConnectionProfileException
* @return driver instance
*/
- private static void createDriver(String jbossASLocation) throws ConnectionProfileException {
- if(driverIsCreated) {
+ private static void createDriver(String jbossASLocation)
+ throws ConnectionProfileException {
+ if (driverIsCreated) {
// Don't create the driver a few times
return;
}
String driverPath;
try {
- driverPath = new File(jbossASLocation + "/server/default/lib/hsqldb.jar").getCanonicalPath();
+ driverPath = new File(jbossASLocation
+ + "/server/default/lib/hsqldb.jar").getCanonicalPath();
} catch (IOException e) {
- JstFirstRunPlugin.getPluginLog().log(new Status(IStatus.ERROR,
- JstFirstRunPlugin.PLUGIN_ID, "Can't create new HSQL DB Driver.", e));
+ JstFirstRunPlugin.getPluginLog().log(
+ new Status(IStatus.ERROR, JstFirstRunPlugin.PLUGIN_ID,
+ "Can't create new HSQL DB Driver.", e));
return;
}
- DriverInstance driver = DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
+ DriverInstance driver = DriverManager.getInstance()
+ .getDriverInstanceByName(HSQL_DRIVER_NAME);
if (driver == null) {
- TemplateDescriptor descr = TemplateDescriptor.getDriverTemplateDescriptor(HSQL_DRIVER_TEMPLATE_ID);
- IPropertySet instance = new PropertySetImpl(HSQL_DRIVER_NAME, HSQL_DRIVER_DEFINITION_ID);
+ TemplateDescriptor descr = TemplateDescriptor
+ .getDriverTemplateDescriptor(HSQL_DRIVER_TEMPLATE_ID);
+ IPropertySet instance = new PropertySetImpl(HSQL_DRIVER_NAME,
+ HSQL_DRIVER_DEFINITION_ID);
instance.setName(HSQL_DRIVER_NAME);
instance.setID(HSQL_DRIVER_DEFINITION_ID);
Properties props = new Properties();
@@ -358,8 +390,10 @@
props.setProperty(id, value == null ? "" : value);
}
props.setProperty(DTP_DB_URL_PROPERTY_ID, "jdbc:hsqldb:.");
- props.setProperty(IDriverMgmtConstants.PROP_DEFN_TYPE, descr.getId());
- props.setProperty(IDriverMgmtConstants.PROP_DEFN_JARLIST, driverPath);
+ props.setProperty(IDriverMgmtConstants.PROP_DEFN_TYPE, descr
+ .getId());
+ props.setProperty(IDriverMgmtConstants.PROP_DEFN_JARLIST,
+ driverPath);
instance.setBaseProperties(props);
DriverManager.getInstance().removeDriverInstance(instance.getID());
@@ -367,24 +401,59 @@
DriverManager.getInstance().addDriverInstance(instance);
}
- driver = DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
- if (driver != null && ProfileManager.getInstance().getProfileByName("DefaultDS") == null) {
+ driver = DriverManager.getInstance().getDriverInstanceByName(
+ HSQL_DRIVER_NAME);
+ if (driver != null
+ && ProfileManager.getInstance().getProfileByName("DefaultDS") == null) {
// create profile
Properties props = new Properties();
- props.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, HSQL_DRIVER_DEFINITION_ID);
- props.setProperty(IDBConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID, "");
- props.setProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID));
- props.setProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID));
- props.setProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID));
- props.setProperty(IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID, "Default");
- props.setProperty(IDBDriverDefinitionConstants.PASSWORD_PROP_ID, "");
- props.setProperty(IDBConnectionProfileConstants.SAVE_PASSWORD_PROP_ID, "false");
- props.setProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID));
- props.setProperty(IDBDriverDefinitionConstants.URL_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.URL_PROP_ID));
+ props.setProperty(
+ ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID,
+ HSQL_DRIVER_DEFINITION_ID);
+ props
+ .setProperty(
+ IJDBCConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID,
+ "");
+ props
+ .setProperty(
+ IJDBCDriverDefinitionConstants.DRIVER_CLASS_PROP_ID,
+ driver
+ .getProperty(IJDBCDriverDefinitionConstants.DRIVER_CLASS_PROP_ID));
+ props
+ .setProperty(
+ IJDBCDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID,
+ driver
+ .getProperty(IJDBCDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID));
+ props
+ .setProperty(
+ IJDBCDriverDefinitionConstants.DATABASE_VERSION_PROP_ID,
+ driver
+ .getProperty(IJDBCDriverDefinitionConstants.DATABASE_VERSION_PROP_ID));
+ props.setProperty(
+ IJDBCDriverDefinitionConstants.DATABASE_NAME_PROP_ID,
+ "Default");
+ props.setProperty(IJDBCDriverDefinitionConstants.PASSWORD_PROP_ID,
+ "");
+ props.setProperty(
+ IJDBCConnectionProfileConstants.SAVE_PASSWORD_PROP_ID,
+ "false");
+ props
+ .setProperty(
+ IJDBCDriverDefinitionConstants.USERNAME_PROP_ID,
+ driver
+ .getProperty(IJDBCDriverDefinitionConstants.USERNAME_PROP_ID));
+ props
+ .setProperty(
+ IJDBCDriverDefinitionConstants.URL_PROP_ID,
+ driver
+ .getProperty(IJDBCDriverDefinitionConstants.URL_PROP_ID));
- ProfileManager.getInstance().createProfile("DefaultDS", "The JBoss AS Hypersonic embedded database", IDBConnectionProfileConstants.CONNECTION_PROFILE_ID, props, "", false);
+ ProfileManager.getInstance().createProfile("DefaultDS",
+ "The JBoss AS Hypersonic embedded database",
+ IJDBCConnectionProfileConstants.CONNECTION_PROFILE_ID,
+ props, "", false);
}
- if(driver!=null) {
+ if (driver != null) {
driverIsCreated = true;
}
}
17 years, 4 months
JBoss Tools SVN: r12563 - trunk/jst/plugins/org.jboss.tools.jst.firstrun/src/org/jboss/tools/jst/firstrun.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-12-12 01:12:55 -0500 (Fri, 12 Dec 2008)
New Revision: 12563
Modified:
trunk/jst/plugins/org.jboss.tools.jst.firstrun/src/org/jboss/tools/jst/firstrun/JBossASAdapterInitializer.java
Log:
https://jira.jboss.org/jira/browse/JBDS-516
Modified: trunk/jst/plugins/org.jboss.tools.jst.firstrun/src/org/jboss/tools/jst/firstrun/JBossASAdapterInitializer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.firstrun/src/org/jboss/tools/jst/firstrun/JBossASAdapterInitializer.java 2008-12-11 22:08:03 UTC (rev 12562)
+++ trunk/jst/plugins/org.jboss.tools.jst.firstrun/src/org/jboss/tools/jst/firstrun/JBossASAdapterInitializer.java 2008-12-12 06:12:55 UTC (rev 12563)
@@ -11,7 +11,9 @@
package org.jboss.tools.jst.firstrun;
+import java.io.BufferedInputStream;
import java.io.File;
+import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
@@ -27,13 +29,13 @@
import org.eclipse.datatools.connectivity.ConnectionProfileConstants;
import org.eclipse.datatools.connectivity.ConnectionProfileException;
import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.datatools.connectivity.db.generic.IDBConnectionProfileConstants;
-import org.eclipse.datatools.connectivity.db.generic.IDBDriverDefinitionConstants;
import org.eclipse.datatools.connectivity.drivers.DriverInstance;
import org.eclipse.datatools.connectivity.drivers.DriverManager;
import org.eclipse.datatools.connectivity.drivers.IDriverMgmtConstants;
import org.eclipse.datatools.connectivity.drivers.IPropertySet;
import org.eclipse.datatools.connectivity.drivers.PropertySetImpl;
+import org.eclipse.datatools.connectivity.drivers.jdbc.IJDBCConnectionProfileConstants;
+import org.eclipse.datatools.connectivity.drivers.jdbc.IJDBCDriverDefinitionConstants;
import org.eclipse.datatools.connectivity.drivers.models.TemplateDescriptor;
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.JavaRuntime;
@@ -52,38 +54,29 @@
/**
* @author eskimo
- *
+ *
*/
public class JBossASAdapterInitializer implements IStartup {
- public static final String JBOSS_AS_HOME = "../../../../jboss-eap/jboss-as"; // JBoss AS home directory (relative to plugin)- <RHDS_HOME>/jbossas.
-
+ public static final String JBOSS_AS_HOME = "../../../../jboss-eap/jboss-as"; // JBoss
public static final String SERVERS_FILE = "../../../../studio/application_platforms.properties";
-
-
- // This constants are made to avoid dependency with org.jboss.ide.eclipse.as.core plugin
+
+ // 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",
- "org.jboss.ide.eclipse.as.runtime.40",
- "org.jboss.ide.eclipse.as.runtime.42",
- "org.jboss.ide.eclipse.as.runtime.50"
- };
+ "org.jboss.ide.eclipse.as.runtime.32",
+ "org.jboss.ide.eclipse.as.runtime.40",
+ "org.jboss.ide.eclipse.as.runtime.42",
+ "org.jboss.ide.eclipse.as.runtime.50" };
public static final String JBOSS_AS_TYPE_ID[] = {
- "org.jboss.ide.eclipse.as.32",
- "org.jboss.ide.eclipse.as.40",
- "org.jboss.ide.eclipse.as.42",
- "org.jboss.ide.eclipse.as.50"
- };
-
+ "org.jboss.ide.eclipse.as.32", "org.jboss.ide.eclipse.as.40",
+ "org.jboss.ide.eclipse.as.42", "org.jboss.ide.eclipse.as.50" };
public static final String JBOSS_AS_NAME[] = {
- "JBoss Application Server 3.2",
- "JBoss Application Server 4.0",
- "JBoss Application Server 4.2",
- "JBoss Application Server 5.0"
- };
-
+ "JBoss Application Server 3.2", "JBoss Application Server 4.0",
+ "JBoss Application Server 4.2", "JBoss Application Server 5.0" };
+
private static final int installedASIndex = 2;
public static final String JBOSS_AS_HOST = "localhost";
@@ -92,93 +85,81 @@
public static final String FIRST_START_PREFERENCE_NAME = "FIRST_START";
- public static final String HSQL_DRIVER_DEFINITION_ID
- = "DriverDefn.Hypersonic DB";
+ public static final String HSQL_DRIVER_DEFINITION_ID = "DriverDefn.Hypersonic DB";
public static final String HSQL_DRIVER_NAME = "Hypersonic DB";
- public static final String HSQL_DRIVER_TEMPLATE_ID
- = "org.eclipse.datatools.enablement.hsqldb.1_8.driver";
+ public static final String HSQL_DRIVER_TEMPLATE_ID = "org.eclipse.datatools.enablement.hsqldb.1_8.driver";
- public static final String DTP_DB_URL_PROPERTY_ID
- = "org.eclipse.datatools.connectivity.db.URL";
+ public static final String DTP_DB_URL_PROPERTY_ID = "org.eclipse.datatools.connectivity.db.URL";
+
/**
* @see org.eclipse.ui.IStartup#earlyStartup()
*/
public void earlyStartup() {
/*
- * If there are any problems with EAP not functioning the same as
+ * If there are any problems with EAP not functioning the same as
* servers created from scratch, THIS is the method to go to.
*
* Compare this method with JBossServerWizardFragment#performFinish()
*/
try {
- JstFirstRunPlugin.getDefault().getPreferenceStore().setDefault(FIRST_START_PREFERENCE_NAME, true);
- boolean firstStart = JstFirstRunPlugin.getDefault().getPreferenceStore().getBoolean(FIRST_START_PREFERENCE_NAME);
+ JstFirstRunPlugin.getDefault().getPreferenceStore().setDefault(
+ FIRST_START_PREFERENCE_NAME, true);
+ boolean firstStart = JstFirstRunPlugin.getDefault()
+ .getPreferenceStore().getBoolean(
+ FIRST_START_PREFERENCE_NAME);
+
if (!firstStart) {
return;
}
- JstFirstRunPlugin.getDefault().getPreferenceStore().setValue(FIRST_START_PREFERENCE_NAME, false);
- String pluginLocation = FileLocator.resolve(JstFirstRunPlugin.getDefault().getBundle().getEntry("/")).getPath();
- File serversFile = new File(pluginLocation, SERVERS_FILE).getCanonicalFile();
- if(serversFile.exists()){
- String str = FileUtil.readFile(serversFile);
+ JstFirstRunPlugin.getDefault().getPreferenceStore().setValue(
+ FIRST_START_PREFERENCE_NAME, false);
+ String pluginLocation = FileLocator.resolve(
+ JstFirstRunPlugin.getDefault().getBundle().getEntry("/"))
+ .getPath();
+ File serversFile = new File(pluginLocation, SERVERS_FILE)
+ .getCanonicalFile();
+ if (serversFile.exists()) {
+ Properties servers = new Properties();
+ servers.load(new BufferedInputStream(new FileInputStream(serversFile)));
int position = 0;
- while(true){
+ for (Object iterable_element : servers.keySet()) {
+ String str = servers.getProperty(iterable_element.toString());
String jbossASLocation = null;
-
- // server name
- int namePosition = str.indexOf("=",position+1);
- if(namePosition < 0) break;
-
- // server type
- int typePosition = str.indexOf(",",namePosition+1);
- if(position < 0) break;
-
- String name = str.substring(namePosition+1,typePosition).trim();
+ String[] params = str.split(",");
- // server version
- int versionPosition = str.indexOf(",",typePosition+1);
- if(versionPosition < 0) break;
+ String name = params[0];
+ String type = params[1];
+ String version = params[2];
+ jbossASLocation = params[3].trim();
- String type = str.substring(typePosition+1,versionPosition).trim();
-
- // server location
- position = str.indexOf(",",versionPosition+1);
- if(position < 0) break;
-
- String version = str.substring(versionPosition+1,position);
-
int index = 0;
- if(type.startsWith("AS")){
- if(version.startsWith("3.2"))
+ if (type.startsWith("AS")) {
+ if (version.startsWith("3.2")) {
index = 0;
- else if(version.startsWith("4.0"))
+ } else if (version.startsWith("4.0")) {
index = 1;
- else if(version.startsWith("4.2") || version.startsWith("4.3"))
+ } else if (version.startsWith("4.2")
+ || version.startsWith("4.3")) {
index = 2;
- else if(version.startsWith("5.0"))
+ } else if (version.startsWith("5.0")) {
index = 3;
- }else
+ }
+ } else {
index = 2;
+ }
+
+ if (!"AS".equals(type)) {
+ jbossASLocation = jbossASLocation + File.separatorChar + "jboss-as";
+ }
- int next = str.indexOf("server",position+1);
+ IRuntime runtime = createRuntime(name + " Runtime",
+ jbossASLocation, new NullProgressMonitor(), index);
- if(next < 0)
- jbossASLocation = str.substring(position+1,str.length()-1);
- else
- jbossASLocation = str.substring(position+1,next);
-
- jbossASLocation = jbossASLocation.trim();
-
- IRuntime runtime = null;
- IProgressMonitor progressMonitor = new NullProgressMonitor();
- if (runtime == null) {
- runtime = createRuntime(name + " Runtime", jbossASLocation, progressMonitor, index);
- }
if (runtime != null) {
- createServer(progressMonitor, runtime, index, name);
+ createServer(new NullProgressMonitor(), runtime, index, name);
}
createDriver(jbossASLocation);
@@ -186,8 +167,9 @@
}
String jbossASLocation = null;
-
- File jbossASDir = new File(pluginLocation, JBOSS_AS_HOME).getCanonicalFile();
+
+ File jbossASDir = new File(pluginLocation, JBOSS_AS_HOME)
+ .getCanonicalFile();
if (jbossASDir.isDirectory()) {
jbossASLocation = jbossASDir.getAbsolutePath();
} else {
@@ -199,7 +181,8 @@
IServer[] servers = ServerCore.getServers();
for (int i = 0; i < servers.length; i++) {
IRuntime runtime = servers[i].getRuntime();
- if(runtime != null && runtime.getLocation().equals(jbossAsLocationPath)) {
+ if (runtime != null
+ && runtime.getLocation().equals(jbossAsLocationPath)) {
return;
}
}
@@ -215,7 +198,8 @@
IProgressMonitor progressMonitor = new NullProgressMonitor();
if (runtime == null) {
- runtime = createRuntime(null, jbossASLocation, progressMonitor, 2);
+ runtime = createRuntime(null, jbossASLocation, progressMonitor,
+ 2);
}
if (runtime != null) {
createServer(progressMonitor, runtime, 2, null);
@@ -223,28 +207,42 @@
createDriver(jbossASLocation);
} catch (CoreException e) {
- JstFirstRunPlugin.getPluginLog().log(new Status(IStatus.ERROR,
- JstFirstRunPlugin.PLUGIN_ID, "Can't create new JBoss Server", e));
+ JstFirstRunPlugin.getPluginLog().log(
+ new Status(IStatus.ERROR, JstFirstRunPlugin.PLUGIN_ID,
+ "Can't create new JBoss Server", e));
} catch (IOException e) {
- JstFirstRunPlugin.getPluginLog().log(new Status(IStatus.ERROR,
- JstFirstRunPlugin.PLUGIN_ID, "Can't create new JBoss Server", e));
+ JstFirstRunPlugin.getPluginLog().log(
+ new Status(IStatus.ERROR, JstFirstRunPlugin.PLUGIN_ID,
+ "Can't create new JBoss Server", e));
} catch (ConnectionProfileException e) {
- JstFirstRunPlugin.getPluginLog().log(new Status(IStatus.ERROR,
- JstFirstRunPlugin.PLUGIN_ID, "Can't create new DTP "
- + "Connection Profile for JBoss AS Hypersonic embedded database", e));
+ JstFirstRunPlugin
+ .getPluginLog()
+ .log(
+ new Status(
+ IStatus.ERROR,
+ JstFirstRunPlugin.PLUGIN_ID,
+ "Can't create new DTP "
+ + "Connection Profile for JBoss AS Hypersonic embedded database",
+ e));
}
}
/**
* Creates new JBoss AS Runtime, Server and hsqldb driver
- * @param jbossASLocation location of JBoss Server
- * @param progressMonitor to report progress
+ *
+ * @param jbossASLocation
+ * location of JBoss Server
+ * @param progressMonitor
+ * to report progress
* @return server working copy
* @throws CoreException
* @throws ConnectionProfileException
*/
- public static IServerWorkingCopy initJBossAS(String jbossASLocation, IProgressMonitor progressMonitor) throws CoreException, ConnectionProfileException {
- IRuntime runtime = createRuntime(null, jbossASLocation, progressMonitor, 2);
+ public static IServerWorkingCopy initJBossAS(String jbossASLocation,
+ IProgressMonitor progressMonitor) throws CoreException,
+ ConnectionProfileException {
+ IRuntime runtime = createRuntime(null, jbossASLocation,
+ progressMonitor, 2);
IServerWorkingCopy server = null;
if (runtime != null) {
server = createServer(progressMonitor, runtime, 2, null);
@@ -255,31 +253,40 @@
/**
* Creates new JBoss AS Runtime
- * @param jbossASLocation location of JBoss AS
+ *
+ * @param jbossASLocation
+ * location of JBoss AS
* @param progressMonitor
* @return runtime working copy
* @throws CoreException
*/
- private static IRuntime createRuntime(String runtimeName, String jbossASLocation, IProgressMonitor progressMonitor, int index) throws CoreException {
+ private static IRuntime createRuntime(String runtimeName,
+ String jbossASLocation, IProgressMonitor progressMonitor, int index)
+ throws CoreException {
IRuntimeWorkingCopy runtime = null;
String type = null;
String version = null;
String runtimeId = null;
IPath jbossAsLocationPath = new Path(jbossASLocation);
- IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(type, version, JBOSS_AS_RUNTIME_TYPE_ID[index]);
+ IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(type, version,
+ JBOSS_AS_RUNTIME_TYPE_ID[index]);
if (runtimeTypes.length > 0) {
runtime = runtimeTypes[0].createRuntime(runtimeId, progressMonitor);
runtime.setLocation(jbossAsLocationPath);
- if(runtimeName!=null) {
- runtime.setName(runtimeName);
+ if (runtimeName != null) {
+ runtime.setName(runtimeName);
}
IVMInstall defaultVM = JavaRuntime.getDefaultVMInstall();
// IJBossServerRuntime.PROPERTY_VM_ID
- ((RuntimeWorkingCopy) runtime).setAttribute("PROPERTY_VM_ID", defaultVM.getId());
+ ((RuntimeWorkingCopy) runtime).setAttribute("PROPERTY_VM_ID",
+ defaultVM.getId());
// IJBossServerRuntime.PROPERTY_VM_TYPE_ID
- ((RuntimeWorkingCopy) runtime).setAttribute("PROPERTY_VM_TYPE_ID", defaultVM.getVMInstallType().getId());
+ ((RuntimeWorkingCopy) runtime).setAttribute("PROPERTY_VM_TYPE_ID",
+ defaultVM.getVMInstallType().getId());
// IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME
- ((RuntimeWorkingCopy) runtime).setAttribute("org.jboss.ide.eclipse.as.core.runtime.configurationName", JBOSS_AS_DEFAULT_CONFIGURATION_NAME);
+ ((RuntimeWorkingCopy) runtime).setAttribute(
+ "org.jboss.ide.eclipse.as.core.runtime.configurationName",
+ JBOSS_AS_DEFAULT_CONFIGURATION_NAME);
return runtime.save(false, progressMonitor);
}
@@ -288,32 +295,49 @@
/**
* Creates new JBoss Server
+ *
* @param progressMonitor
- * @param runtime parent JBoss AS Runtime
+ * @param runtime
+ * parent JBoss AS Runtime
* @return server working copy
* @throws CoreException
*/
- private static IServerWorkingCopy createServer(IProgressMonitor progressMonitor, IRuntime runtime, int index, String name) throws CoreException {
- IServerType serverType = ServerCore.findServerType(JBOSS_AS_TYPE_ID[index]);
- IServerWorkingCopy server = serverType.createServer(null, null, runtime, progressMonitor);
+ private static IServerWorkingCopy createServer(
+ IProgressMonitor progressMonitor, IRuntime runtime, int index,
+ String name) throws CoreException {
+ 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)
+ if (name != null) {
server.setName(name);
- else
+ } else {
server.setName(JBOSS_AS_NAME[installedASIndex]);
-
+ }
+
// JBossServer.DEPLOY_DIRECTORY
- String deployVal = runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("deploy").toOSString();
- ((ServerWorkingCopy) server).setAttribute("org.jboss.ide.eclipse.as.core.server.deployDirectory", deployVal);
+ String deployVal = runtime.getLocation().append("server").append(
+ JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("deploy")
+ .toOSString();
+ ((ServerWorkingCopy) server).setAttribute(
+ "org.jboss.ide.eclipse.as.core.server.deployDirectory",
+ deployVal);
// IDeployableServer.TEMP_DEPLOY_DIRECTORY
- String deployTmpFolderVal = runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("tmp").append("jbosstoolsTemp").toOSString();
- ((ServerWorkingCopy) server).setAttribute("org.jboss.ide.eclipse.as.core.server.tempDeployDirectory", deployTmpFolderVal);
+ String deployTmpFolderVal = runtime.getLocation().append("server")
+ .append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("tmp")
+ .append("jbosstoolsTemp").toOSString();
+ ((ServerWorkingCopy) server).setAttribute(
+ "org.jboss.ide.eclipse.as.core.server.tempDeployDirectory",
+ deployTmpFolderVal);
// If we'd need to set up a username / pw for JMX, do it here.
-// ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_USERNAME, authUser);
-// ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_PASSWORD, authPass);
+ // ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_USERNAME,
+ // authUser);
+ // ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_PASSWORD,
+ // authPass);
server.save(false, progressMonitor);
return server;
@@ -323,28 +347,36 @@
/**
* Creates HSQL DB Driver
- * @param jbossASLocation location of JBoss AS
+ *
+ * @param jbossASLocation
+ * location of JBoss AS
* @throws ConnectionProfileException
* @return driver instance
*/
- private static void createDriver(String jbossASLocation) throws ConnectionProfileException {
- if(driverIsCreated) {
+ private static void createDriver(String jbossASLocation)
+ throws ConnectionProfileException {
+ if (driverIsCreated) {
// Don't create the driver a few times
return;
}
String driverPath;
try {
- driverPath = new File(jbossASLocation + "/server/default/lib/hsqldb.jar").getCanonicalPath();
+ driverPath = new File(jbossASLocation
+ + "/server/default/lib/hsqldb.jar").getCanonicalPath();
} catch (IOException e) {
- JstFirstRunPlugin.getPluginLog().log(new Status(IStatus.ERROR,
- JstFirstRunPlugin.PLUGIN_ID, "Can't create new HSQL DB Driver.", e));
+ JstFirstRunPlugin.getPluginLog().log(
+ new Status(IStatus.ERROR, JstFirstRunPlugin.PLUGIN_ID,
+ "Can't create new HSQL DB Driver.", e));
return;
}
- DriverInstance driver = DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
+ DriverInstance driver = DriverManager.getInstance()
+ .getDriverInstanceByName(HSQL_DRIVER_NAME);
if (driver == null) {
- TemplateDescriptor descr = TemplateDescriptor.getDriverTemplateDescriptor(HSQL_DRIVER_TEMPLATE_ID);
- IPropertySet instance = new PropertySetImpl(HSQL_DRIVER_NAME, HSQL_DRIVER_DEFINITION_ID);
+ TemplateDescriptor descr = TemplateDescriptor
+ .getDriverTemplateDescriptor(HSQL_DRIVER_TEMPLATE_ID);
+ IPropertySet instance = new PropertySetImpl(HSQL_DRIVER_NAME,
+ HSQL_DRIVER_DEFINITION_ID);
instance.setName(HSQL_DRIVER_NAME);
instance.setID(HSQL_DRIVER_DEFINITION_ID);
Properties props = new Properties();
@@ -358,8 +390,10 @@
props.setProperty(id, value == null ? "" : value);
}
props.setProperty(DTP_DB_URL_PROPERTY_ID, "jdbc:hsqldb:.");
- props.setProperty(IDriverMgmtConstants.PROP_DEFN_TYPE, descr.getId());
- props.setProperty(IDriverMgmtConstants.PROP_DEFN_JARLIST, driverPath);
+ props.setProperty(IDriverMgmtConstants.PROP_DEFN_TYPE, descr
+ .getId());
+ props.setProperty(IDriverMgmtConstants.PROP_DEFN_JARLIST,
+ driverPath);
instance.setBaseProperties(props);
DriverManager.getInstance().removeDriverInstance(instance.getID());
@@ -367,24 +401,59 @@
DriverManager.getInstance().addDriverInstance(instance);
}
- driver = DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
- if (driver != null && ProfileManager.getInstance().getProfileByName("DefaultDS") == null) {
+ driver = DriverManager.getInstance().getDriverInstanceByName(
+ HSQL_DRIVER_NAME);
+ if (driver != null
+ && ProfileManager.getInstance().getProfileByName("DefaultDS") == null) {
// create profile
Properties props = new Properties();
- props.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, HSQL_DRIVER_DEFINITION_ID);
- props.setProperty(IDBConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID, "");
- props.setProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID));
- props.setProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID));
- props.setProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID));
- props.setProperty(IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID, "Default");
- props.setProperty(IDBDriverDefinitionConstants.PASSWORD_PROP_ID, "");
- props.setProperty(IDBConnectionProfileConstants.SAVE_PASSWORD_PROP_ID, "false");
- props.setProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID));
- props.setProperty(IDBDriverDefinitionConstants.URL_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.URL_PROP_ID));
+ props.setProperty(
+ ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID,
+ HSQL_DRIVER_DEFINITION_ID);
+ props
+ .setProperty(
+ IJDBCConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID,
+ "");
+ props
+ .setProperty(
+ IJDBCDriverDefinitionConstants.DRIVER_CLASS_PROP_ID,
+ driver
+ .getProperty(IJDBCDriverDefinitionConstants.DRIVER_CLASS_PROP_ID));
+ props
+ .setProperty(
+ IJDBCDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID,
+ driver
+ .getProperty(IJDBCDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID));
+ props
+ .setProperty(
+ IJDBCDriverDefinitionConstants.DATABASE_VERSION_PROP_ID,
+ driver
+ .getProperty(IJDBCDriverDefinitionConstants.DATABASE_VERSION_PROP_ID));
+ props.setProperty(
+ IJDBCDriverDefinitionConstants.DATABASE_NAME_PROP_ID,
+ "Default");
+ props.setProperty(IJDBCDriverDefinitionConstants.PASSWORD_PROP_ID,
+ "");
+ props.setProperty(
+ IJDBCConnectionProfileConstants.SAVE_PASSWORD_PROP_ID,
+ "false");
+ props
+ .setProperty(
+ IJDBCDriverDefinitionConstants.USERNAME_PROP_ID,
+ driver
+ .getProperty(IJDBCDriverDefinitionConstants.USERNAME_PROP_ID));
+ props
+ .setProperty(
+ IJDBCDriverDefinitionConstants.URL_PROP_ID,
+ driver
+ .getProperty(IJDBCDriverDefinitionConstants.URL_PROP_ID));
- ProfileManager.getInstance().createProfile("DefaultDS", "The JBoss AS Hypersonic embedded database", IDBConnectionProfileConstants.CONNECTION_PROFILE_ID, props, "", false);
+ ProfileManager.getInstance().createProfile("DefaultDS",
+ "The JBoss AS Hypersonic embedded database",
+ IJDBCConnectionProfileConstants.CONNECTION_PROFILE_ID,
+ props, "", false);
}
- if(driver!=null) {
+ if (driver != null) {
driverIsCreated = true;
}
}
17 years, 4 months
JBoss Tools SVN: r12562 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-12-11 17:08:03 -0500 (Thu, 11 Dec 2008)
New Revision: 12562
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/wizard/NewJpdl4FileWizard.java
Log:
make sure the jpdl editor opens on the newly created file
also open the properties view
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java 2008-12-11 20:49:27 UTC (rev 12561)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java 2008-12-11 22:08:03 UTC (rev 12562)
@@ -12,6 +12,8 @@
import org.jboss.tools.flow.common.wrapper.Wrapper;
public class JpdlEditor extends GenericModelEditor {
+
+ public static String ID = "org.jboss.tools.flow.jpdl4.editor";
protected EditPartFactory createEditPartFactory() {
return new DefaultEditPartFactory();
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/wizard/NewJpdl4FileWizard.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/wizard/NewJpdl4FileWizard.java 2008-12-11 20:49:27 UTC (rev 12561)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/wizard/NewJpdl4FileWizard.java 2008-12-11 22:08:03 UTC (rev 12562)
@@ -4,9 +4,20 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWizard;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
+import org.jboss.tools.flow.jpdl4.Logger;
+import org.jboss.tools.flow.jpdl4.editor.JpdlEditor;
public class NewJpdl4FileWizard extends Wizard implements IWorkbenchWizard {
+
+ private static String ID_PROP_SHEET = "org.eclipse.ui.views.PropertySheet";
private IStructuredSelection selection;
private NewJpdl4FileWizardPage newFileWizardPage;
@@ -21,15 +32,33 @@
addPage(newFileWizardPage);
}
+ private IWorkbenchWindow getActiveWindow() {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ return workbench == null ? null : workbench.getActiveWorkbenchWindow();
+ }
+
+ private IWorkbenchPage getActivePage() {
+ IWorkbenchWindow window = getActiveWindow();
+ return window == null ? null: window.getActivePage();
+ }
+
@Override
public boolean performFinish() {
IFile file = newFileWizardPage.createNewFile();
- if (file != null)
- return true;
- else
- return false;
+ IWorkbenchPage activePage = getActivePage();
+ if (file != null && activePage != null) {
+ try {
+ IDE.openEditor(activePage, file);
+ activePage.showView(ID_PROP_SHEET);
+ BasicNewResourceWizard.selectAndReveal(file, getActiveWindow());
+ return true;
+ } catch (PartInitException e) {
+ Logger.logError("Exception while opening jPDL 4 editor", e);
+ }
+ }
+ return false;
}
-
+
public void init(IWorkbench workbench, IStructuredSelection selection) {
this.selection = selection;
}
17 years, 4 months
JBoss Tools SVN: r12561 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core: META-INF and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-12-11 15:49:27 -0500 (Thu, 11 Dec 2008)
New Revision: 12561
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/log/
trunk/as/plugins/org.jboss.ide.eclipse.as.core/log/log4j.xml
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/.classpath
trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.core/build.properties
Log:
JBIDE-3393 - hinder / hide output from locally-loaded jmx security classes
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/.classpath
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/.classpath 2008-12-11 19:35:06 UTC (rev 12560)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/.classpath 2008-12-11 20:49:27 UTC (rev 12561)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="jbosscore"/>
+ <classpathentry exported="true" kind="lib" path="log/"/>
<classpathentry exported="true" kind="lib" path="dom4j-1.6.1.jar"/>
<classpathentry exported="true" kind="lib" path="jaxen-1.1-beta-6.jar"/>
<classpathentry exported="true" kind="lib" path="getopt.jar"/>
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2008-12-11 19:35:06 UTC (rev 12560)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2008-12-11 20:49:27 UTC (rev 12561)
@@ -38,5 +38,6 @@
Bundle-ClassPath: dom4j-1.6.1.jar,
jaxen-1.1-beta-6.jar,
jbossascore.jar,
- getopt.jar
+ getopt.jar,
+ log/
Bundle-Vendor: JBoss, a division of Red Hat
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/build.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/build.properties 2008-12-11 19:35:06 UTC (rev 12560)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/build.properties 2008-12-11 20:49:27 UTC (rev 12561)
@@ -9,5 +9,6 @@
schema/,\
getopt.jar,\
properties/,\
- dtd/
+ dtd/,\
+ log/
source.jbossascore.jar = jbosscore/
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/log/log4j.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/log/log4j.xml (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/log/log4j.xml 2008-12-11 20:49:27 UTC (rev 12561)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd" >
+<log4j:configuration>
+ <appender name="noAppender" class="org.apache.log4j.varia.NullAppender">
+ <layout class="org.apache.log4j.SimpleLayout"></layout>
+ </appender>
+ <root>
+ <priority value="debug"></priority>
+ <appender-ref ref="noAppender"/>
+ </root>
+</log4j:configuration>
\ No newline at end of file
17 years, 4 months