JBoss Tools SVN: r17300 - trunk/drools/docs/reference.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-08-27 06:03:59 -0400 (Thu, 27 Aug 2009)
New Revision: 17300
Modified:
trunk/drools/docs/reference/pom.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-810 - pom.xml update;
Modified: trunk/drools/docs/reference/pom.xml
===================================================================
--- trunk/drools/docs/reference/pom.xml 2009-08-27 10:03:34 UTC (rev 17299)
+++ trunk/drools/docs/reference/pom.xml 2009-08-27 10:03:59 UTC (rev 17300)
@@ -33,8 +33,8 @@
<id>releaseJBDS</id>
<properties>
<master>master_output.xml</master>
- <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release-nomarker.xsl</xsl-single>
- <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release-nomarker.xsl</xsl-chunked>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release.xsl</xsl-chunked>
<xsl-pdf>classpath:/xslt/com/jboss/tools/pdf.xsl</xsl-pdf>
<cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/com/css/</cssdir>
</properties>
15 years, 5 months
JBoss Tools SVN: r17299 - trunk/as/docs/reference.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-08-27 06:03:34 -0400 (Thu, 27 Aug 2009)
New Revision: 17299
Modified:
trunk/as/docs/reference/pom.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-810 - pom.xml update;
Modified: trunk/as/docs/reference/pom.xml
===================================================================
--- trunk/as/docs/reference/pom.xml 2009-08-27 10:03:07 UTC (rev 17298)
+++ trunk/as/docs/reference/pom.xml 2009-08-27 10:03:34 UTC (rev 17299)
@@ -33,8 +33,8 @@
<id>releaseJBDS</id>
<properties>
<master>master_output.xml</master>
- <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release-nomarker.xsl</xsl-single>
- <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release-nomarker.xsl</xsl-chunked>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release.xsl</xsl-chunked>
<xsl-pdf>classpath:/xslt/com/jboss/tools/pdf.xsl</xsl-pdf>
<cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/com/css/</cssdir>
</properties>
15 years, 5 months
JBoss Tools SVN: r17298 - trunk/documentation/guides/Exadel-migration.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-08-27 06:03:07 -0400 (Thu, 27 Aug 2009)
New Revision: 17298
Modified:
trunk/documentation/guides/Exadel-migration/pom.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-810 - pom.xml update;
Modified: trunk/documentation/guides/Exadel-migration/pom.xml
===================================================================
--- trunk/documentation/guides/Exadel-migration/pom.xml 2009-08-27 10:02:18 UTC (rev 17297)
+++ trunk/documentation/guides/Exadel-migration/pom.xml 2009-08-27 10:03:07 UTC (rev 17298)
@@ -33,8 +33,8 @@
<id>releaseJBDS</id>
<properties>
<master>master_output.xml</master>
- <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release-nomarker.xsl</xsl-single>
- <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release-nomarker.xsl</xsl-chunked>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release.xsl</xsl-chunked>
<xsl-pdf>classpath:/xslt/com/jboss/tools/pdf.xsl</xsl-pdf>
<cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/com/css/</cssdir>
</properties>
15 years, 5 months
JBoss Tools SVN: r17297 - trunk/documentation/guides/GettingStartedGuide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-08-27 06:02:18 -0400 (Thu, 27 Aug 2009)
New Revision: 17297
Modified:
trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml
trunk/documentation/guides/GettingStartedGuide/en/modules/manage.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-836 - updating the chapters according to the EAP 5 support added;
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml 2009-08-27 10:01:15 UTC (rev 17296)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml 2009-08-27 10:02:18 UTC (rev 17297)
@@ -396,17 +396,6 @@
</para></listitem>
</itemizedlist>
-
- <figure>
- <title>List of Servers Added</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/getting_started/getting_started_3_3.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para/>
-
<itemizedlist>
<listitem> <para>You can also add servers one by one using the <emphasis><property>Add</property></emphasis> button:</para>
</listitem>
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/manage.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/manage.xml 2009-08-27 10:01:15 UTC (rev 17296)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/manage.xml 2009-08-27 10:02:18 UTC (rev 17297)
@@ -25,7 +25,19 @@
<?dbhtml filename="JBossbundled.html"?>
<title>How to Manage the JBoss AS Bundled in JBDS</title>
<para>This section covers the basics of working with the <property>JBoss Server</property>
- supported directly by <property>JBDS</property> via bundled AS plug-in. To read more
+ supported directly by <property>JBDS</property> via bundled AS plug-in. The server points to
+ the JBoss Enterprise Application Platform 5.0 Runtime shipped with <property>JBDS</property>.</para>
+
+ <figure>
+ <title>JBoss EAP 5.0 Runtime</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/manage/eap5runtime.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>To read more
about AS plug-in, refer to the <ulink url="&aslink;">Server Manager
guide</ulink>.</para>
15 years, 5 months
JBoss Tools SVN: r17296 - trunk/documentation/guides/GettingStartedGuide/en/images/manage.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-08-27 06:01:15 -0400 (Thu, 27 Aug 2009)
New Revision: 17296
Added:
trunk/documentation/guides/GettingStartedGuide/en/images/manage/eap5runtime.png
Log:
https://jira.jboss.org/jira/browse/JBDS-836 - adding a new image;
Added: trunk/documentation/guides/GettingStartedGuide/en/images/manage/eap5runtime.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/guides/GettingStartedGuide/en/images/manage/eap5runtime.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 5 months
JBoss Tools SVN: r17294 - trunk/documentation/guides/GettingStartedGuide.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-08-27 05:59:53 -0400 (Thu, 27 Aug 2009)
New Revision: 17294
Modified:
trunk/documentation/guides/GettingStartedGuide/pom.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-810 - pom.xml update;
Modified: trunk/documentation/guides/GettingStartedGuide/pom.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/pom.xml 2009-08-27 09:46:54 UTC (rev 17293)
+++ trunk/documentation/guides/GettingStartedGuide/pom.xml 2009-08-27 09:59:53 UTC (rev 17294)
@@ -24,8 +24,8 @@
<id>releaseJBDS</id>
<properties>
<master>master_output.xml</master>
- <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release-nomarker.xsl</xsl-single>
- <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release-nomarker.xsl</xsl-chunked>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release.xsl</xsl-chunked>
<xsl-pdf>classpath:/xslt/com/jboss/tools/pdf.xsl</xsl-pdf>
<cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/com/css/</cssdir>
</properties>
15 years, 5 months
JBoss Tools SVN: r17293 - in trunk/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean12 and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-08-27 05:46:54 -0400 (Thu, 27 Aug 2009)
New Revision: 17293
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/ResourceConfigChildNodeEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/ResourceConfigEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/ResourceConfigChildNodeGraphModelImpl.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/ResourceConfigGraphModelImpl.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/javabean12/impl/Javabean12PackageImpl.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean12/Javabean12ExpressionUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/model/TreeNodeModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/GraphicalModelFactoryImpl.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/ResourceConfigEditFactory.java
Log:
JBIDE-4648
Fix some bugs when create graphical model
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/javabean12/impl/Javabean12PackageImpl.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/javabean12/impl/Javabean12PackageImpl.java 2009-08-27 08:47:38 UTC (rev 17292)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/javabean12/impl/Javabean12PackageImpl.java 2009-08-27 09:46:54 UTC (rev 17293)
@@ -943,7 +943,7 @@
source,
new String[] {
"name", "expression_._type",
- "kind", "simple"
+ "kind", "mixed"
});
addAnnotation
(getExpressionType_Value(),
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean12/Javabean12ExpressionUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean12/Javabean12ExpressionUICreator.java 2009-08-27 08:47:38 UTC (rev 17292)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean12/Javabean12ExpressionUICreator.java 2009-08-27 09:46:54 UTC (rev 17293)
@@ -54,7 +54,7 @@
public List<AttributeFieldEditPart> createExtendUIOnBottom(AdapterFactoryEditingDomain editingdomain,
FormToolkit toolkit, Composite parent, Object model, ISmooksModelProvider formEditor, IEditorPart part) {
List<AttributeFieldEditPart> list = new ArrayList<AttributeFieldEditPart>();
- AttributeFieldEditPart cdatatext = SmooksUIUtils.createCDATAFieldEditor("Expression", editingdomain, toolkit,
+ AttributeFieldEditPart cdatatext = SmooksUIUtils.createTextFieldEditor("Expression", editingdomain, toolkit,
parent, model, null, true);
if (cdatatext != null) {
list.add(cdatatext);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-08-27 08:47:38 UTC (rev 17292)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-08-27 09:46:54 UTC (rev 17293)
@@ -1041,7 +1041,22 @@
}
return null;
}
+
+ public static AttributeFieldEditPart createTextFieldEditor(String label,
+ AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model,
+ OpenEditorEditInnerContentsAction action) {
+ return createStringFieldEditor(label, parent, editingdomain, toolkit, null, model, true, true, false, 300,
+ null, VALUE_TYPE_TEXT, action);
+ }
+ public static AttributeFieldEditPart createTextFieldEditor(String label,
+ AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model,
+ OpenEditorEditInnerContentsAction action, boolean expanedEditor) {
+ return createStringFieldEditor(label, parent, editingdomain, toolkit, null, model, true, true, false, 300,
+ null, VALUE_TYPE_TEXT, action, expanedEditor);
+ }
+
+
public static AttributeFieldEditPart createCDATAFieldEditor(String label,
AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model,
OpenEditorEditInnerContentsAction action) {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/model/TreeNodeModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/model/TreeNodeModel.java 2009-08-27 08:47:38 UTC (rev 17292)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/model/TreeNodeModel.java 2009-08-27 09:46:54 UTC (rev 17293)
@@ -29,7 +29,7 @@
}
return true;
}
-
+
public ITreeContentProvider getContentProvider() {
return contentProvider;
}
@@ -60,8 +60,10 @@
for (int i = 0; i < models.length; i++) {
Object model = models[i];
TreeNodeModel n = createChildModel(model, contentProvider, labelProvider);
- children.add(n);
- n.setParent(this);
+ if (n != null) {
+ children.add(n);
+ n.setParent(this);
+ }
}
return children;
}
@@ -73,11 +75,13 @@
if (models != null) {
for (int i = 0; i < models.length; i++) {
Object model = models[i];
-// model = AdapterFactoryEditingDomain.unwrap(model);
+ // model = AdapterFactoryEditingDomain.unwrap(model);
if (!childExsit(model)) {
TreeNodeModel n = createChildModel(model, contentProvider, labelProvider);
- children.add(n);
- n.setParent(this);
+ if (n != null) {
+ children.add(n);
+ n.setParent(this);
+ }
}
}
List<AbstractSmooksGraphicalModel> temp = new ArrayList<AbstractSmooksGraphicalModel>(children);
@@ -98,7 +102,6 @@
return children;
}
-
public String getText() {
if (data != null && labelProvider != null) {
return labelProvider.getText(data);
@@ -113,13 +116,13 @@
return null;
}
-// public boolean isLinkable() {
-// return linkable;
-// }
-//
-// public void setLinkable(boolean linkable) {
-// this.linkable = linkable;
-// }
+ // public boolean isLinkable() {
+ // return linkable;
+ // }
+ //
+ // public void setLinkable(boolean linkable) {
+ // this.linkable = linkable;
+ // }
public boolean canLinkWithSource(Object model) {
return true;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/GraphicalModelFactoryImpl.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/GraphicalModelFactoryImpl.java 2009-08-27 08:47:38 UTC (rev 17292)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/GraphicalModelFactoryImpl.java 2009-08-27 09:46:54 UTC (rev 17293)
@@ -10,119 +10,128 @@
******************************************************************************/
package org.jboss.tools.smooks.graphical.editors;
+import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
-import org.jboss.tools.smooks.configuration.editors.GraphicsConstants;
import org.jboss.tools.smooks.editor.ISmooksModelProvider;
import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
import org.jboss.tools.smooks.graphical.editors.model.JavaBeanGraphModel;
+import org.jboss.tools.smooks.graphical.editors.model.ResourceConfigGraphModelImpl;
import org.jboss.tools.smooks.model.javabean.BindingsType;
import org.jboss.tools.smooks.model.javabean.ExpressionType;
import org.jboss.tools.smooks.model.javabean.ValueType;
import org.jboss.tools.smooks.model.javabean.WiringType;
import org.jboss.tools.smooks.model.javabean12.BeanType;
+import org.jboss.tools.smooks.model.smooks.AbstractResourceConfig;
/**
* @author Dart
*
*/
public class GraphicalModelFactoryImpl implements GraphicalModelFactory {
- public Object createGraphicalModel(Object model, ISmooksModelProvider provider) {
- AbstractSmooksGraphicalModel graphModel = null;
- if (model instanceof BindingsType || model instanceof BeanType) {
- AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain) provider.getEditingDomain();
- ITreeContentProvider contentProvider = new AdapterFactoryContentProvider(editingDomain.getAdapterFactory());
- final ILabelProvider labelProvider = new AdapterFactoryLabelProvider(editingDomain.getAdapterFactory());
- LabelProvider labelProvider1 = new LabelProvider() {
- @Override
- public Image getImage(Object element) {
- element = AdapterFactoryEditingDomain.unwrap(element);
- if (element instanceof BeanType || element instanceof BindingsType) {
- return SmooksConfigurationActivator.getDefault().getImageRegistry().get(
- GraphicsConstants.IMAGE_JAVA_BEAN);
- }
- Image img = super.getImage(element);
- if (img == null) {
- return labelProvider.getImage(element);
- }
- return img;
+ public GraphicalModelFactoryImpl() {
+ }
+
+ private ILabelProvider createLabelProvider(AdapterFactory factory) {
+ return new AdapterFactoryLabelProvider(factory) {
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider
+ * #getText(java.lang.Object)
+ */
+ @Override
+ public String getText(Object object) {
+ String label = getGraphLabelText(object);
+ if (label == null) {
+ return super.getText(object);
}
+ return label;
+ }
- @Override
- public String getText(Object element) {
- Object obj = AdapterFactoryEditingDomain.unwrap(element);
- if (obj instanceof BeanType) {
- String p = ((BeanType) obj).getBeanId();
- if (p == null) {
- p = "<NULL>";
- }
- return p;
- }
- if (obj instanceof BindingsType) {
- String p = ((BindingsType) obj).getBeanId();
- if (p == null) {
- p = "<NULL>";
- }
- return p;
- }
+ };
+ }
- if (obj instanceof ValueType) {
- String p = ((ValueType) obj).getProperty();
- if (p == null) {
- p = "<NULL>";
- }
- return p;
- }
- if (obj instanceof WiringType) {
- String p = ((WiringType) obj).getProperty();
- if (p == null) {
- p = "<NULL>";
- }
- return p;
- }
- if (obj instanceof ExpressionType) {
- String p = ((ExpressionType) obj).getProperty();
- if (p == null) {
- p = "<NULL>";
- }
- return p;
- }
+ private String getGraphLabelText(Object element) {
+ Object obj = AdapterFactoryEditingDomain.unwrap(element);
+ if (obj instanceof BeanType) {
+ String p = ((BeanType) obj).getBeanId();
+ if (p == null) {
+ p = "<NULL>";
+ }
+ return p;
+ }
+ if (obj instanceof BindingsType) {
+ String p = ((BindingsType) obj).getBeanId();
+ if (p == null) {
+ p = "<NULL>";
+ }
+ return p;
+ }
- if (obj instanceof org.jboss.tools.smooks.model.javabean12.ValueType) {
- String p = ((org.jboss.tools.smooks.model.javabean12.ValueType) obj).getProperty();
- if (p == null) {
- p = "<NULL>";
- }
- return p;
- }
- if (obj instanceof org.jboss.tools.smooks.model.javabean12.WiringType) {
- String p = ((org.jboss.tools.smooks.model.javabean12.WiringType) obj).getProperty();
- if (p == null) {
- p = "<NULL>";
- }
- return p;
- }
- if (obj instanceof org.jboss.tools.smooks.model.javabean12.ExpressionType) {
- String p = ((org.jboss.tools.smooks.model.javabean12.ExpressionType) obj).getProperty();
- if (p == null) {
- p = "<NULL>";
- }
- return p;
- }
+ if (obj instanceof ValueType) {
+ String p = ((ValueType) obj).getProperty();
+ if (p == null) {
+ p = "<NULL>";
+ }
+ return p;
+ }
+ if (obj instanceof WiringType) {
+ String p = ((WiringType) obj).getProperty();
+ if (p == null) {
+ p = "<NULL>";
+ }
+ return p;
+ }
+ if (obj instanceof ExpressionType) {
+ String p = ((ExpressionType) obj).getProperty();
+ if (p == null) {
+ p = "<NULL>";
+ }
+ return p;
+ }
- return super.getText(element);
- }
+ if (obj instanceof org.jboss.tools.smooks.model.javabean12.ValueType) {
+ String p = ((org.jboss.tools.smooks.model.javabean12.ValueType) obj).getProperty();
+ if (p == null) {
+ p = "<NULL>";
+ }
+ return p;
+ }
+ if (obj instanceof org.jboss.tools.smooks.model.javabean12.WiringType) {
+ String p = ((org.jboss.tools.smooks.model.javabean12.WiringType) obj).getProperty();
+ if (p == null) {
+ p = "<NULL>";
+ }
+ return p;
+ }
+ if (obj instanceof org.jboss.tools.smooks.model.javabean12.ExpressionType) {
+ String p = ((org.jboss.tools.smooks.model.javabean12.ExpressionType) obj).getProperty();
+ if (p == null) {
+ p = "<NULL>";
+ }
+ return p;
+ }
+ return null;
+ }
- };
- graphModel = new JavaBeanGraphModel(model, contentProvider, labelProvider1, provider);
+ public Object createGraphicalModel(Object model, ISmooksModelProvider provider) {
+ AbstractSmooksGraphicalModel graphModel = null;
+ AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain) provider.getEditingDomain();
+ ITreeContentProvider contentProvider = new AdapterFactoryContentProvider(editingDomain.getAdapterFactory());
+ ILabelProvider labelProvider = createLabelProvider(editingDomain.getAdapterFactory());
+ if (model instanceof BindingsType || model instanceof BeanType) {
+ graphModel = new JavaBeanGraphModel(model, contentProvider, labelProvider, provider);
((JavaBeanGraphModel) graphModel).setHeaderVisable(true);
+ } else {
+ if (model instanceof AbstractResourceConfig) {
+ graphModel = new ResourceConfigGraphModelImpl(model, contentProvider, labelProvider, provider);
+ ((ResourceConfigGraphModelImpl) graphModel).setHeaderVisable(true);
+ }
}
return graphModel;
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2009-08-27 08:47:38 UTC (rev 17292)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2009-08-27 09:46:54 UTC (rev 17293)
@@ -704,11 +704,13 @@
}
}
EditPart rootEditPart = getGraphicalViewer().getContents();
- List<?> childrenEditPart = rootEditPart.getChildren();
- for (Iterator<?> iterator = childrenEditPart.iterator(); iterator.hasNext();) {
- Object object = (Object) iterator.next();
- if (object instanceof InputDataContainerEditPart) {
- SmooksUIUtils.expandGraphTree(expanedTreeNodeList, (InputDataContainerEditPart) object);
+ if (rootEditPart != null) {
+ List<?> childrenEditPart = rootEditPart.getChildren();
+ for (Iterator<?> iterator = childrenEditPart.iterator(); iterator.hasNext();) {
+ Object object = (Object) iterator.next();
+ if (object instanceof InputDataContainerEditPart) {
+ SmooksUIUtils.expandGraphTree(expanedTreeNodeList, (InputDataContainerEditPart) object);
+ }
}
}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/ResourceConfigChildNodeEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/ResourceConfigChildNodeEditPart.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/ResourceConfigChildNodeEditPart.java 2009-08-27 09:46:54 UTC (rev 17293)
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.graphical.editors.editparts;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.jboss.tools.smooks.model.javabean.ExpressionType;
+import org.jboss.tools.smooks.model.javabean.JavabeanPackage;
+import org.jboss.tools.smooks.model.javabean.ValueType;
+import org.jboss.tools.smooks.model.javabean.WiringType;
+import org.jboss.tools.smooks.model.javabean12.Javabean12Package;
+
+/**
+ * @author Dart
+ *
+ */
+public class ResourceConfigChildNodeEditPart extends AbstractResourceConfigChildNodeEditPart {
+
+
+ public ResourceConfigChildNodeEditPart() {
+ super();
+ }
+
+
+
+ @Override
+ protected EStructuralFeature getFeature(EObject model) {
+ if(model instanceof WiringType){
+ return JavabeanPackage.Literals.BINDINGS_TYPE__WIRING;
+ }
+
+ if(model instanceof ValueType){
+ return JavabeanPackage.Literals.BINDINGS_TYPE__VALUE;
+ }
+
+ if(model instanceof ExpressionType){
+ return JavabeanPackage.Literals.BINDINGS_TYPE__EXPRESSION;
+ }
+
+ if(model instanceof org.jboss.tools.smooks.model.javabean12.WiringType){
+ return Javabean12Package.Literals.BEAN_TYPE__WIRING;
+ }
+
+ if(model instanceof org.jboss.tools.smooks.model.javabean12.ValueType){
+ return Javabean12Package.Literals.BEAN_TYPE__VALUE;
+ }
+
+ if(model instanceof org.jboss.tools.smooks.model.javabean12.ExpressionType){
+ return Javabean12Package.Literals.BEAN_TYPE__EXPRESSION;
+ }
+ return null;
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/ResourceConfigChildNodeEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/ResourceConfigEditFactory.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/ResourceConfigEditFactory.java 2009-08-27 08:47:38 UTC (rev 17292)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/ResourceConfigEditFactory.java 2009-08-27 09:46:54 UTC (rev 17293)
@@ -13,6 +13,8 @@
import org.eclipse.gef.EditPart;
import org.jboss.tools.smooks.graphical.editors.model.JavaBeanChildGraphModel;
import org.jboss.tools.smooks.graphical.editors.model.JavaBeanGraphModel;
+import org.jboss.tools.smooks.graphical.editors.model.ResourceConfigChildNodeGraphModelImpl;
+import org.jboss.tools.smooks.graphical.editors.model.ResourceConfigGraphModelImpl;
/**
* @author Dart
@@ -26,6 +28,12 @@
if(model instanceof JavaBeanChildGraphModel){
return new JavaBeanChildNodeEditPart();
}
+ if(model instanceof ResourceConfigChildNodeGraphModelImpl){
+ return new ResourceConfigChildNodeEditPart();
+ }
+ if(model instanceof ResourceConfigGraphModelImpl){
+ return new ResourceConfigEditPart();
+ }
return null;
}
}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/ResourceConfigEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/ResourceConfigEditPart.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/ResourceConfigEditPart.java 2009-08-27 09:46:54 UTC (rev 17293)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.graphical.editors.editparts;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.jboss.tools.smooks.model.javabean.BindingsType;
+import org.jboss.tools.smooks.model.javabean.JavabeanPackage;
+import org.jboss.tools.smooks.model.javabean12.BeanType;
+import org.jboss.tools.smooks.model.javabean12.Javabean12Package;
+
+/**
+ * @author Dart
+ *
+ */
+public class ResourceConfigEditPart extends AbstractResourceConfigEditPart {
+
+ public ResourceConfigEditPart() {
+ super();
+ }
+
+ @Override
+ protected EStructuralFeature getFeature(EObject model) {
+ if(model instanceof BindingsType){
+ return JavabeanPackage.Literals.DOCUMENT_ROOT__BINDINGS;
+ }
+ if(model instanceof BeanType){
+ return Javabean12Package.Literals.JAVABEAN12_DOCUMENT_ROOT__BEAN;
+ }
+ return null;
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/ResourceConfigEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/ResourceConfigChildNodeGraphModelImpl.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/ResourceConfigChildNodeGraphModelImpl.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/ResourceConfigChildNodeGraphModelImpl.java 2009-08-27 09:46:54 UTC (rev 17293)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.graphical.editors.model;
+
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+
+/**
+ * @author Dart dpeng(a)redhat.com
+ *
+ */
+public class ResourceConfigChildNodeGraphModelImpl extends AbstractResourceConfigChildNodeGraphModel {
+
+ public ResourceConfigChildNodeGraphModelImpl(Object data, ITreeContentProvider contentProvider,
+ ILabelProvider labelProvider, IEditingDomainProvider domainProvider) {
+ super(data, contentProvider, labelProvider, domainProvider);
+ // TODO Auto-generated constructor stub
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/ResourceConfigChildNodeGraphModelImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/ResourceConfigGraphModelImpl.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/ResourceConfigGraphModelImpl.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/ResourceConfigGraphModelImpl.java 2009-08-27 09:46:54 UTC (rev 17293)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.graphical.editors.model;
+
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.jboss.tools.smooks.gef.tree.model.TreeNodeModel;
+
+/**
+ * @author Dart dpeng(a)redhat.com
+ *
+ */
+public class ResourceConfigGraphModelImpl extends AbstractResourceConfigGraphModel {
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.smooks.graphical.editors.model.AbstractResourceConfigGraphModel#createChildModel(java.lang.Object, org.eclipse.jface.viewers.ITreeContentProvider, org.eclipse.jface.viewers.ILabelProvider)
+ */
+ @Override
+ protected TreeNodeModel createChildModel(Object model, ITreeContentProvider contentProvider,
+ ILabelProvider labelProvider) {
+ return null;
+ }
+
+ public ResourceConfigGraphModelImpl(Object data, ITreeContentProvider contentProvider,
+ ILabelProvider labelProvider, IEditingDomainProvider domainProvider) {
+ super(data, contentProvider, labelProvider, domainProvider);
+ // TODO Auto-generated constructor stub
+ }
+
+
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/ResourceConfigGraphModelImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 5 months
JBoss Tools SVN: r17292 - branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-08-27 04:47:38 -0400 (Thu, 27 Aug 2009)
New Revision: 17292
Modified:
branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4135 fixed
Modified: branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
--- branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2009-08-27 08:44:22 UTC (rev 17291)
+++ branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2009-08-27 08:47:38 UTC (rev 17292)
@@ -229,7 +229,7 @@
}
protected IFacetedProjectTemplate getTemplate() {
- seamConfigTemplate = null; //SeamCorePlugin.getDefault().getPluginPreferences().getString(SeamProjectPreferences.SEAM_CONFIG_TEMPLATE);
+ seamConfigTemplate = SeamCorePlugin.getDefault().getPluginPreferences().getString(SeamProjectPreferences.SEAM_CONFIG_TEMPLATE);
if(seamConfigTemplate==null || seamConfigTemplate.length()==0) {
SeamRuntime runtime = SeamRuntimeManager.getInstance().getLatestSeamRuntime();
if(runtime!=null) {
15 years, 5 months
JBoss Tools SVN: r17291 - in branches/jbosstools-3.0.x/seam/plugins: org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-08-27 04:44:22 -0400 (Thu, 27 Aug 2009)
New Revision: 17291
Modified:
branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/plugin.xml
branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamProjectPreferences.java
branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java
branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4135 fixed
revisions 14543,14544, 14734 were merged to branch
Modified: branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2009-08-27 08:35:38 UTC (rev 17290)
+++ branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2009-08-27 08:44:22 UTC (rev 17291)
@@ -240,10 +240,6 @@
facet="jst.java"/>
<fixed
facet="jst.web"/>
- <!--fixed
- facet="jst.seam"/>
- <fixed
- facet="jst.jsf"/-->
<preset
id="jst.seam.preset">
</preset>
@@ -258,14 +254,24 @@
facet="jst.java"/>
<fixed
facet="jst.web"/>
- <!--fixed
- facet="jst.seam"/>
- <fixed
- facet="jst.jsf"/-->
<preset
id="jst.seam2.preset">
</preset>
</template>
+
+ <template
+ id="template.jst.seam21">
+ <label>
+ Seam 2.1 Web Project
+ </label>
+ <fixed
+ facet="jst.java"/>
+ <fixed
+ facet="jst.web"/>
+ <preset
+ id="jst.seam21.preset">
+ </preset>
+ </template>
</extension>
<extension
@@ -318,9 +324,9 @@
<extension
point="org.eclipse.wst.common.project.facet.core.runtimes">
- <supported>
- <runtime-component
- any="true">
+ <supported>
+ <runtime-component
+ any="true">
</runtime-component>
<facet
id="jst.seam"
@@ -383,142 +389,142 @@
</dependentValidator>
</validator>
</extension>
-
- <extension
- point="org.eclipse.wst.validation.validator"
- id="SeamProjectPropertyValidator"
- name="Seam Project Property Validator">
- <validator>
- <filter objectClass="org.eclipse.core.resources.IFolder" nameFilter="*"/>
- <filter objectClass="org.eclipse.core.resources.IProject" nameFilter="*"/>
- <filter objectClass="org.eclipse.core.resources.IFile" nameFilter="org.jboss.tools.seam.core.prefs"/>
- <helper class="org.jboss.tools.seam.internal.core.validation.SeamValidationHelper"/>
- <markerId markerIdValue="seamProjectProblem"/>
- <run
- class="org.jboss.tools.seam.internal.core.validation.SeamProjectPropertyValidator"
- incremental="true"
- fullBuild="true"
- />
- </validator>
- </extension>
-
+
<extension
+ point="org.eclipse.wst.validation.validator"
+ id="SeamProjectPropertyValidator"
+ name="Seam Project Property Validator">
+ <validator>
+ <filter objectClass="org.eclipse.core.resources.IFolder" nameFilter="*"/>
+ <filter objectClass="org.eclipse.core.resources.IProject" nameFilter="*"/>
+ <filter objectClass="org.eclipse.core.resources.IFile" nameFilter="org.jboss.tools.seam.core.prefs"/>
+ <helper class="org.jboss.tools.seam.internal.core.validation.SeamValidationHelper"/>
+ <markerId markerIdValue="seamProjectProblem"/>
+ <run
+ class="org.jboss.tools.seam.internal.core.validation.SeamProjectPropertyValidator"
+ incremental="true"
+ fullBuild="true"
+ />
+ </validator>
+ </extension>
+
+ <extension
id="seamProblem"
name="Seam Problem"
point="org.eclipse.core.resources.markers">
- <super type="org.eclipse.wst.validation.problemmarker"/>
+ <super type="org.eclipse.wst.validation.problemmarker"/>
<attribute name="kind"/>
<persistent
value="true">
</persistent>
</extension>
-
- <extension
- id="seamProjectProblem"
- name="Seam Project Problem"
- point="org.eclipse.core.resources.markers">
- <super type="org.eclipse.wst.validation.problemmarker"/>
- <attribute name="kind"/>
- <persistent
- value="true">
- </persistent>
- </extension>
-
- <extension
- point="org.eclipse.wst.validation.validator"
- id="SeamEarProjectValidator"
- name="Seam Ear Project Validator">
- <validator>
- <enablement>
- <and>
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jst.ear"/>
- </and>
- </enablement>
- <filter objectClass="org.eclipse.core.resources.IFile" nameFilter="application.xml"/>
- <helper class="org.jboss.tools.seam.internal.core.validation.SeamValidationHelper"/>
- <markerId markerIdValue="seamEarProjectProblem"/>
- <run
- class="org.jboss.tools.seam.internal.core.validation.SeamEarProjectValidator"
- incremental="true"
- fullBuild="true"
- />
- </validator>
- </extension>
-
- <extension
- id="seamEarProjectProblem"
- name="Seam Ear Project Problem"
- point="org.eclipse.core.resources.markers">
- <super type="org.eclipse.wst.validation.problemmarker"/>
- <attribute name="kind"/>
- <persistent value="true"/>
- </extension>
+ <extension
+ id="seamProjectProblem"
+ name="Seam Project Problem"
+ point="org.eclipse.core.resources.markers">
+ <super type="org.eclipse.wst.validation.problemmarker"/>
+ <attribute name="kind"/>
+ <persistent
+ value="true">
+ </persistent>
+ </extension>
+
+ <extension
+ point="org.eclipse.wst.validation.validator"
+ id="SeamEarProjectValidator"
+ name="Seam Ear Project Validator">
+ <validator>
+ <enablement>
+ <and>
+ <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jst.ear"/>
+ </and>
+ </enablement>
+ <filter objectClass="org.eclipse.core.resources.IFile" nameFilter="application.xml"/>
+ <helper class="org.jboss.tools.seam.internal.core.validation.SeamValidationHelper"/>
+ <markerId markerIdValue="seamEarProjectProblem"/>
+ <run
+ class="org.jboss.tools.seam.internal.core.validation.SeamEarProjectValidator"
+ incremental="true"
+ fullBuild="true"
+ />
+ </validator>
+ </extension>
+
+ <extension
+ id="seamEarProjectProblem"
+ name="Seam Ear Project Problem"
+ point="org.eclipse.core.resources.markers">
+ <super type="org.eclipse.wst.validation.problemmarker"/>
+ <attribute name="kind"/>
+ <persistent value="true"/>
+ </extension>
+
<extension point="org.jboss.tools.common.model.classes">
<xclass id="org.jboss.tools.seam.internal.core.el.SeamPromptingProvider"
class="org.jboss.tools.seam.internal.core.el.SeamPromptingProvider"/>
</extension>
- <extension
- point="org.eclipse.ltk.core.refactoring.renameParticipants">
- <renameParticipant
- class="org.jboss.tools.seam.internal.core.refactoring.SeamProjectRenameParticipant"
- id="org.jboss.tools.seam.internal.core.refactoring.SeamProjectRenameParticipant"
- name="seam-RenameProjectParticipant">
- <enablement>
- <with variable="element">
- <or>
- <instanceof value="org.eclipse.core.resources.IProject"/>
- </or>
- </with>
- </enablement>
- </renameParticipant>
- <renameParticipant
- class="org.jboss.tools.seam.internal.core.refactoring.SeamFolderRenameParticipant"
- id="org.jboss.tools.seam.internal.core.refactoring.SeamFolderRenameParticipant"
- name="seam-RenameFolderParticipant">
- <enablement>
- <with variable="element">
- <or>
- <instanceof value="org.eclipse.core.resources.IFolder"/>
- </or>
- </with>
- </enablement>
- </renameParticipant>
- <renameParticipant
- class="org.jboss.tools.seam.internal.core.refactoring.SeamJavaPackageRenameParticipant"
- id="org.jboss.tools.seam.internal.core.refactoring.SeamJavaPackageRenameParticipant"
- name="seam-JavaPackageRenameParticipant">
- <enablement>
- <with variable="element">
- <or>
- <instanceof value="org.eclipse.jdt.core.IPackageFragment"/>
- </or>
- </with>
- </enablement>
- </renameParticipant>
- </extension>
-
- <extension
- point="org.eclipse.ltk.core.refactoring.moveParticipants">
- <moveParticipant
- class="org.jboss.tools.seam.internal.core.refactoring.SeamFolderMoveParticipant"
- id="org.jboss.tools.seam.internal.core.refactoring.SeamFolderMoveParticipant"
- name="name">
- <enablement>
- <with variable="element">
- <or>
- <instanceof value="org.eclipse.core.resources.IFolder"/>
- </or>
- </with>
- </enablement>
- </moveParticipant>
- </extension>
-
- <extension
- point="org.eclipse.jst.jsf.core.variableresolver">
- <variableresolver
- class="org.jboss.tools.seam.internal.core.el.VariableResolver"
- id="org.jboss.tools.seam.el.variableresolver"/>
- </extension>
+ <extension
+ point="org.eclipse.ltk.core.refactoring.renameParticipants">
+ <renameParticipant
+ class="org.jboss.tools.seam.internal.core.refactoring.SeamProjectRenameParticipant"
+ id="org.jboss.tools.seam.internal.core.refactoring.SeamProjectRenameParticipant"
+ name="seam-RenameProjectParticipant">
+ <enablement>
+ <with variable="element">
+ <or>
+ <instanceof value="org.eclipse.core.resources.IProject"/>
+ </or>
+ </with>
+ </enablement>
+ </renameParticipant>
+ <renameParticipant
+ class="org.jboss.tools.seam.internal.core.refactoring.SeamFolderRenameParticipant"
+ id="org.jboss.tools.seam.internal.core.refactoring.SeamFolderRenameParticipant"
+ name="seam-RenameFolderParticipant">
+ <enablement>
+ <with variable="element">
+ <or>
+ <instanceof value="org.eclipse.core.resources.IFolder"/>
+ </or>
+ </with>
+ </enablement>
+ </renameParticipant>
+ <renameParticipant
+ class="org.jboss.tools.seam.internal.core.refactoring.SeamJavaPackageRenameParticipant"
+ id="org.jboss.tools.seam.internal.core.refactoring.SeamJavaPackageRenameParticipant"
+ name="seam-JavaPackageRenameParticipant">
+ <enablement>
+ <with variable="element">
+ <or>
+ <instanceof value="org.eclipse.jdt.core.IPackageFragment"/>
+ </or>
+ </with>
+ </enablement>
+ </renameParticipant>
+ </extension>
+
+ <extension
+ point="org.eclipse.ltk.core.refactoring.moveParticipants">
+ <moveParticipant
+ class="org.jboss.tools.seam.internal.core.refactoring.SeamFolderMoveParticipant"
+ id="org.jboss.tools.seam.internal.core.refactoring.SeamFolderMoveParticipant"
+ name="name">
+ <enablement>
+ <with variable="element">
+ <or>
+ <instanceof value="org.eclipse.core.resources.IFolder"/>
+ </or>
+ </with>
+ </enablement>
+ </moveParticipant>
+ </extension>
+
+ <extension
+ point="org.eclipse.jst.jsf.core.variableresolver">
+ <variableresolver
+ class="org.jboss.tools.seam.internal.core.el.VariableResolver"
+ id="org.jboss.tools.seam.el.variableresolver"/>
+ </extension>
</plugin>
\ No newline at end of file
Modified: branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamProjectPreferences.java
===================================================================
--- branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamProjectPreferences.java 2009-08-27 08:35:38 UTC (rev 17290)
+++ branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamProjectPreferences.java 2009-08-27 08:44:22 UTC (rev 17291)
@@ -1,68 +1,74 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.seam.core.project.facet;
-
-import org.jboss.tools.seam.core.SeamCorePlugin;
-
-/**
- * Seam project related preferences constants
- *
- * @author eskimo
- */
-public class SeamProjectPreferences {
- /**
- * Last selected connection profile
- */
- public static final String SEAM_DEFAULT_CONNECTION_PROFILE = SeamCorePlugin.PLUGIN_ID
- + ".project.facet.default.conn.profile"; //$NON-NLS-1$
-
- /**
- * TODO
- */
- public static final String RUNTIME_CONFIG_FORMAT_VERSION = SeamCorePlugin.PLUGIN_ID
- + ".runtime.config.format.version"; //$NON-NLS-1$
-
- /**
- * String represents list of available runtimes
- */
- public static final String RUNTIME_LIST = SeamCorePlugin.PLUGIN_ID
- + ".runtime.list"; //$NON-NLS-1$
-
- /**
- * Last selected deployment type
- */
- public static final String JBOSS_AS_DEFAULT_DEPLOY_AS = SeamCorePlugin.PLUGIN_ID
- + ".project.default.deployment.type"; //$NON-NLS-1$
-
- /**
- * Last selected DB type
- */
- public static final String HIBERNATE_DEFAULT_DB_TYPE = SeamCorePlugin.PLUGIN_ID
- + ".hibernate.default.db.type"; //$NON-NLS-1$
-
- /**
- * Last selected server
- */
- public static final String SEAM_LAST_SERVER_NAME = SeamCorePlugin.PLUGIN_ID
- + ".project.facet.last.server.name"; //$NON-NLS-1$
-
- /**
- * Return String value from SeamCore preferences by name
- *
- * @param name
- * preference property name
- * @return preference property value
- */
- public static String getStringPreference(final String name) {
- return SeamCorePlugin.getDefault().getPreferenceStore().getString(name);
- }
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.seam.core.project.facet;
+
+import org.jboss.tools.seam.core.SeamCorePlugin;
+
+/**
+ * Seam project related preferences constants
+ *
+ * @author eskimo
+ */
+public class SeamProjectPreferences {
+ /**
+ * Last selected connection profile
+ */
+ public static final String SEAM_DEFAULT_CONNECTION_PROFILE = SeamCorePlugin.PLUGIN_ID
+ + ".project.facet.default.conn.profile"; //$NON-NLS-1$
+
+ /**
+ * TODO
+ */
+ public static final String RUNTIME_CONFIG_FORMAT_VERSION = SeamCorePlugin.PLUGIN_ID
+ + ".runtime.config.format.version"; //$NON-NLS-1$
+
+ /**
+ * String represents list of available runtimes
+ */
+ public static final String RUNTIME_LIST = SeamCorePlugin.PLUGIN_ID
+ + ".runtime.list"; //$NON-NLS-1$
+
+ /**
+ * Last selected deployment type
+ */
+ public static final String JBOSS_AS_DEFAULT_DEPLOY_AS = SeamCorePlugin.PLUGIN_ID
+ + ".project.default.deployment.type"; //$NON-NLS-1$
+
+ /**
+ * Last selected Seam configuration template
+ */
+ public static final String SEAM_CONFIG_TEMPLATE = SeamCorePlugin.PLUGIN_ID
+ + ".project.facet.config.template"; //$NON-NLS-1$
+
+ /**
+ * Last selected DB type
+ */
+ public static final String HIBERNATE_DEFAULT_DB_TYPE = SeamCorePlugin.PLUGIN_ID
+ + ".hibernate.default.db.type"; //$NON-NLS-1$
+
+ /**
+ * Last selected server
+ */
+ public static final String SEAM_LAST_SERVER_NAME = SeamCorePlugin.PLUGIN_ID
+ + ".project.facet.last.server.name"; //$NON-NLS-1$
+
+ /**
+ * Return String value from SeamCore preferences by name
+ *
+ * @param name
+ * preference property name
+ * @return preference property value
+ */
+ public static String getStringPreference(final String name) {
+ return SeamCorePlugin.getDefault().getPreferenceStore().getString(name);
+ }
}
\ No newline at end of file
Modified: branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
===================================================================
--- branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2009-08-27 08:35:38 UTC (rev 17290)
+++ branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2009-08-27 08:44:22 UTC (rev 17291)
@@ -1,346 +1,367 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.core.project.facet;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.preference.IPersistentPreferenceStore;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
-import org.jboss.tools.seam.internal.core.project.facet.SeamFacetPreferenceInitializer;
-
-/**
- * This class is responsible for managing available SeamRuntime list.
- *
- * @author eskimo
- */
-public class SeamRuntimeManager {
-
- private static SeamRuntimeListConverter converter = new SeamRuntimeListConverter();
-
- private Map<String, SeamRuntime> runtimes = new HashMap<String, SeamRuntime>();
-
- private SeamRuntime defaultRt = null;
-
- /**
- * Private constructor
- */
- private SeamRuntimeManager() {
- String configVersion = SeamProjectPreferences
- .getStringPreference(SeamProjectPreferences.RUNTIME_CONFIG_FORMAT_VERSION);
- String runtimeListString = SeamProjectPreferences
- .getStringPreference(SeamProjectPreferences.RUNTIME_LIST);
-
- runtimes = converter.getMap(runtimeListString);
- }
-
- /**
- * This class make Java Runtime responsible for solving synchronization
- * problems during initialization if there is any
- *
- * @author eskimo
- */
- static class SeamRuntimeManagerHolder {
- private static final SeamRuntimeManager INSTANCE = new SeamRuntimeManager();
- }
-
- /**
- * Return SeamRuntimeManaher instance
- *
- * @return
- * SeamRuntimeManager instance
- */
- public static SeamRuntimeManager getInstance() {
- return SeamRuntimeManagerHolder.INSTANCE;
- }
-
- /**
- * Return Array of configured SeamRuntimes
- *
- * @return
- * SeamRuntime[]
- */
- public SeamRuntime[] getRuntimes() {
- Collection<SeamRuntime> c = runtimes.values();
- return c.toArray(new SeamRuntime[runtimes.size()]);
- }
-
- /**
- * Return array of SeamRuntimes that is compatible with given version
- *
- * @param version
- * SeamVersion
- * @return
- * SeamRuntime[]
- */
- public SeamRuntime[] getRuntimes(SeamVersion version) {
- Collection<SeamRuntime> c = runtimes.values();
- List<SeamRuntime> rts = new ArrayList<SeamRuntime>();
- for (SeamRuntime seamRuntime : c) {
- if (seamRuntime.getVersion() == version) {
- rts.add(seamRuntime);
- }
- }
- return rts.toArray(new SeamRuntime[rts.size()]);
- }
-
- /**
- * Add new SeamRuntime
- *
- * @param runtime
- * SeamRuntime
- */
- public void addRuntime(SeamRuntime runtime) {
- if (runtimes.size() == 0) {
- runtime.setDefault(true);
- }
-
- SeamRuntime oldDefaultRuntime = getDefaultRuntime(runtime.getVersion());
- if (oldDefaultRuntime != null && runtime.isDefault()) {
- oldDefaultRuntime.setDefault(false);
- }
- runtimes.put(runtime.getName(), runtime);
- save();
- }
-
- /**
- * Add new SeamRuntime with given parameters
- *
- * @param name
- * String - runtime name
- * @param path
- * String - runtime home folder
- * @param version
- * String - string representation of version number
- * @param defaultRt
- * boolean - default flag
- */
- public void addRuntime(String name, String path, SeamVersion version,
- boolean defaultRt) {
- SeamRuntime seamRt = new SeamRuntime();
- seamRt.setVersion(version);
- seamRt.setHomeDir(path);
- seamRt.setName(name);
- seamRt.setDefault(defaultRt);
- addRuntime(seamRt);
- }
-
- /**
- * Return SeamRuntime by given name
- *
- * @param name
- * String - SeamRuntime name
- * @return
- * SeamRuntime - found SeamRuntime instance or null
- */
- public SeamRuntime findRuntimeByName(String name) {
- for (SeamRuntime seamRuntime : runtimes.values()) {
- if (seamRuntime.getName().equals(name)) {
- return seamRuntime;
- }
- }
- return null;
- }
-
- /**
- * Remove given SeamRuntime from manager
- * @param rt
- * SeamRuntime
- */
- public void removeRuntime(SeamRuntime rt) {
- runtimes.remove(rt.getName());
- }
-
- /**
- * Return SeamRuntime instance for given project
- *
- * @param project
- * IProject
- * @return
- * SeamRuntime - instance of available SeamRuntime or null
- */
- public SeamRuntime getRuntimeForProject(IProject project) {
- ISeamProject seamProject = SeamCorePlugin
- .getSeamProject(project, false);
- return (seamProject == null) ? null : seamProject.getRuntime();
- }
-
- /**
- * Save preference value and force save changes to disk
- */
- public void save() {
- SeamCorePlugin.getDefault().getPluginPreferences().setValue(
- SeamProjectPreferences.RUNTIME_LIST,
- converter.getString(runtimes));
- IPreferenceStore store = SeamCorePlugin.getDefault()
- .getPreferenceStore();
- if (store instanceof IPersistentPreferenceStore) {
- try {
- ((IPersistentPreferenceStore) store).save();
- } catch (IOException e) {
- SeamCorePlugin.getPluginLog().logError(
- "Seam Runtime List was not saved", e);
- }
- }
- }
-
- /**
- * Marks this runtime as default. Marks other runtimes with the same version as not default.
- * @param runtime
- */
- public void setDefaultRuntime(SeamRuntime runtime) {
- SeamRuntime[] runtimes = getRuntimes(runtime.getVersion());
- for (int i = 0; i < runtimes.length; i++) {
- runtimes[i].setDefault(false);
- }
- runtime.setDefault(true);
- }
-
- /**
- * Return first default SeamRuntime
- *
- * @return
- * SeamRuntime
- */
- public SeamRuntime getDefaultRuntime() {
- for (SeamRuntime rt : runtimes.values()) {
- if (rt.isDefault()) {
- return rt;
- }
- }
- return null;
- }
-
- /**
- * If project has seam facet then this method returns default seam runtime for proper version of facet.
- * Otherwise return first default runtime.
- * @param project
- * @return
- */
- public static SeamRuntime getDefaultRuntimeForProject(IProject project) {
- if(project==null) {
- throw new IllegalArgumentException("Project must not be null.");
- }
- try {
- IProjectFacet facet = ProjectFacetsManager.getProjectFacet(ISeamFacetDataModelProperties.SEAM_FACET_ID);
- IFacetedProject facetedProject = ProjectFacetsManager.create(project);
- if(facetedProject!=null) {
- IProjectFacetVersion facetVersion = facetedProject.getInstalledVersion(facet);
- if(facetVersion==null) return null;
- SeamVersion seamVersion = SeamVersion.parseFromString(facetVersion.getVersionString());
- return getInstance().getDefaultRuntime(seamVersion);
- }
- } catch (CoreException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- } catch (IllegalArgumentException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- }
- return getInstance().getDefaultRuntime();
- }
-
- /**
- * Return default runtime for given SeamVersion
- *
- * @param version
- * given SeamVersion
- * @return
- * Default SeamRuntime for given version
- */
- public SeamRuntime getDefaultRuntime(SeamVersion version) {
- for (SeamRuntime rt : runtimes.values()) {
- if (rt.isDefault() && rt.getVersion() == version) {
- return rt;
- }
- }
- return null;
- }
-
- /**
- * Return version of configuration
- *
- * @return
- * String - string representation of version
- */
- public String getConfigurationVersion() {
- return SeamFacetPreferenceInitializer.RUNTIME_CONFIG_FORMAT_VERSION;
- }
-
- /**
- * Return list of available SeamRuntime names
- *
- * @return
- * List<String>
- */
- public List<String> getRuntimeNames() {
- SeamRuntime[] rts = getRuntimes(SeamVersion.SEAM_1_2);
- List<String> result = new ArrayList<String>();
- for (SeamRuntime seamRuntime : rts) {
- result.add(seamRuntime.getName());
- }
- return result;
- }
-
- /**
- * Return a list of all runtime names
- *
- * @return
- * List of all runtime names
- */
- public List<String> getAllRuntimeNames() {
- SeamRuntime[] rts = getRuntimes();
- List<String> result = new ArrayList<String>();
- for (SeamRuntime seamRuntime : rts) {
- result.add(seamRuntime.getName());
- }
- return result;
- }
-
- /**
- * TBD
- *
- * @param oldName
- * old runtime name
- * @param newName
- * new runtime name
- */
- public void changeRuntimeName(String oldName, String newName) {
- SeamRuntime o = findRuntimeByName(oldName);
- if (o == null) {
- return;
- }
- o.setName(newName);
- onRuntimeNameChanged(oldName, newName);
- }
-
- private void onRuntimeNameChanged(String oldName, String newName) {
- IProject[] ps = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for (int i = 0; i < ps.length; i++) {
- ISeamProject sp = SeamCorePlugin.getSeamProject(ps[i], false);
- if (sp != null && oldName.equals(sp.getRuntimeName())) {
- sp.setRuntimeName(newName);
- }
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.core.project.facet;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.preference.IPersistentPreferenceStore;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
+import org.jboss.tools.seam.internal.core.project.facet.SeamFacetPreferenceInitializer;
+
+/**
+ * This class is responsible for managing available SeamRuntime list.
+ *
+ * @author eskimo
+ */
+public class SeamRuntimeManager {
+
+ private static SeamRuntimeListConverter converter = new SeamRuntimeListConverter();
+
+ private Map<String, SeamRuntime> runtimes = new HashMap<String, SeamRuntime>();
+
+ private SeamRuntime defaultRt = null;
+
+ /**
+ * Private constructor
+ */
+ private SeamRuntimeManager() {
+ String configVersion = SeamProjectPreferences
+ .getStringPreference(SeamProjectPreferences.RUNTIME_CONFIG_FORMAT_VERSION);
+ String runtimeListString = SeamProjectPreferences
+ .getStringPreference(SeamProjectPreferences.RUNTIME_LIST);
+
+ runtimes = converter.getMap(runtimeListString);
+ }
+
+ /**
+ * This class make Java Runtime responsible for solving synchronization
+ * problems during initialization if there is any
+ *
+ * @author eskimo
+ */
+ static class SeamRuntimeManagerHolder {
+ private static final SeamRuntimeManager INSTANCE = new SeamRuntimeManager();
+ }
+
+ /**
+ * Return SeamRuntimeManaher instance
+ *
+ * @return
+ * SeamRuntimeManager instance
+ */
+ public static SeamRuntimeManager getInstance() {
+ return SeamRuntimeManagerHolder.INSTANCE;
+ }
+
+ /**
+ * Return Array of configured SeamRuntimes
+ *
+ * @return
+ * SeamRuntime[]
+ */
+ public SeamRuntime[] getRuntimes() {
+ Collection<SeamRuntime> c = runtimes.values();
+ return c.toArray(new SeamRuntime[runtimes.size()]);
+ }
+
+ /**
+ * @return the latest version of installed Seam runtimes. If there are a few runtimes with the same version
+ * then the default one will be returned.
+ */
+ public SeamRuntime getLatestSeamRuntime() {
+ SeamVersion latestVersion = SeamVersion.SEAM_1_2;
+ for (SeamRuntime runtime : runtimes.values()) {
+ if(runtime.getVersion().compareTo(latestVersion)>=0) {
+ latestVersion = runtime.getVersion();
+ }
+ }
+ SeamRuntime runtime = getDefaultRuntime(latestVersion);
+ if(runtime==null) {
+ SeamRuntime[] runtimes = getRuntimes(latestVersion);
+ if(runtimes.length>0) {
+ runtime = runtimes[0];
+ }
+ }
+ return runtime;
+ }
+
+ /**
+ * Return array of SeamRuntimes that is compatible with given version
+ *
+ * @param version
+ * SeamVersion
+ * @return
+ * SeamRuntime[]
+ */
+ public SeamRuntime[] getRuntimes(SeamVersion version) {
+ Collection<SeamRuntime> c = runtimes.values();
+ List<SeamRuntime> rts = new ArrayList<SeamRuntime>();
+ for (SeamRuntime seamRuntime : c) {
+ if (seamRuntime.getVersion() == version) {
+ rts.add(seamRuntime);
+ }
+ }
+ return rts.toArray(new SeamRuntime[rts.size()]);
+ }
+
+ /**
+ * Add new SeamRuntime
+ *
+ * @param runtime
+ * SeamRuntime
+ */
+ public void addRuntime(SeamRuntime runtime) {
+ if (runtimes.size() == 0) {
+ runtime.setDefault(true);
+ }
+
+ SeamRuntime oldDefaultRuntime = getDefaultRuntime(runtime.getVersion());
+ if (oldDefaultRuntime != null && runtime.isDefault()) {
+ oldDefaultRuntime.setDefault(false);
+ }
+ runtimes.put(runtime.getName(), runtime);
+ save();
+ }
+
+ /**
+ * Add new SeamRuntime with given parameters
+ *
+ * @param name
+ * String - runtime name
+ * @param path
+ * String - runtime home folder
+ * @param version
+ * String - string representation of version number
+ * @param defaultRt
+ * boolean - default flag
+ */
+ public void addRuntime(String name, String path, SeamVersion version,
+ boolean defaultRt) {
+ SeamRuntime seamRt = new SeamRuntime();
+ seamRt.setVersion(version);
+ seamRt.setHomeDir(path);
+ seamRt.setName(name);
+ seamRt.setDefault(defaultRt);
+ addRuntime(seamRt);
+ }
+
+ /**
+ * Return SeamRuntime by given name
+ *
+ * @param name
+ * String - SeamRuntime name
+ * @return
+ * SeamRuntime - found SeamRuntime instance or null
+ */
+ public SeamRuntime findRuntimeByName(String name) {
+ for (SeamRuntime seamRuntime : runtimes.values()) {
+ if (seamRuntime.getName().equals(name)) {
+ return seamRuntime;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Remove given SeamRuntime from manager
+ * @param rt
+ * SeamRuntime
+ */
+ public void removeRuntime(SeamRuntime rt) {
+ runtimes.remove(rt.getName());
+ }
+
+ /**
+ * Return SeamRuntime instance for given project
+ *
+ * @param project
+ * IProject
+ * @return
+ * SeamRuntime - instance of available SeamRuntime or null
+ */
+ public SeamRuntime getRuntimeForProject(IProject project) {
+ ISeamProject seamProject = SeamCorePlugin
+ .getSeamProject(project, false);
+ return (seamProject == null) ? null : seamProject.getRuntime();
+ }
+
+ /**
+ * Save preference value and force save changes to disk
+ */
+ public void save() {
+ SeamCorePlugin.getDefault().getPluginPreferences().setValue(
+ SeamProjectPreferences.RUNTIME_LIST,
+ converter.getString(runtimes));
+ IPreferenceStore store = SeamCorePlugin.getDefault()
+ .getPreferenceStore();
+ if (store instanceof IPersistentPreferenceStore) {
+ try {
+ ((IPersistentPreferenceStore) store).save();
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(
+ "Seam Runtime List was not saved", e);
+ }
+ }
+ }
+
+ /**
+ * Marks this runtime as default. Marks other runtimes with the same version as not default.
+ * @param runtime
+ */
+ public void setDefaultRuntime(SeamRuntime runtime) {
+ SeamRuntime[] runtimes = getRuntimes(runtime.getVersion());
+ for (int i = 0; i < runtimes.length; i++) {
+ runtimes[i].setDefault(false);
+ }
+ runtime.setDefault(true);
+ }
+
+ /**
+ * Return first default SeamRuntime
+ *
+ * @return
+ * SeamRuntime
+ */
+ public SeamRuntime getDefaultRuntime() {
+ for (SeamRuntime rt : runtimes.values()) {
+ if (rt.isDefault()) {
+ return rt;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * If project has seam facet then this method returns default seam runtime for proper version of facet.
+ * Otherwise return first default runtime.
+ * @param project
+ * @return
+ */
+ public static SeamRuntime getDefaultRuntimeForProject(IProject project) {
+ if(project==null) {
+ throw new IllegalArgumentException("Project must not be null.");
+ }
+ try {
+ IProjectFacet facet = ProjectFacetsManager.getProjectFacet(ISeamFacetDataModelProperties.SEAM_FACET_ID);
+ IFacetedProject facetedProject = ProjectFacetsManager.create(project);
+ if(facetedProject!=null) {
+ IProjectFacetVersion facetVersion = facetedProject.getInstalledVersion(facet);
+ if(facetVersion==null) return null;
+ SeamVersion seamVersion = SeamVersion.parseFromString(facetVersion.getVersionString());
+ return getInstance().getDefaultRuntime(seamVersion);
+ }
+ } catch (CoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ } catch (IllegalArgumentException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ return getInstance().getDefaultRuntime();
+ }
+
+ /**
+ * Return default runtime for given SeamVersion
+ *
+ * @param version
+ * given SeamVersion
+ * @return
+ * Default SeamRuntime for given version
+ */
+ public SeamRuntime getDefaultRuntime(SeamVersion version) {
+ for (SeamRuntime rt : runtimes.values()) {
+ if (rt.isDefault() && rt.getVersion() == version) {
+ return rt;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Return version of configuration
+ *
+ * @return
+ * String - string representation of version
+ */
+ public String getConfigurationVersion() {
+ return SeamFacetPreferenceInitializer.RUNTIME_CONFIG_FORMAT_VERSION;
+ }
+
+ /**
+ * Return list of available SeamRuntime names
+ *
+ * @return
+ * List<String>
+ */
+ public List<String> getRuntimeNames() {
+ SeamRuntime[] rts = getRuntimes(SeamVersion.SEAM_1_2);
+ List<String> result = new ArrayList<String>();
+ for (SeamRuntime seamRuntime : rts) {
+ result.add(seamRuntime.getName());
+ }
+ return result;
+ }
+
+ /**
+ * Return a list of all runtime names
+ *
+ * @return
+ * List of all runtime names
+ */
+ public List<String> getAllRuntimeNames() {
+ SeamRuntime[] rts = getRuntimes();
+ List<String> result = new ArrayList<String>();
+ for (SeamRuntime seamRuntime : rts) {
+ result.add(seamRuntime.getName());
+ }
+ return result;
+ }
+
+ /**
+ * TBD
+ *
+ * @param oldName
+ * old runtime name
+ * @param newName
+ * new runtime name
+ */
+ public void changeRuntimeName(String oldName, String newName) {
+ SeamRuntime o = findRuntimeByName(oldName);
+ if (o == null) {
+ return;
+ }
+ o.setName(newName);
+ onRuntimeNameChanged(oldName, newName);
+ }
+
+ private void onRuntimeNameChanged(String oldName, String newName) {
+ IProject[] ps = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ for (int i = 0; i < ps.length; i++) {
+ ISeamProject sp = SeamCorePlugin.getSeamProject(ps[i], false);
+ if (sp != null && oldName.equals(sp.getRuntimeName())) {
+ sp.setRuntimeName(newName);
+ }
+ }
+ }
}
\ No newline at end of file
Modified: branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java
===================================================================
--- branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java 2009-08-27 08:35:38 UTC (rev 17290)
+++ branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java 2009-08-27 08:44:22 UTC (rev 17291)
@@ -1,111 +1,112 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.seam.internal.core.project.facet;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.core.project.facet.SeamProjectPreferences;
-import org.jboss.tools.seam.core.project.facet.SeamRuntime;
-import org.jboss.tools.seam.core.project.facet.SeamRuntimeListConverter;
-import org.jboss.tools.seam.core.project.facet.SeamVersion;
-import org.osgi.service.prefs.BackingStoreException;
-
-/**
- * @author eskimo
- *
- */
-public class SeamFacetPreferenceInitializer extends
- AbstractPreferenceInitializer {
-
- public static String RUNTIME_CONFIG_FORMAT_VERSION = "1.0"; //$NON-NLS-1$
-
- public static final String SEAM_1_2_HOME = "../../../seam1"; //$NON-NLS-1$
- public static final String SEAM_2_0_HOME = "../../../seam"; //$NON-NLS-1$
-
- /**
- *
- */
- public SeamFacetPreferenceInitializer() {}
-
- @Override
- public void initializeDefaultPreferences() {
- IEclipsePreferences node = (IEclipsePreferences)
- Platform.getPreferencesService()
- .getRootNode()
- .node(DefaultScope.SCOPE)
- .node(SeamCorePlugin.PLUGIN_ID);
-
- node.put(SeamProjectPreferences.RUNTIME_CONFIG_FORMAT_VERSION, RUNTIME_CONFIG_FORMAT_VERSION);
- node.put(SeamProjectPreferences.JBOSS_AS_DEFAULT_DEPLOY_AS, "war"); //$NON-NLS-1$
- node.put(SeamProjectPreferences.HIBERNATE_DEFAULT_DB_TYPE, "HSQL"); //$NON-NLS-1$
- node.put(SeamProjectPreferences.SEAM_DEFAULT_CONNECTION_PROFILE, "DefaultDS"); //$NON-NLS-1$
- Map<String, SeamRuntime> map = new HashMap<String,SeamRuntime>();
-
- // Initialize Seam 1.2 Runtime from JBoss EAP
- String seamGenBuildPath = getSeamGenBuildPath(SEAM_1_2_HOME);
- File seamFolder = new File(seamGenBuildPath);
- if(seamFolder.exists() && seamFolder.isDirectory()) {
- SeamRuntime rt = new SeamRuntime();
- rt.setHomeDir(seamGenBuildPath);
- rt.setName("Seam " + SeamVersion.SEAM_1_2 + ".AP"); //$NON-NLS-1$ //$NON-NLS-2$
- rt.setDefault(true);
- rt.setVersion(SeamVersion.SEAM_1_2);
- map.put(rt.getName(), rt);
- }
- // Initialize Seam 2.0 Runtime from JBoss EAP
- seamGenBuildPath = getSeamGenBuildPath(SEAM_2_0_HOME);
- seamFolder = new File(seamGenBuildPath);
- if(seamFolder.exists() && seamFolder.isDirectory()) {
- SeamRuntime rt = new SeamRuntime();
- rt.setHomeDir(seamGenBuildPath);
- rt.setName("Seam " + SeamVersion.SEAM_2_1); //$NON-NLS-1$ //$NON-NLS-2$
- rt.setDefault(true);
- rt.setVersion(SeamVersion.SEAM_2_1);
- map.put(rt.getName(), rt);
- }
- node.put(SeamProjectPreferences.RUNTIME_LIST, new SeamRuntimeListConverter().getString(map));
- try {
- node.flush();
- } catch (BackingStoreException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- }
- }
-
-
-
- private String getSeamGenBuildPath(String seamHomePath) {
- String pluginLocation=null;
- try {
- pluginLocation = FileLocator.resolve(SeamCorePlugin.getDefault().getBundle().getEntry("/")).getFile(); //$NON-NLS-1$
- } catch (IOException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- };
- File seamGenDir = new File(pluginLocation, seamHomePath);
- Path p = new Path(seamGenDir.getPath());
- p.makeAbsolute();
- if(p.toFile().exists()) {
- return p.toOSString();
- } else {
- return ""; //$NON-NLS-1$
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.seam.internal.core.project.facet;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.project.facet.SeamProjectPreferences;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeListConverter;
+import org.jboss.tools.seam.core.project.facet.SeamVersion;
+import org.osgi.service.prefs.BackingStoreException;
+
+/**
+ * @author eskimo
+ *
+ */
+public class SeamFacetPreferenceInitializer extends
+ AbstractPreferenceInitializer {
+
+ public static String RUNTIME_CONFIG_FORMAT_VERSION = "1.0"; //$NON-NLS-1$
+
+ public static final String SEAM_1_2_HOME = "../../../seam1"; //$NON-NLS-1$
+ public static final String SEAM_2_0_HOME = "../../../seam"; //$NON-NLS-1$
+
+ /**
+ *
+ */
+ public SeamFacetPreferenceInitializer() {}
+
+ @Override
+ public void initializeDefaultPreferences() {
+ IEclipsePreferences node = (IEclipsePreferences)
+ Platform.getPreferencesService()
+ .getRootNode()
+ .node(DefaultScope.SCOPE)
+ .node(SeamCorePlugin.PLUGIN_ID);
+
+// node.put(SeamProjectPreferences.SEAM_CONFIG_TEMPLATE, "template.jst.seam2"); //$NON-NLS-1$
+ node.put(SeamProjectPreferences.RUNTIME_CONFIG_FORMAT_VERSION, RUNTIME_CONFIG_FORMAT_VERSION);
+ node.put(SeamProjectPreferences.JBOSS_AS_DEFAULT_DEPLOY_AS, "war"); //$NON-NLS-1$
+ node.put(SeamProjectPreferences.HIBERNATE_DEFAULT_DB_TYPE, "HSQL"); //$NON-NLS-1$
+ node.put(SeamProjectPreferences.SEAM_DEFAULT_CONNECTION_PROFILE, "DefaultDS"); //$NON-NLS-1$
+ Map<String, SeamRuntime> map = new HashMap<String,SeamRuntime>();
+
+ // Initialize Seam 1.2 Runtime from JBoss EAP
+ String seamGenBuildPath = getSeamGenBuildPath(SEAM_1_2_HOME);
+ File seamFolder = new File(seamGenBuildPath);
+ if(seamFolder.exists() && seamFolder.isDirectory()) {
+ SeamRuntime rt = new SeamRuntime();
+ rt.setHomeDir(seamGenBuildPath);
+ rt.setName("Seam " + SeamVersion.SEAM_1_2 + ".AP"); //$NON-NLS-1$ //$NON-NLS-2$
+ rt.setDefault(true);
+ rt.setVersion(SeamVersion.SEAM_1_2);
+ map.put(rt.getName(), rt);
+ }
+ // Initialize Seam 2.0 Runtime from JBoss EAP
+ seamGenBuildPath = getSeamGenBuildPath(SEAM_2_0_HOME);
+ seamFolder = new File(seamGenBuildPath);
+ if(seamFolder.exists() && seamFolder.isDirectory()) {
+ SeamRuntime rt = new SeamRuntime();
+ rt.setHomeDir(seamGenBuildPath);
+ rt.setName("Seam " + SeamVersion.SEAM_2_1); //$NON-NLS-1$ //$NON-NLS-2$
+ rt.setDefault(true);
+ rt.setVersion(SeamVersion.SEAM_2_1);
+ map.put(rt.getName(), rt);
+ }
+ node.put(SeamProjectPreferences.RUNTIME_LIST, new SeamRuntimeListConverter().getString(map));
+ try {
+ node.flush();
+ } catch (BackingStoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
+
+
+
+ private String getSeamGenBuildPath(String seamHomePath) {
+ String pluginLocation=null;
+ try {
+ pluginLocation = FileLocator.resolve(SeamCorePlugin.getDefault().getBundle().getEntry("/")).getFile(); //$NON-NLS-1$
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ };
+ File seamGenDir = new File(pluginLocation, seamHomePath);
+ Path p = new Path(seamGenDir.getPath());
+ p.makeAbsolute();
+ if(p.toFile().exists()) {
+ return p.toOSString();
+ } else {
+ return ""; //$NON-NLS-1$
+ }
+ }
+}
Modified: branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
--- branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2009-08-27 08:35:38 UTC (rev 17290)
+++ branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2009-08-27 08:44:22 UTC (rev 17291)
@@ -13,7 +13,9 @@
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IProject;
@@ -25,6 +27,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Preferences;
import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
@@ -54,6 +57,7 @@
import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelSynchHelper;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
+import org.eclipse.wst.common.project.facet.core.IPreset;
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
@@ -69,13 +73,13 @@
import org.jboss.tools.jst.web.server.RegistrationHelper;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.project.facet.SeamProjectPreferences;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.core.project.facet.SeamVersion;
import org.jboss.tools.seam.internal.core.project.facet.AntCopyUtils;
import org.jboss.tools.seam.internal.core.project.facet.DataSourceXmlDeployer;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
-import org.jboss.tools.seam.internal.core.project.facet.Seam2ProjectCreator;
import org.jboss.tools.seam.internal.core.project.facet.SeamFacetProjectCreationDataModelProvider;
-import org.jboss.tools.seam.internal.core.project.facet.SeamProjectCreator;
import org.jboss.tools.seam.ui.ISeamHelpContextIds;
import org.jboss.tools.seam.ui.SeamGuiPlugin;
import org.jboss.tools.seam.ui.SeamUIMessages;
@@ -88,6 +92,14 @@
*/
public class SeamProjectWizard extends WebProjectWizard {
+ private SeamWebProjectFirstPage firstPage;
+ private String seamConfigTemplate;
+
+ // We need these controls there to listen to them to set seam action models.
+ private Combo matchedServerTargetCombo;
+ private Control[] dependentServerControls;
+ private Combo serverRuntimeTargetCombo;
+
public SeamProjectWizard() {
super();
setWindowTitle(SeamUIMessages.SEAM_PROJECT_WIZARD_NEW_SEAM_PROJECT);
@@ -102,8 +114,6 @@
return DataModelFactory.createDataModel(new SeamFacetProjectCreationDataModelProvider());
}
- private SeamWebProjectFirstPage firstPage;
-
@Override
protected IWizardPage createFirstPage() {
firstPage = new SeamWebProjectFirstPage(model, "first.page"); //$NON-NLS-1$
@@ -114,11 +124,21 @@
return firstPage;
}
- // We need these controls there to listen to them to set seam action models.
- private Combo matchedServerTargetCombo;
- private Control[] dependentServerControls;
- private Combo serverRuntimeTargetCombo;
+ private static final String templateJstSeam1 = "template.jst.seam"; //$NON-NLS-1$
+ private static final String templateJstSeam2 = "template.jst.seam2"; //$NON-NLS-1$
+ private static final String templateJstSeam21 = "template.jst.seam21"; //$NON-NLS-1$
+ private static final Map<String, String> templates = new HashMap<String, String>();
+ static {
+ templates.put("jst.seam.preset", templateJstSeam1); //$NON-NLS-1$
+ templates.put("jst.seam2.preset", templateJstSeam2); //$NON-NLS-1$
+ templates.put("jst.seam21.preset", templateJstSeam21); //$NON-NLS-1$
+ }
+
+ private void setSeamConfigTemplate(String seamConfigTemplate) {
+ this.seamConfigTemplate = seamConfigTemplate;
+ }
+
@Override
public void createPageControls(Composite container) {
super.createPageControls(container);
@@ -130,6 +150,12 @@
}, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED);
getFacetedProjectWorkingCopy().addListener(new IFacetedProjectListener() {
public void handleEvent(IFacetedProjectEvent event) {
+ IPreset preset = getFacetedProjectWorkingCopy().getSelectedPreset();
+ setSeamConfigTemplate(templates.get(preset.getId()));
+ }
+ }, IFacetedProjectEvent.Type.SELECTED_PRESET_CHANGED);
+ getFacetedProjectWorkingCopy().addListener(new IFacetedProjectListener() {
+ public void handleEvent(IFacetedProjectEvent event) {
Set<Action> actions = getFacetedProjectWorkingCopy().getProjectFacetActions();
for (Action action : actions) {
if(ISeamFacetDataModelProperties.SEAM_FACET_ID.equals(action.getProjectFacetVersion().getProjectFacet().getId())) {
@@ -203,7 +229,22 @@
}
protected IFacetedProjectTemplate getTemplate() {
- return ProjectFacetsManager.getTemplate("template.jst.seam"); //$NON-NLS-1$
+ seamConfigTemplate = null; //SeamCorePlugin.getDefault().getPluginPreferences().getString(SeamProjectPreferences.SEAM_CONFIG_TEMPLATE);
+ if(seamConfigTemplate==null || seamConfigTemplate.length()==0) {
+ SeamRuntime runtime = SeamRuntimeManager.getInstance().getLatestSeamRuntime();
+ if(runtime!=null) {
+ if(runtime.getVersion()==SeamVersion.SEAM_1_2) {
+ seamConfigTemplate = templateJstSeam1;
+ } else if(runtime.getVersion()==SeamVersion.SEAM_2_0) {
+ seamConfigTemplate = templateJstSeam2;
+ } else {
+ seamConfigTemplate = templateJstSeam21;
+ }
+ } else {
+ seamConfigTemplate = templateJstSeam21;
+ }
+ }
+ return ProjectFacetsManager.getTemplate(seamConfigTemplate);
}
/* (non-Javadoc)
@@ -503,12 +544,18 @@
public void storeDefaultSettings() {
super.storeDefaultSettings();
+ Preferences preferences = SeamCorePlugin.getDefault().getPluginPreferences();
String serverName = SeamFacetProjectCreationDataModelProvider.getServerName(model);
if (serverName != null && serverName.length() > 0) {
- SeamCorePlugin.getDefault().getPluginPreferences().setValue(
+ preferences.setValue(
SeamProjectPreferences.SEAM_LAST_SERVER_NAME,
serverName);
}
+ if(seamConfigTemplate!=null) {
+ preferences.setValue(
+ SeamProjectPreferences.SEAM_CONFIG_TEMPLATE,
+ seamConfigTemplate);
+ }
}
}
}
\ No newline at end of file
15 years, 5 months