JBoss Tools SVN: r9630 - in trunk/vpe/plugins/org.jboss.tools.vpe: resources/meta and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-08-08 11:49:53 -0400 (Fri, 08 Aug 2008)
New Revision: 9630
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalELReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalElVariablesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalResourceReference.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/resources/help/keys-vpe.properties
trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ElVariablesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReference.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesTableProvider.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeAddReferenceSupport.java
Log:
JBIDE-2594 issue implementation add global el variables scope.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/resources/help/keys-vpe.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/resources/help/keys-vpe.properties 2008-08-08 13:35:42 UTC (rev 9629)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/resources/help/keys-vpe.properties 2008-08-08 15:49:53 UTC (rev 9630)
@@ -15,6 +15,12 @@
VPEElReferenceExt.location=El Value
VPEElReferenceExt.prefix=Value
+VPEGlobalElReference.location=El Value
+VPEGlobalElReference.prefix=Value
+
+VPEGlobalElReferenceExt.location=El Value
+VPEGlobalElReferenceExt.prefix=Value
+
VpeResourcesDialog.WindowTitle=References to Resources
VpeResourcesDialog.Title=Page Design Options
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-08-08 13:35:42 UTC (rev 9629)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-08-08 15:49:53 UTC (rev 9630)
@@ -219,6 +219,112 @@
+
+
+ <!-- Added by estherbin https://jira.jboss.org/jira/browse/JBIDE-2594 -->
+ <XModelEntity ImplementingClass="%Regular%" name="VPEGlobalElReference">
+
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="action.empty" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute name="location" xmlname="location">
+ <Constraint/>
+ <Editor/>
+ </XModelAttribute>
+ <value name="Global: For all projects in workspace"/>
+ <XModelAttribute name="prefix">
+ <Constraint/>
+ <Editor/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
+ PROPERTIES="support=org.jboss.tools.vpe.editor.css.VpeAddReferenceSupport"
+ displayName="Add El Reference..." kind="action" name="AddItem">
+ <EntityData EntityName="VPEGlobalElReference">
+ <AttributeData AttributeName="location" Mandatory="no"/>
+ <AttributeData AttributeName="scope" Mandatory="no"/>
+ <AttributeData AttributeName="prefix" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem kind="list" name="EditActions">
+ <XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
+ PROPERTIES="support=org.jboss.tools.vpe.editor.css.VpeAddReferenceSupport"
+ displayName="Edit El Reference..." kind="action" name="EditItem">
+ <EntityData EntityName="VPEGlobalElReference">
+ <AttributeData AttributeName="location"/>
+ <AttributeData AttributeName="scope" Mandatory="no"/>
+ <AttributeData AttributeName="prefix" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+
+ <XModelEntity ImplementingClass="%Regular%" name="VPEGlobalElReferenceExt">
+
+
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="action.empty" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute name="location" xmlname="location">
+ <Constraint/>
+ <Editor/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="border=true"
+ default="Folder: Any Page at the Same Folder" name="scope" xmlname="scope">
+ <Constraint loader="ListString">
+ <value name="Global: For all projects in workspace"/>
+ </Constraint>
+ <Editor name="RadioArray"/>
+ </XModelAttribute>
+ <XModelAttribute name="prefix">
+ <Constraint/>
+ <Editor/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
+ PROPERTIES="support=org.jboss.tools.vpe.editor.css.VpeAddReferenceSupport"
+ displayName="Add El Reference..." kind="action" name="AddItem">
+ <EntityData EntityName="VPEGlobalElReferenceExt">
+ <AttributeData AttributeName="location"/>
+ <AttributeData AttributeName="scope" Mandatory="no"/>
+ <AttributeData AttributeName="prefix" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem kind="list" name="EditActions">
+ <XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
+ PROPERTIES="support=org.jboss.tools.vpe.editor.css.VpeAddReferenceSupport"
+ displayName="Edit El Reference..." kind="action" name="EditItem">
+ <EntityData EntityName="VPEGlobalElReferenceExt">
+ <AttributeData AttributeName="location"/>
+ <AttributeData AttributeName="scope" Mandatory="no"/>
+ <AttributeData AttributeName="prefix" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <!-- -->
+
+
+
+
<XModelEntity ImplementingClass="%Regular%" name="VPEFolderReference">
<XChildrenEntities/>
<XEntityRenderer>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ElVariablesComposite.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ElVariablesComposite.java 2008-08-08 13:35:42 UTC (rev 9629)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ElVariablesComposite.java 2008-08-08 15:49:53 UTC (rev 9630)
@@ -13,7 +13,7 @@
* Creates the table provider.
*
* @param dataList the data list
- *
+ * g
* @return the resource references table provider
*/
@Override
@@ -32,7 +32,7 @@
return (file != null) ? "VPEElReference" : "VPEElReferenceExt";
}
- /**
+ /**c
* Gets the reference list.
*
* @return the reference list
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalELReferenceList.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalELReferenceList.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalELReferenceList.java 2008-08-08 15:49:53 UTC (rev 9630)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * 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.vpe.editor.css;
+
+import org.eclipse.core.runtime.QualifiedName;
+
+/**
+ * @author Evgenij Stherbin
+ *
+ */
+public class GlobalELReferenceList extends ResourceReferenceList {
+ /** The PROPERT y_ NAME. */
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("", "org.jboss.tools.vpe.editor.css.GlobalELReference");
+
+ /** The instance. */
+ private static GlobalELReferenceList instance = new GlobalELReferenceList();
+
+ /**
+ * Gets the instance.
+ *
+ * @return the instance
+ */
+ public synchronized static GlobalELReferenceList getInstance() {
+ return instance;
+ }
+
+ private GlobalELReferenceList() {
+ super();
+ }
+
+ /**
+ * Gets the property name.
+ *
+ * @return the property name
+ */
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+
+
+}
Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalELReferenceList.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalElVariablesComposite.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalElVariablesComposite.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalElVariablesComposite.java 2008-08-08 15:49:53 UTC (rev 9630)
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * 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.vpe.editor.css;
+
+import java.util.List;
+
+/**
+ * Composite class for the global el variables.
+ * @author Evgenij Stherbin
+ *
+ */
+public class GlobalElVariablesComposite extends ResourceReferencesComposite {
+
+ /**
+ * @see org.jboss.tools.vpe.editor.css.ResourceReferencesComposite#createGroupLabel()
+ */
+ @Override
+ protected String createGroupLabel() {
+ return "";
+ }
+
+ /**
+ * @see org.jboss.tools.vpe.editor.css.ResourceReferencesComposite#createTableProvider(java.util.List)
+ */
+ @Override
+ protected ResourceReferencesTableProvider createTableProvider(List dataList) {
+ return ResourceReferencesTableProvider.getGlobalELTableProvider(dataList);
+ }
+
+ /**
+ * @see org.jboss.tools.vpe.editor.css.ResourceReferencesComposite#getEntity()
+ */
+ @Override
+ protected String getEntity() {
+ return (file != null) ? "VPEGlobalElReference" : "VPEGlobalElReferenceExt";
+ }
+
+ /**
+ * @see org.jboss.tools.vpe.editor.css.ResourceReferencesComposite#getReferenceList()
+ */
+ @Override
+ protected ResourceReferenceList getReferenceList() {
+ return GlobalELReferenceList.getInstance();
+ }
+
+ @Override
+ protected ResourceReference getDefaultResourceReference() {
+ ResourceReference rf = new ResourceReference("", ResourceReference.GLOBAL_SCOPE);
+ rf.setGlobal(true);
+ return rf;
+ }
+
+}
Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalElVariablesComposite.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalResourceReference.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalResourceReference.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalResourceReference.java 2008-08-08 15:49:53 UTC (rev 9630)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * 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.vpe.editor.css;
+
+/**
+ * Global resource reference
+ * @author Evgenij Stherbin
+ *
+ */
+public class GlobalResourceReference extends ResourceReference {
+
+ /**
+ * @param location
+ * @param scope
+ */
+ public GlobalResourceReference(String location, int scope) {
+ super(location, scope);
+ }
+
+}
Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalResourceReference.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReference.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReference.java 2008-08-08 13:35:42 UTC (rev 9629)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReference.java 2008-08-08 15:49:53 UTC (rev 9630)
@@ -11,18 +11,29 @@
package org.jboss.tools.vpe.editor.css;
public class ResourceReference {
- public static int FILE_SCOPE = 0;
- public static int FOLDER_SCOPE = 1;
- public static int PROJECT_SCOPE = 2;
+ public final static int FILE_SCOPE = 0;
+ public final static int FOLDER_SCOPE = 1;
+ public final static int PROJECT_SCOPE = 2;
+ public final static int GLOBAL_SCOPE = 3;
- public static String[] SCOPE_NAMES = new String[]{"Page", "Folder", "Project"};
+ public final static String[] SCOPE_NAMES = new String[]{"Page", "Folder", "Project","Global"};
- private String location;
- private int scope;
- private int depth = 0;
- private String properties = "";
+ protected String location;
+ protected int scope;
+ protected int depth = 0;
+ protected String properties = "";
- public ResourceReference(String location, int scope) {
+ protected boolean isGlobal = false;
+
+ public boolean isGlobal() {
+ return isGlobal;
+ }
+
+ public void setGlobal(boolean isGlobal) {
+ this.isGlobal = isGlobal;
+ }
+
+ public ResourceReference(String location, int scope) {
this.location = location;
this.scope = scope;
int q = location.indexOf('%');
@@ -75,5 +86,24 @@
}
return v;
}
+
+
+// public static ResourceReference createResourceReference(String location, int scope) {
+// ResourceReference rst = null;
+//
+// switch (scope) {
+// case FILE_SCOPE:
+// case FOLDER_SCOPE:
+// case PROJECT_SCOPE:
+// rst = new ResourceReference(location, scope);
+// break;
+// case GLOBAL_SCOPE:
+// rst = new GlobalResourceReference(location, scope);
+// break;
+// default:
+// throw new IllegalArgumentException("Illegal scope=" + scope);
+// }
+// return rst;
+// }
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferenceList.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferenceList.java 2008-08-08 13:35:42 UTC (rev 9629)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferenceList.java 2008-08-08 15:49:53 UTC (rev 9630)
@@ -202,11 +202,16 @@
List css = new ArrayList();
IPath parent = path.removeLastSegments(1);
int depth = 0;
+ boolean isGlobal = path.equals(Platform.getLocation());
+ int setScope = isGlobal ? ResourceReference.GLOBAL_SCOPE : ResourceReference.FILE_SCOPE;
while(parent != null && parent.segmentCount() > 1) {
- String[] dcss = getDeclaredResources(parent);
+ String[] dcss = getDeclaredResources(path);
for (int i = 0; i < dcss.length; i++) {
if(locations.contains(dcss[i])) continue;
- ResourceReference ref = new ResourceReference(dcss[i], ResourceReference.FOLDER_SCOPE);
+ ResourceReference ref = new ResourceReference(dcss[i],isGlobal ? ResourceReference.GLOBAL_SCOPE : ResourceReference.FOLDER_SCOPE);
+ if(isGlobal){
+ ref.setGlobal(true);
+ }
ref.setDepth(depth);
locations.add(dcss[i]);
css.add(ref);
@@ -217,7 +222,10 @@
String[] dcss = getDeclaredResources(path);
for (int i = 0; i < dcss.length; i++) {
if(locations.contains(dcss[i])) continue;
- ResourceReference ref = new ResourceReference(dcss[i], ResourceReference.FILE_SCOPE);
+ ResourceReference ref = new ResourceReference(dcss[i], setScope);
+ if(setScope == ResourceReference.GLOBAL_SCOPE){
+ ref.setGlobal(true);
+ }
locations.add(dcss[i]);
css.add(ref);
}
@@ -231,7 +239,10 @@
public void setAllResources(IPath path, ResourceReference[] entries) {
IPath changed = null;
- boolean b = setDeclaredResources(path, entries, ResourceReference.FILE_SCOPE, 0);
+ boolean b = false;
+ int checkScope = path.equals(Platform.getLocation()) ? ResourceReference.GLOBAL_SCOPE : ResourceReference.FILE_SCOPE;
+
+ b = setDeclaredResources(path, entries, checkScope, 0);
if(b) changed = path;
IPath parent = path.removeLastSegments(1);
int depth = 0;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesComposite.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesComposite.java 2008-08-08 13:35:42 UTC (rev 9629)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesComposite.java 2008-08-08 15:49:53 UTC (rev 9630)
@@ -128,7 +128,7 @@
public void action(String command) {
int index = table.getSelectionIndex();
if(ADD.equals(command)) {
- add(index);
+ add(index);
} else if(EDIT.equals(command)) {
edit(index);
} else if(REMOVE.equals(command)) {
@@ -139,7 +139,8 @@
}
protected void add(int index) {
- ResourceReference css = new ResourceReference("", ResourceReference.FOLDER_SCOPE);
+ ResourceReference css = getDefaultResourceReference();
+
initFilterInFileChooser();
boolean ok = VpeAddReferenceSupport.add(file, css, getReferenceArray(), getEntity());
if(!ok) return;
@@ -147,6 +148,13 @@
update();
table.setSelection(dataList.size() - 1);
}
+
+ /**
+ * @return
+ */
+ protected ResourceReference getDefaultResourceReference() {
+ return new ResourceReference("", ResourceReference.FOLDER_SCOPE);
+ }
protected void edit(int index) {
if(index < 0) return;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesTableProvider.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesTableProvider.java 2008-08-08 13:35:42 UTC (rev 9629)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesTableProvider.java 2008-08-08 15:49:53 UTC (rev 9630)
@@ -19,6 +19,7 @@
static String[] IMG_COLUMNS = new String[]{"Scope", "Image Folder Path"};
static String[] TLD_COLUMNS = new String[]{"Scope", "URI", "Prefix"};
static String[] EL_COLUMNS = new String[]{"Scope", "El Expression", "Value"};
+ private final static String[] GLOBAL_EL_COLUMNS = new String[]{"Scope","El Expression", "Value"};
int[] widths = new int[]{50, 200};
List dataList;
@@ -49,7 +50,16 @@
p.widths = new int[]{50, 150, 50};
return p;
}
+
+ public static ResourceReferencesTableProvider getGlobalELTableProvider(final List dataList) {
+ ResourceReferencesTableProvider p = new ResourceReferencesTableProvider(dataList);
+
+ p.columns = GLOBAL_EL_COLUMNS;
+ p.widths = new int[]{50,150, 50};
+ return p;
+ }
+
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeAddReferenceSupport.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeAddReferenceSupport.java 2008-08-08 13:35:42 UTC (rev 9629)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeAddReferenceSupport.java 2008-08-08 15:49:53 UTC (rev 9630)
@@ -50,7 +50,11 @@
if(ok) {
css.setLocation(object.getAttributeValue("location"));
Integer scope = (Integer)p.get("scope");
+
css.setScope(scope.intValue());
+ if(css.isGlobal()){
+ css.setScope(ResourceReference.GLOBAL_SCOPE);
+ }
String properties = object.getAttributeValue("prefix");
if(properties != null) css.setProperties(properties);
}
@@ -70,8 +74,18 @@
if(initialPrefix != null) {
setAttributeValue(0, "prefix", initialPrefix);
}
- scopeNames = ((XAttributeConstraintL)getTarget().getModelEntity().getAttribute("scope").getConstraint()).getValues();
+ final XAttributeConstraintL scopeAttribute = ((XAttributeConstraintL) getTarget().getModelEntity().getAttribute("scope")
+ .getConstraint());
+ if (scopeAttribute != null) {
+ scopeNames = scopeAttribute.getValues();
+ }
int scopeIndex = ((Integer)getProperties().get("scope")).intValue();
+
+ if(scopeIndex == 1 && scopeNames.length == 1){
+ scopeIndex = 0;
+ }else if(scopeIndex > scopeNames.length){
+ scopeIndex = scopeNames.length -1;
+ }
String scope = scopeNames[scopeIndex];
setAttributeValue(0, "scope", scope);
list = (ResourceReference[])getProperties().get("list");
17 years, 4 months
JBoss Tools SVN: r9629 - trunk/documentation/movies/index/en.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-08-08 09:35:42 -0400 (Fri, 08 Aug 2008)
New Revision: 9629
Modified:
trunk/documentation/movies/index/en/master.xml
Log:
JBDS-352- correcting index page item name
Modified: trunk/documentation/movies/index/en/master.xml
===================================================================
--- trunk/documentation/movies/index/en/master.xml 2008-08-08 13:03:38 UTC (rev 9628)
+++ trunk/documentation/movies/index/en/master.xml 2008-08-08 13:35:42 UTC (rev 9629)
@@ -45,7 +45,7 @@
<listitem>
<para>
- <ulink url="demos/ootb_new_seam_project/ootb_new_seam_project.htm">New Seam Project</ulink>
+ <ulink url="demos/ootb_new_seam_project/new_seam_project.htm">New Seam Project</ulink>
</para>
<para>This movie shows you step-by-step how to crete a new seam project</para>
</listitem>
17 years, 4 months
JBoss Tools SVN: r9628 - trunk/jsf/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-08-08 09:03:38 -0400 (Fri, 08 Aug 2008)
New Revision: 9628
Modified:
trunk/jsf/docs/userguide/en/modules/palette.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-240 - deleting the sentence which is not correct
Modified: trunk/jsf/docs/userguide/en/modules/palette.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/palette.xml 2008-08-08 12:22:52 UTC (rev 9627)
+++ trunk/jsf/docs/userguide/en/modules/palette.xml 2008-08-08 13:03:38 UTC (rev 9628)
@@ -569,8 +569,7 @@
<para>JBoss Developer Studio comes with a tight integration with <emphasis>
<property>RichFaces</property>
</emphasis> component framework. RichFaces and Ajax4jsf in JBoss Tools Palette always
- exist, this palette is not dynamic and is not changed from file to file. JBoss Tools
- Palette supports only the last version of the <ulink url="http://www.jboss.org/jbossrichfaces">RichFaces</ulink> components.
+ exist, this palette is not dynamic and is not changed from file to file.
<tip>
<title>Tip:</title>
<para>If you'd like to know the last version of RichFaces component
17 years, 4 months
JBoss Tools SVN: r9627 - trunk/documentation/movies/archiving.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2008-08-08 08:22:52 -0400 (Fri, 08 Aug 2008)
New Revision: 9627
Added:
trunk/documentation/movies/archiving/archiving.htm
trunk/documentation/movies/archiving/archiving.js
trunk/documentation/movies/archiving/archiving.swf
trunk/documentation/movies/archiving/archiving.wnk
Log:
https://jira.jboss.org/jira/browse/JBDS-348
Added: trunk/documentation/movies/archiving/archiving.htm
===================================================================
--- trunk/documentation/movies/archiving/archiving.htm (rev 0)
+++ trunk/documentation/movies/archiving/archiving.htm 2008-08-08 12:22:52 UTC (rev 9627)
@@ -0,0 +1,27 @@
+<!-- saved from url=(0014)about:internet -->
+<HTML>
+<head>
+<link rel="stylesheet" href="../resources/tools.css" type="text/css"/>
+<link xmlns="" rel="shortcut icon" type="image/vnd.microsoft.icon" href="../resources/images/favicon.ico"/>
+</head>
+
+<BODY>
+<div class="book">
+<p id="title"><a href="http://www.jboss.org" class="site_href">
+<strong>JBoss.org</strong></a><a href="http://docs.jboss.org/" class="doc_href">
+<strong >Community Demos</strong></a></p>
+
+<center><OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="824" HEIGHT="638" CODEBASE="http://active.macromedia.com/flash5/cabs/swflash.cab#version=7,0,0,0">
+<PARAM NAME=movie VALUE="archiving.swf">
+<PARAM NAME=play VALUE=true>
+<PARAM NAME=loop VALUE=false>
+<PARAM NAME=wmode VALUE=transparent>
+<PARAM NAME=quality VALUE=low>
+<EMBED SRC="archiving.swf" WIDTH=824 HEIGHT=638 quality=low loop=false wmode=transparent TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=Sh...">
+</EMBED>
+</OBJECT></center>
+
+</div>
+<SCRIPT src='archiving.js'></script>
+</BODY>
+</HTML>
Added: trunk/documentation/movies/archiving/archiving.js
===================================================================
--- trunk/documentation/movies/archiving/archiving.js (rev 0)
+++ trunk/documentation/movies/archiving/archiving.js 2008-08-08 12:22:52 UTC (rev 9627)
@@ -0,0 +1,3 @@
+obj=document.getElementsByTagName('object');
+for (var i=0; i<obj.length; ++i)
+ obj[i].outerHTML=obj[i].outerHTML;
Added: trunk/documentation/movies/archiving/archiving.swf
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/movies/archiving/archiving.swf
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/movies/archiving/archiving.wnk
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/movies/archiving/archiving.wnk
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 4 months
JBoss Tools SVN: r9626 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4: editor and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-08-08 08:12:29 -0400 (Fri, 08 Aug 2008)
New Revision: 9626
Removed:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/wrapper/
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlPaletteFactory.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TransitionEditPart.java
Log:
get rid of the wrapper implementations
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlPaletteFactory.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlPaletteFactory.java 2008-08-08 12:10:16 UTC (rev 9625)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlPaletteFactory.java 2008-08-08 12:12:29 UTC (rev 9626)
@@ -11,10 +11,6 @@
import org.jboss.tools.flow.common.editor.PaletteFactory;
import org.jboss.tools.flow.common.registry.ElementRegistry;
import org.jboss.tools.flow.jpdl4.Activator;
-import org.jboss.tools.flow.jpdl4.wrapper.EndStateWrapper;
-import org.jboss.tools.flow.jpdl4.wrapper.StartStateWrapper;
-import org.jboss.tools.flow.jpdl4.wrapper.StateWrapper;
-import org.jboss.tools.flow.jpdl4.wrapper.SuperStateWrapper;
public class JpdlPaletteFactory extends PaletteFactory {
@@ -24,7 +20,7 @@
CombinedTemplateCreationEntry combined = new CombinedTemplateCreationEntry(
"Start",
"Create a new Start State",
- StartStateWrapper.class,
+ "org.jboss.tools.flow.jpdl4.startState",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.startState"),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/start.gif")),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/start.gif"))
@@ -34,7 +30,7 @@
combined = new CombinedTemplateCreationEntry(
"State",
"Create a new State",
- StateWrapper.class,
+ "org.jboss.tools.flow.jpdl4.state",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.state"),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/state.gif")),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/state.gif"))
@@ -44,7 +40,7 @@
combined = new CombinedTemplateCreationEntry(
"End",
"Create a new End State",
- EndStateWrapper.class,
+ "org.jboss.tools.flow.jpdl4.endState",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.endState"),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/end.gif")),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/end.gif"))
@@ -54,7 +50,7 @@
combined = new CombinedTemplateCreationEntry(
"Super State",
"Create a new Super State",
- SuperStateWrapper.class,
+ "org.jboss.tools.flow.jpdl4.superState",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.superState"),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/super.gif")),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/super.gif"))
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TransitionEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TransitionEditPart.java 2008-08-08 12:10:16 UTC (rev 9625)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TransitionEditPart.java 2008-08-08 12:12:29 UTC (rev 9626)
@@ -1,12 +1,12 @@
package org.jboss.tools.flow.jpdl4.editpart;
import org.jboss.tools.flow.common.editpart.ConnectionEditPart;
-import org.jboss.tools.flow.jpdl4.wrapper.TransitionWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultConnectionWrapper;
public class TransitionEditPart extends ConnectionEditPart {
protected Class<?> getElementConnectionType() {
- return TransitionWrapper.class;
+ return DefaultConnectionWrapper.class;
}
}
17 years, 4 months
JBoss Tools SVN: r9625 - trunk/documentation/movies/archiving.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2008-08-08 08:10:16 -0400 (Fri, 08 Aug 2008)
New Revision: 9625
Removed:
trunk/documentation/movies/archiving/archiving_demo.htm
trunk/documentation/movies/archiving/archiving_demo.js
trunk/documentation/movies/archiving/archiving_demo.swf
trunk/documentation/movies/archiving/archiving_demo.wnk
Log:
needs updating
Deleted: trunk/documentation/movies/archiving/archiving_demo.htm
===================================================================
--- trunk/documentation/movies/archiving/archiving_demo.htm 2008-08-08 11:58:29 UTC (rev 9624)
+++ trunk/documentation/movies/archiving/archiving_demo.htm 2008-08-08 12:10:16 UTC (rev 9625)
@@ -1,28 +0,0 @@
-<!-- saved from url=(0014)about:internet -->
-<HTML>
- <head>
-<link rel="stylesheet" href="../resources/tools.css" type="text/css"/>
-<link xmlns="" rel="shortcut icon" type="image/vnd.microsoft.icon" href="../resources/images/favicon.ico"/>
-</head>
-
-<BODY>
-<div class="book">
-<p id="title"><a href="http://www.jboss.org" class="site_href">
-<strong>JBoss.org</strong></a><a href="http://docs.jboss.org/" class="doc_href">
-<strong >Community Demos</strong></a></p>
-
-
-<center><OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="824" HEIGHT="638" CODEBASE="http://active.macromedia.com/flash5/cabs/swflash.cab#version=7,0,0,0">
-<PARAM NAME=movie VALUE="archiving_demo.swf">
-<PARAM NAME=play VALUE=true>
-<PARAM NAME=loop VALUE=false>
-<PARAM NAME=wmode VALUE=transparent>
-<PARAM NAME=quality VALUE=low>
-<EMBED SRC="archiving_demo.swf" WIDTH=824 HEIGHT=638 quality=low loop=false wmode=transparent TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=Sh...">
-</EMBED>
-</OBJECT></center>
-
-</div>
-<SCRIPT src='archiving_demo.js'></script>
-</BODY>
-</HTML>
Deleted: trunk/documentation/movies/archiving/archiving_demo.js
===================================================================
--- trunk/documentation/movies/archiving/archiving_demo.js 2008-08-08 11:58:29 UTC (rev 9624)
+++ trunk/documentation/movies/archiving/archiving_demo.js 2008-08-08 12:10:16 UTC (rev 9625)
@@ -1,3 +0,0 @@
-obj=document.getElementsByTagName('object');
-for (var i=0; i<obj.length; ++i)
- obj[i].outerHTML=obj[i].outerHTML;
Deleted: trunk/documentation/movies/archiving/archiving_demo.swf
===================================================================
(Binary files differ)
Deleted: trunk/documentation/movies/archiving/archiving_demo.wnk
===================================================================
(Binary files differ)
17 years, 4 months
JBoss Tools SVN: r9624 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4: src/org/jboss/tools/flow/jpdl4/editor and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-08-08 07:58:29 -0400 (Fri, 08 Aug 2008)
New Revision: 9624
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
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/JpdlPaletteFactory.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlEditPartFactory.java
Log:
added node pluggability
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2008-08-08 11:58:05 UTC (rev 9623)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2008-08-08 11:58:29 UTC (rev 9624)
@@ -20,5 +20,57 @@
name="jBPM Process Definition Language">
</language>
</extension>
+ <extension
+ point="org.jboss.tools.flow.common.elements">
+ <element
+ class="org.jboss.tools.flow.jpdl4.model.Process"
+ id="org.jboss.tools.flow.jpdl4.process"
+ language="org.jboss.tools.flow.jpdl4"
+ name="Process Definition">
+ <flow
+ acceptsElementStrategy="org.jboss.tools.flow.jpdl4.strategy.ProcessAcceptsElementStrategy"></flow>
+ </element>
+ <element
+ class="org.jboss.tools.flow.common.model.DefaultContainer"
+ id="org.jboss.tools.flow.jpdl4.superState"
+ language="org.jboss.tools.flow.jpdl4"
+ name="Super State">
+ <container></container>
+ </element>
+ <element
+ class="org.jboss.tools.flow.jpdl4.model.StartState"
+ id="org.jboss.tools.flow.jpdl4.startState"
+ language="org.jboss.tools.flow.jpdl4"
+ name="Start">
+ <node
+ acceptsIncomingConnectionStrategy="org.jboss.tools.flow.jpdl4.strategy.StartStateAcceptsIncomingConnectionStrategy">
+ </node>
+ </element>
+ <element
+ class="org.jboss.tools.flow.jpdl4.model.EndState"
+ id="org.jboss.tools.flow.jpdl4.endState"
+ language="org.jboss.tools.flow.jpdl4"
+ name="End">
+ <node
+ acceptsOutgoingConnectionStrategy="org.jboss.tools.flow.jpdl4.strategy.EndStateAcceptsOutgoingConnectionStrategy">
+ </node>
+ </element>
+ <element
+ class="org.jboss.tools.flow.jpdl4.model.State"
+ id="org.jboss.tools.flow.jpdl4.state"
+ language="org.jboss.tools.flow.jpdl4"
+ name="State">
+ <node></node>
+ </element>
+ <element
+ class="org.jboss.tools.flow.jpdl4.model.Transition"
+ id="org.jboss.tools.flow.jpdl4.transition"
+ language="org.jboss.tools.flow.jpdl4"
+ name="Transition">
+ <connection>
+
+ </connection>
+ </element>
+ </extension>
</plugin>
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-08-08 11:58:05 UTC (rev 9623)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java 2008-08-08 11:58:29 UTC (rev 9624)
@@ -7,8 +7,8 @@
import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.palette.PaletteRoot;
import org.jboss.tools.flow.common.editor.GenericModelEditor;
+import org.jboss.tools.flow.common.registry.ElementRegistry;
import org.jboss.tools.flow.jpdl4.editpart.JpdlEditPartFactory;
-import org.jboss.tools.flow.jpdl4.wrapper.ProcessWrapper;
public class JpdlEditor extends GenericModelEditor {
@@ -21,7 +21,7 @@
}
protected Object createModel() {
- return new ProcessWrapper();
+ return ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.process");
}
protected void writeModel(OutputStream os) throws IOException {
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlPaletteFactory.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlPaletteFactory.java 2008-08-08 11:58:05 UTC (rev 9623)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlPaletteFactory.java 2008-08-08 11:58:29 UTC (rev 9624)
@@ -7,15 +7,14 @@
import org.eclipse.gef.palette.ConnectionCreationToolEntry;
import org.eclipse.gef.palette.PaletteEntry;
import org.eclipse.gef.palette.ToolEntry;
-import org.eclipse.gef.requests.SimpleFactory;
import org.eclipse.jface.resource.ImageDescriptor;
import org.jboss.tools.flow.common.editor.PaletteFactory;
+import org.jboss.tools.flow.common.registry.ElementRegistry;
import org.jboss.tools.flow.jpdl4.Activator;
import org.jboss.tools.flow.jpdl4.wrapper.EndStateWrapper;
import org.jboss.tools.flow.jpdl4.wrapper.StartStateWrapper;
import org.jboss.tools.flow.jpdl4.wrapper.StateWrapper;
import org.jboss.tools.flow.jpdl4.wrapper.SuperStateWrapper;
-import org.jboss.tools.flow.jpdl4.wrapper.TransitionWrapper;
public class JpdlPaletteFactory extends PaletteFactory {
@@ -26,7 +25,7 @@
"Start",
"Create a new Start State",
StartStateWrapper.class,
- new SimpleFactory(StartStateWrapper.class),
+ ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.startState"),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/start.gif")),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/start.gif"))
);
@@ -36,7 +35,7 @@
"State",
"Create a new State",
StateWrapper.class,
- new SimpleFactory(StateWrapper.class),
+ ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.state"),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/state.gif")),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/state.gif"))
);
@@ -46,7 +45,7 @@
"End",
"Create a new End State",
EndStateWrapper.class,
- new SimpleFactory(EndStateWrapper.class),
+ ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.endState"),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/end.gif")),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/end.gif"))
);
@@ -56,7 +55,7 @@
"Super State",
"Create a new Super State",
SuperStateWrapper.class,
- new SimpleFactory(SuperStateWrapper.class),
+ ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.superState"),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/super.gif")),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/super.gif"))
);
@@ -65,7 +64,7 @@
ToolEntry tool = new ConnectionCreationToolEntry(
"Transition",
"Creating a new Transition",
- new SimpleFactory(TransitionWrapper.class),
+ ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.transition"),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/transition.gif")),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/transition.gif"))
);
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlEditPartFactory.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlEditPartFactory.java 2008-08-08 11:58:05 UTC (rev 9623)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlEditPartFactory.java 2008-08-08 11:58:29 UTC (rev 9624)
@@ -2,31 +2,36 @@
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
+import org.jboss.tools.flow.common.editpart.ConnectionEditPart;
import org.jboss.tools.flow.common.editpart.ContainerEditPart;
import org.jboss.tools.flow.common.editpart.RootEditPart;
-import org.jboss.tools.flow.jpdl4.wrapper.EndStateWrapper;
-import org.jboss.tools.flow.jpdl4.wrapper.ProcessWrapper;
-import org.jboss.tools.flow.jpdl4.wrapper.StartStateWrapper;
-import org.jboss.tools.flow.jpdl4.wrapper.StateWrapper;
-import org.jboss.tools.flow.jpdl4.wrapper.SuperStateWrapper;
-import org.jboss.tools.flow.jpdl4.wrapper.TransitionWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultFlowWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultNodeWrapper;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.model.EndState;
+import org.jboss.tools.flow.jpdl4.model.StartState;
+import org.jboss.tools.flow.jpdl4.model.State;
public class JpdlEditPartFactory implements EditPartFactory {
public EditPart createEditPart(EditPart context, Object model) {
EditPart result = null;
- if (model instanceof ProcessWrapper) {
+ if (!(model instanceof Wrapper)) return result;
+ Object element = ((Wrapper)model).getElement();
+ if (model instanceof DefaultFlowWrapper) {
result = new RootEditPart();
- } else if (model instanceof SuperStateWrapper) {
+ } else if (model instanceof DefaultContainerWrapper) {
result = new ContainerEditPart();
- } else if (model instanceof StartStateWrapper) {
+ } else if (model instanceof DefaultNodeWrapper && element instanceof StartState) {
result = new StartStateEditPart();
- } else if (model instanceof StateWrapper) {
+ } else if (model instanceof DefaultNodeWrapper && element instanceof State) {
result = new StateEditPart();
- } else if (model instanceof EndStateWrapper) {
+ } else if (model instanceof DefaultNodeWrapper && element instanceof EndState) {
result = new EndStateEditPart();
- } else if (model instanceof TransitionWrapper) {
- result = new TransitionEditPart();
+ } else if (model instanceof DefaultConnectionWrapper) {
+ result = new ConnectionEditPart();
} else {
throw new IllegalArgumentException(
"Unknown model object " + model);
17 years, 4 months
JBoss Tools SVN: r9623 - in trunk/flow/plugins/org.jboss.tools.flow.common: META-INF and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-08-08 07:58:05 -0400 (Fri, 08 Aug 2008)
New Revision: 9623
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/schema/elements.exsd
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/Logger.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF
trunk/flow/plugins/org.jboss.tools.flow.common/plugin.xml
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java
Log:
added node pluggability
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF 2008-08-08 11:57:37 UTC (rev 9622)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF 2008-08-08 11:58:05 UTC (rev 9623)
@@ -23,6 +23,7 @@
org.jboss.tools.flow.common.figure,
org.jboss.tools.flow.common.model,
org.jboss.tools.flow.common.policy,
+ org.jboss.tools.flow.common.registry,
org.jboss.tools.flow.common.strategy,
org.jboss.tools.flow.common.wrapper
Bundle-ClassPath: .
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/plugin.xml
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/plugin.xml 2008-08-08 11:57:37 UTC (rev 9622)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/plugin.xml 2008-08-08 11:58:05 UTC (rev 9623)
@@ -2,5 +2,6 @@
<?eclipse version="3.2"?>
<plugin>
<extension-point id="languages" name="JBoss Tools Flow Language Extensions" schema="schema/languages.exsd"/>
+ <extension-point id="elements" name="JBoss Tools Flow Language Elements" schema="schema/elements.exsd"/>
</plugin>
Added: trunk/flow/plugins/org.jboss.tools.flow.common/schema/elements.exsd
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/schema/elements.exsd (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/schema/elements.exsd 2008-08-08 11:58:05 UTC (rev 9623)
@@ -0,0 +1,207 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.flow.common" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.jboss.tools.flow.common" id="elements" name="Flow Language Elements"/>
+ </appinfo>
+ <documentation>
+ This extension point provides a way to contribute language elements to a target flow language.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="element" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="element">
+ <complexType>
+ <choice>
+ <element ref="flow"/>
+ <element ref="container"/>
+ <element ref="node"/>
+ <element ref="connection"/>
+ </choice>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="language" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="flow">
+ <complexType>
+ <attribute name="acceptsElementStrategy" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.strategy.AcceptsElementStrategy"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="node">
+ <complexType>
+ <attribute name="acceptsIncomingConnectionStrategy" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="acceptsOutgoingConnectionStrategy" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="container">
+ <complexType>
+ <attribute name="acceptsElementStrategy" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.strategy.AcceptsElementStrategy"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="acceptsIncomingConnectionStrategy" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="acceptsOutgoingConnectionStrategy" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="connection" type="string">
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Added: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/Logger.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/Logger.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/Logger.java 2008-08-08 11:58:05 UTC (rev 9623)
@@ -0,0 +1,37 @@
+package org.jboss.tools.flow.common;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+
+public class Logger {
+
+ public static void logInfo(String message) {
+ log(IStatus.INFO, IStatus.OK, message, null);
+ }
+
+ public static void logError(Throwable exception) {
+ logError("Unexpected Exception", exception);
+ }
+
+ public static void logError(String message, Throwable exception) {
+ log(IStatus.ERROR, IStatus.OK, message, exception);
+ }
+
+ public static void log(int severity, int code, String message, Throwable exception) {
+ log(createStatus(severity, code, message, exception));
+ }
+
+ public static IStatus createStatus(int severity, int code, String message, Throwable exception) {
+ return new Status(
+ severity,
+ Activator.getDefault().getBundle().getSymbolicName(),
+ code,
+ message,
+ exception);
+ }
+
+ public static void log(IStatus status) {
+ Activator.getDefault().getLog().log(status);
+ }
+
+}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java 2008-08-08 11:57:37 UTC (rev 9622)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java 2008-08-08 11:58:05 UTC (rev 9623)
@@ -34,6 +34,7 @@
import org.jboss.tools.flow.common.policy.ConnectionBendpointEditPolicy;
import org.jboss.tools.flow.common.policy.ConnectionEditPolicy;
import org.jboss.tools.flow.common.wrapper.AbstractConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.ModelEvent;
import org.jboss.tools.flow.common.wrapper.ModelListener;
@@ -42,7 +43,7 @@
*
* @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
*/
-public abstract class ConnectionEditPart extends AbstractConnectionEditPart implements ModelListener {
+public class ConnectionEditPart extends AbstractConnectionEditPart implements ModelListener {
public AbstractConnectionWrapper getElementConnection() {
return (AbstractConnectionWrapper) getModel();
@@ -61,10 +62,10 @@
}
- protected abstract Class<?> getElementConnectionType();
-
-// protected abstract ConnectionFactory getElementConnectionFactory();
-
+ protected Class<?> getElementConnectionType() {
+ return DefaultConnectionWrapper.class;
+ }
+
protected IFigure createFigure() {
PolylineConnection result = new PolylineConnection();
result.setConnectionRouter(new BendpointConnectionRouter());
Added: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2008-08-08 11:58:05 UTC (rev 9623)
@@ -0,0 +1,193 @@
+package org.jboss.tools.flow.common.registry;
+
+import java.util.HashMap;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.gef.requests.CreationFactory;
+import org.jboss.tools.flow.common.Logger;
+import org.jboss.tools.flow.common.model.Container;
+import org.jboss.tools.flow.common.model.Flow;
+import org.jboss.tools.flow.common.model.Node;
+import org.jboss.tools.flow.common.strategy.AcceptsElementStrategy;
+import org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy;
+import org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy;
+import org.jboss.tools.flow.common.wrapper.DefaultConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultFlowWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultNodeWrapper;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+public class ElementRegistry {
+
+ private static final String elementsExtensionPointId = "org.jboss.tools.flow.common.elements";
+ private static HashMap<String, IConfigurationElement> elementMap = null;
+
+ private static void initializeRegistry() {
+ elementMap = new HashMap<String, IConfigurationElement>();
+ IConfigurationElement[] configurationElements =
+ Platform.getExtensionRegistry().getConfigurationElementsFor(elementsExtensionPointId);
+ for (IConfigurationElement configurationElement: configurationElements) {
+ elementMap.put(configurationElement.getAttribute("id"), configurationElement);
+ }
+ }
+
+ private static Wrapper createWrapper(IConfigurationElement configurationElement)
+ throws CoreException {
+ IConfigurationElement[] children = configurationElement.getChildren();
+ if (children.length != 1) return null;
+ String type = children[0].getName();
+ if ("flow".equals(type)) {
+ return createFlow(configurationElement);
+ } else if ("container".equals(type)) {
+ return createContainer(configurationElement);
+ } else if ("node".equals(type)) {
+ return createNode(configurationElement);
+ } else if ("connection".equals(type)) {
+ return createConnection(configurationElement);
+ } else {
+ return null;
+ }
+ }
+
+ private static Wrapper createConnection(IConfigurationElement configurationElement)
+ throws CoreException {
+ return new DefaultConnectionWrapper();
+ }
+
+ private static Wrapper createNode(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object element = configurationElement.createExecutableExtension("class");
+ if (!(element instanceof Node)) {
+ String message = "Expecting to instantiate a org.jboss.tools.flow.common.model.Node instance.";
+ Logger.logError(message, new RuntimeException(message));
+ return null;
+ }
+ DefaultNodeWrapper result = new DefaultNodeWrapper();
+ result.setElement(element);
+ AcceptsIncomingConnectionStrategy acceptsIncomingConnectionStrategy = createAcceptsIncomingConnectionStrategy(configurationElement);
+ if (acceptsIncomingConnectionStrategy != null) {
+ acceptsIncomingConnectionStrategy.setNode((Node)element);
+ result.setAcceptsIncomingConnectionStrategy(acceptsIncomingConnectionStrategy);
+ }
+ AcceptsOutgoingConnectionStrategy acceptsOutgoingConnectionStrategy = createAcceptsOutgoingConnectionStrategy(configurationElement);
+ if (acceptsOutgoingConnectionStrategy != null) {
+ acceptsOutgoingConnectionStrategy.setNode((Node)element);
+ result.setAcceptsOutgoingConnectionStrategy(acceptsOutgoingConnectionStrategy);
+ }
+ ((Node)element).setName(configurationElement.getAttribute("name"));
+ return result;
+ }
+
+ private static Wrapper createContainer(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object element = configurationElement.createExecutableExtension("class");
+ if (!(element instanceof Container)) {
+ String message = "Expecting to instantiate a org.jboss.tools.flow.common.model.Container instance.";
+ Logger.logError(message, new RuntimeException(message));
+ return null;
+ }
+ DefaultContainerWrapper result = new DefaultContainerWrapper();
+ result.setElement(element);
+ AcceptsElementStrategy acceptsElementStrategy = createAcceptsElementStrategy(configurationElement);
+ if (acceptsElementStrategy != null) {
+ acceptsElementStrategy.setContainer((Container)element);
+ result.setAcceptsElementStrategy(acceptsElementStrategy);
+ }
+ AcceptsIncomingConnectionStrategy acceptsIncomingConnectionStrategy = createAcceptsIncomingConnectionStrategy(configurationElement);
+ if (acceptsIncomingConnectionStrategy != null) {
+ acceptsIncomingConnectionStrategy.setNode((Node)element);
+ result.setAcceptsIncomingConnectionStrategy(acceptsIncomingConnectionStrategy);
+ }
+ AcceptsOutgoingConnectionStrategy acceptsOutgoingConnectionStrategy = createAcceptsOutgoingConnectionStrategy(configurationElement);
+ if (acceptsOutgoingConnectionStrategy != null) {
+ acceptsOutgoingConnectionStrategy.setNode((Node)element);
+ result.setAcceptsOutgoingConnectionStrategy(acceptsOutgoingConnectionStrategy);
+ }
+ if (element instanceof Node) {
+ ((Node)element).setName(configurationElement.getAttribute("name"));
+ }
+ return result;
+ }
+
+ private static AcceptsIncomingConnectionStrategy createAcceptsIncomingConnectionStrategy(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object result = null;
+ IConfigurationElement[] children = configurationElement.getChildren();
+ if (children[0].getAttribute("acceptsIncomingConnectionStrategy") != null) {
+ result = children[0].createExecutableExtension("acceptsIncomingConnectionStrategy");
+ }
+ return (AcceptsIncomingConnectionStrategy)result;
+ }
+
+ private static AcceptsOutgoingConnectionStrategy createAcceptsOutgoingConnectionStrategy(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object result = null;
+ IConfigurationElement[] children = configurationElement.getChildren();
+ if (children[0].getAttribute("acceptsOutgoingConnectionStrategy") != null) {
+ result = children[0].createExecutableExtension("acceptsOutgoingConnectionStrategy");
+ }
+ return (AcceptsOutgoingConnectionStrategy)result;
+ }
+
+ private static AcceptsElementStrategy createAcceptsElementStrategy(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object result = null;
+ IConfigurationElement[] children = configurationElement.getChildren();
+ if (children[0].getAttribute("acceptsElementStrategy") != null) {
+ result = children[0].createExecutableExtension("acceptsElementStrategy");
+ }
+ return (AcceptsElementStrategy)result;
+ }
+
+ private static Wrapper createFlow(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object element = configurationElement.createExecutableExtension("class");
+ if (!(element instanceof Container)) {
+ String message = "Expecting to instantiate a org.jboss.tools.flow.common.model.Container instance.";
+ Logger.logError(message, new RuntimeException(message));
+ return null;
+ }
+ DefaultFlowWrapper result = new DefaultFlowWrapper();
+ result.setElement(element);
+ AcceptsElementStrategy acceptsElementStrategy = createAcceptsElementStrategy(configurationElement);
+ if (acceptsElementStrategy != null) {
+ acceptsElementStrategy.setContainer((Container)result.getElement());
+ result.setAcceptsElementStrategy(acceptsElementStrategy);
+ }
+ if (element instanceof Flow) {
+ ((Flow)element).setName(configurationElement.getAttribute("name"));
+ }
+ return result;
+ }
+
+ public static Wrapper createWrapper(String elementId) {
+ if (elementMap == null) {
+ initializeRegistry();
+ }
+ IConfigurationElement configurationElement = elementMap.get(elementId);
+ if (configurationElement != null) {
+ try {
+ return createWrapper(configurationElement);
+ } catch (CoreException e) {
+ Logger.logError("Creating a wrapper for " + elementId + " failed.", e);
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ public static CreationFactory getCreationFactory(final String elementId) {
+ return new CreationFactory() {
+ public Object getNewObject() {
+ return createWrapper(elementId);
+ }
+ public Object getObjectType() {
+ return elementId;
+ }
+ };
+ }
+
+}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java 2008-08-08 11:57:37 UTC (rev 9622)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java 2008-08-08 11:58:05 UTC (rev 9623)
@@ -7,11 +7,13 @@
import org.jboss.tools.flow.common.model.Container;
import org.jboss.tools.flow.common.model.Flow;
import org.jboss.tools.flow.common.model.Node;
+import org.jboss.tools.flow.common.strategy.AcceptsElementStrategy;
import org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy;
import org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy;
public class DefaultContainerWrapper extends AbstractContainerWrapper {
+ private AcceptsElementStrategy acceptsElementStrategy;
private AcceptsIncomingConnectionStrategy incomingConnectionStrategy;
private AcceptsOutgoingConnectionStrategy outgoingConnectionStrategy;
@@ -67,10 +69,20 @@
return (Node)getElement();
}
- public boolean acceptsElement(NodeWrapper element) {
- return getParent().acceptsElement(element);
- }
-
+ public boolean acceptsElement(NodeWrapper wrapper) {
+ if (wrapper == null) {
+ return false;
+ } else if (acceptsElementStrategy != null) {
+ return acceptsElementStrategy.acceptsElement(wrapper.getElement());
+ } else {
+ return getParent().acceptsElement(wrapper);
+ }
+ }
+
+ public void setAcceptsElementStrategy(AcceptsElementStrategy strategy) {
+ this.acceptsElementStrategy = strategy;
+ }
+
public void setAcceptsIncomingConnectionStrategy(AcceptsIncomingConnectionStrategy strategy) {
this.incomingConnectionStrategy = strategy;
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java 2008-08-08 11:57:37 UTC (rev 9622)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java 2008-08-08 11:58:05 UTC (rev 9623)
@@ -6,7 +6,7 @@
import org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy;
import org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy;
-public abstract class DefaultNodeWrapper extends AbstractNodeWrapper {
+public class DefaultNodeWrapper extends AbstractNodeWrapper {
private AcceptsIncomingConnectionStrategy incomingConnectionStrategy;
private AcceptsOutgoingConnectionStrategy outgoingConnectionStrategy;
17 years, 4 months
JBoss Tools SVN: r9622 - trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-08-08 07:57:37 -0400 (Fri, 08 Aug 2008)
New Revision: 9622
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/JSFProjectAdoptOperation.java
Log:
JBIDE-2579
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/JSFProjectAdoptOperation.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/JSFProjectAdoptOperation.java 2008-08-08 11:51:05 UTC (rev 9621)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/JSFProjectAdoptOperation.java 2008-08-08 11:57:37 UTC (rev 9622)
@@ -12,11 +12,15 @@
import java.io.File;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.jboss.tools.common.model.XModelConstants;
import org.jboss.tools.common.model.XModelException;
-import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.project.IModelNature;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.JSFPreference;
import org.jboss.tools.jsf.project.JSFAutoLoad;
import org.jboss.tools.jsf.project.JSFNature;
@@ -55,9 +59,21 @@
}
protected void postCreateWebNature() {
- File f = getEclipseFile();
- if(f != null) {
- f.delete();
+ File projectFile = getEclipseFile();
+ if(projectFile != null) {
+ if(projectFile.isFile()) {
+ IFile f = EclipseResourceUtil.getFile(projectFile.getAbsolutePath());
+ if(f != null && f.exists()) {
+ try {
+ f.delete(true, new NullProgressMonitor());
+ } catch (CoreException e) {
+ JSFModelPlugin.getPluginLog().logError(e);
+ projectFile.delete();
+ }
+ } else {
+ projectFile.delete();
+ }
+ }
}
model.getProperties().put(XModelConstants.AUTOLOAD, new JSFAutoLoad());
}
17 years, 4 months
JBoss Tools SVN: r9621 - trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-08-08 07:51:05 -0400 (Fri, 08 Aug 2008)
New Revision: 9621
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/JSFEditor.java
Log:
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/JSFEditor.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/JSFEditor.java 2008-08-08 10:34:35 UTC (rev 9620)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/JSFEditor.java 2008-08-08 11:51:05 UTC (rev 9621)
@@ -608,7 +608,9 @@
"org.jboss.tools.jsf.ui", 0, WizardKeys
.getString("PRN_ERROR"), ee);
ProblemReportingHelper.reportProblem(status);
-
+ }
+ //if ex is not null then d is set to null and we cannot access it.
+ if(ex == null) {
d.setPages(new Pages(viewer, new PageFormat(printer,
this.getWorkbenchPart().getSite().getShell()
.getDisplay())));
17 years, 4 months