JBoss Tools SVN: r15619 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb: internal/scanner and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-31 05:54:14 -0400 (Sun, 31 May 2009)
New Revision: 15619
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbObject.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ELFunction.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletTag.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletTagLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigAttribute.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigComponent.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigTagLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDAttribute.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDTag.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/Facet.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbObject.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbObject.java 2009-05-30 21:59:40 UTC (rev 15618)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbObject.java 2009-05-31 09:54:14 UTC (rev 15619)
@@ -176,7 +176,7 @@
XModelObject o = (XModelObject)id;
XMLStoreHelper.saveModelObject(element, o, XMLStoreConstants.TAG_ID, context);
} else {
- //TODO consider other kinds of id
+ //consider other kinds of id
}
}
XModelObject old = pushModelObject(context);
@@ -204,7 +204,7 @@
} else if(XMLStoreConstants.CLS_MODEL_OBJECT.equals(cls)) {
id = XMLStoreHelper.loadModelObject(e_id, context);
} else {
- //TODO consider other kinds of id
+ //consider other kinds of id
}
}
XModelObject old = pushModelObject(context);
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2009-05-30 21:59:40 UTC (rev 15618)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2009-05-31 09:54:14 UTC (rev 15619)
@@ -43,6 +43,7 @@
import org.jboss.tools.jst.web.kb.internal.taglib.AbstractTagLib;
import org.jboss.tools.jst.web.kb.internal.taglib.FaceletTagLibrary;
import org.jboss.tools.jst.web.kb.internal.taglib.TLDLibrary;
+import org.jboss.tools.jst.web.kb.taglib.ICustomTagLibrary;
import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
import org.w3c.dom.Element;
@@ -438,6 +439,7 @@
if(fs != null && !fs.isEmpty()) {
Element cse = XMLUtilities.createElement(pathElement, "libraries"); //$NON-NLS-1$
for (ITagLibrary d: fs) {
+ if(d instanceof ICustomTagLibrary) continue;
AbstractTagLib t = (AbstractTagLib)d;
t.toXML(cse, context);
}
@@ -577,7 +579,7 @@
fireChanges(addedLibraries);
libraryDeclarationsRemoved(currentLibraries);
- //TODO
+
try {
registerComponentsInDependentProjects(ds, source);
} catch (CloneNotSupportedException e) {
@@ -695,7 +697,7 @@
postponedChanges.addAll(changes);
return;
}
- //TODO
+ //TODO Implement if it will be needed events and listeners. and fire events to them.
}
class LibraryStorage {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java 2009-05-30 21:59:40 UTC (rev 15618)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java 2009-05-31 09:54:14 UTC (rev 15619)
@@ -10,9 +10,6 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.internal.scanner;
-import java.util.HashSet;
-import java.util.Set;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
@@ -44,7 +41,9 @@
* @author Viacheslav Kabanovich
*/
public class XMLScanner implements IFileScanner {
- public static final String ATTR_TAGCLASS ="tagclass"; //$NON-NLS-1$
+ public static final String ATTR_SHORTNAME = "shortname"; //$NON-NLS-1$
+ public static final String ATTR_TAGCLASS = "tagclass"; //$NON-NLS-1$
+ public static final String ATTR_TAG_NAME = "tag-name"; //$NON-NLS-1$
public static final String ATTR_BODY_CONTENT = "bodycontent"; //$NON-NLS-1$
public static final String ATTR_FACET_NAME = "facet-name"; //$NON-NLS-1$
public static final String ATTR_ATTRIBUTE_NAME = "attribute-name"; //$NON-NLS-1$
@@ -76,7 +75,9 @@
if(model == null) return false;
XModelObject o = EclipseResourceUtil.getObjectByResource(model, f);
if(o == null) return false;
- if(LibraryScanner.isTLDFile(o) || LibraryScanner.isFaceletTaglibFile(o)) return true;
+ if(LibraryScanner.isTLDFile(o)
+ || LibraryScanner.isFaceletTaglibFile(o)
+ || LibraryScanner.isFacesConfigFile(o)) return true;
return false;
}
@@ -93,14 +94,6 @@
return parse(o, f.getFullPath(), sp);
}
- static Set<String> INTERNAL_ATTRIBUTES = new HashSet<String>();
-
- static {
- INTERNAL_ATTRIBUTES.add("NAME"); //$NON-NLS-1$
- INTERNAL_ATTRIBUTES.add("EXTENSION"); //$NON-NLS-1$
- INTERNAL_ATTRIBUTES.add("#comment"); //$NON-NLS-1$
- }
-
public LoadedDeclarations parse(XModelObject o, IPath source, IKbProject sp) {
if(o == null) return null;
@@ -137,7 +130,7 @@
library.setId(o);
library.setURI(new XMLValueInfo(o, AbstractTagLib.URI));
library.setDisplayName(new XMLValueInfo(o, TLDLibrary.DISPLAY_NAME));
- library.setShortName(new XMLValueInfo(o, "shortname"));
+ library.setShortName(new XMLValueInfo(o, ATTR_SHORTNAME));
String version = o.getAttributeValue(TLDLibrary.VERSION);
if(version == null) {
if("FileTLD_1_2".equals(o.getModelEntity().getName())) {
@@ -162,8 +155,6 @@
tag.setDescription(new XMLValueInfo(t, AbstractComponent.DESCRIPTION));
tag.setComponentClass(new XMLValueInfo(t, ATTR_TAGCLASS));
tag.setCanHaveBody(new XMLValueInfo(t, ATTR_BODY_CONTENT));
- //TODO
-// tag.setComponentType(componentType);
XModelObject[] as = t.getChildren();
for(XModelObject a: as) {
@@ -197,7 +188,7 @@
if(entity.startsWith("FaceletTaglibTag")) {
FaceletTag tag = new FaceletTag();
tag.setId(t);
- tag.setName(new XMLValueInfo(t, "tag-name"));
+ tag.setName(new XMLValueInfo(t, ATTR_TAG_NAME));
library.addComponent(tag);
} else if(entity.startsWith("FaceletTaglibFunction")) {
ELFunction f = new ELFunction();
@@ -223,11 +214,11 @@
FacesConfigComponent component = new FacesConfigComponent();
component.setId(c);
//what else can we take for the name? only attribute 'component-type' is available
- component.setName(new XMLValueInfo(c, "component-type"));
+ component.setName(new XMLValueInfo(c, AbstractComponent.COMPONENT_TYPE));
- component.setComponentClass(new XMLValueInfo(c, "component-class"));
- component.setComponentType(c.getAttributeValue("component-type"));
- component.setDescription(new XMLValueInfo(c, "description"));
+ component.setComponentClass(new XMLValueInfo(c, AbstractComponent.COMPONENT_CLASS));
+ component.setComponentType(new XMLValueInfo(c, AbstractComponent.COMPONENT_TYPE));
+ component.setDescription(new XMLValueInfo(c, AbstractComponent.DESCRIPTION));
XModelObject[] as = c.getChildren();
for (XModelObject child: as) {
@@ -235,8 +226,7 @@
if(entity.startsWith("JSFAttribute")) {
FacesConfigAttribute attr = new FacesConfigAttribute();
attr.setId(child);
- attr.setName(new XMLValueInfo(child, ATTR_ATTRIBUTE_NAME));
-
+ attr.setName(new XMLValueInfo(child, ATTR_ATTRIBUTE_NAME));
component.addAttribute(attr);
} else if(entity.startsWith("JSFFacet")) {
Facet f = new Facet();
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java 2009-05-30 21:59:40 UTC (rev 15618)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java 2009-05-31 09:54:14 UTC (rev 15619)
@@ -123,6 +123,10 @@
return proposals.toArray(new TextProposal[proposals.size()]);
}
+ public AbstractAttribute clone() throws CloneNotSupportedException {
+ return (AbstractAttribute)super.clone();
+ }
+
public List<Change> merge(KbObject s) {
List<Change> changes = super.merge(s);
@@ -160,14 +164,14 @@
public void loadXML(Element element, Properties context) {
super.loadXML(element, context);
+ setName(attributesInfo.get(XMLStoreConstants.ATTR_NAME));
+ setDescription(attributesInfo.get(AbstractComponent.DESCRIPTION));
+ setRequired(attributesInfo.get(REQUIRED));
+
if(name == null && element.hasAttribute(XMLStoreConstants.ATTR_NAME)) {
name = element.getAttribute(XMLStoreConstants.ATTR_NAME);
}
- setName(attributesInfo.get(XMLStoreConstants.ATTR_NAME));
- setDescription(attributesInfo.get(AbstractComponent.DESCRIPTION));
- setRequired(attributesInfo.get(REQUIRED));
- //TODO
}
@Override
@@ -181,7 +185,7 @@
@Override
protected void loadAttributesInfo(Element element, Properties context) {
- if(context.get(XMLStoreConstants.KEY_MODEL_OBJECT) == getId()) {
+ if(context.get(XMLStoreConstants.KEY_MODEL_OBJECT) == getId() && getId() != null) {
XModelObject a = (XModelObject)getId();
attributesInfo.put(XMLStoreConstants.ATTR_NAME, new XMLValueInfo(a, XMLStoreConstants.ATTR_NAME));
attributesInfo.put(AbstractComponent.DESCRIPTION, new XMLValueInfo(a, AbstractComponent.DESCRIPTION));
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java 2009-05-30 21:59:40 UTC (rev 15618)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java 2009-05-31 09:54:14 UTC (rev 15619)
@@ -152,6 +152,11 @@
this.componentType = componentType;
}
+ public void setComponentType(IValueInfo s) {
+ componentType = s == null ? null : s.getValue();
+ attributesInfo.put(COMPONENT_TYPE, s);
+ }
+
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.taglib.IComponent#getDescription()
*/
@@ -287,6 +292,18 @@
requiredAttributes.remove(attribute.getName());
}
+ public AbstractComponent clone() throws CloneNotSupportedException {
+ AbstractComponent copy = (AbstractComponent)super.clone();
+ copy.attributes = new HashMap<String, IAttribute>();
+ copy.preferableAttributes = new HashMap<String, IAttribute>();
+ copy.requiredAttributes = new HashMap<String, IAttribute>();
+ IAttribute[] as = getAttributes();
+ for (IAttribute a: as) {
+ copy.addAttribute(((AbstractAttribute)a).clone());
+ }
+ return copy;
+ }
+
public List<Change> merge(KbObject s) {
List<Change> changes = super.merge(s);
@@ -321,8 +338,8 @@
public void mergeAttributes(AbstractComponent c, Change children) {
Map<Object,AbstractAttribute> attributeMap = new HashMap<Object, AbstractAttribute>();
- for (IAttribute a: attributes.values()) attributeMap.put(((KbObject)a).getId(), (AbstractAttribute)a);
- for (IAttribute a: c.attributes.values()) {
+ for (IAttribute a: getAttributes()) attributeMap.put(((KbObject)a).getId(), (AbstractAttribute)a);
+ for (IAttribute a: c.getAttributes()) {
AbstractAttribute loaded = (AbstractAttribute)a;
AbstractAttribute current = attributeMap.get(loaded.getId());
if(current == null) {
@@ -344,9 +361,6 @@
}
}
- public AbstractComponent clone() throws CloneNotSupportedException {
- return (AbstractComponent)super.clone();
- }
public String getXMLName() {
return KbXMLStoreConstants.TAG_COMPONENT;
}
@@ -358,7 +372,7 @@
element.setAttribute(XMLStoreConstants.ATTR_NAME, name);
}
- for (IAttribute c: attributes.values()) {
+ for (IAttribute c: getAttributes()) {
((KbObject)c).toXML(element, context);
}
@@ -375,9 +389,8 @@
setDescription(attributesInfo.get(DESCRIPTION));
setComponentClass(attributesInfo.get(COMPONENT_CLASS));
setCanHaveBody(attributesInfo.get(BODY_CONTENT));
+ setComponentType(attributesInfo.get(COMPONENT_TYPE));
- //TODO
- //componentType?
Element[] cs = XMLUtilities.getChildren(element, KbXMLStoreConstants.TAG_ATTRIBUTE);
for (Element e: cs) {
String cls = e.getAttribute(XMLStoreConstants.ATTR_CLASS);
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-05-30 21:59:40 UTC (rev 15618)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-05-31 09:54:14 UTC (rev 15619)
@@ -326,6 +326,8 @@
c = new TLDTag();
} else if(KbXMLStoreConstants.CLS_FACELET_LIBRARY.equals(cls)) {
c = new FaceletTag();
+ } else if(KbXMLStoreConstants.CLS_FACESCONFIG_LIBRARY.equals(cls)) {
+ c = new FacesConfigComponent();
} else {
//consider other cases;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ELFunction.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ELFunction.java 2009-05-30 21:59:40 UTC (rev 15618)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ELFunction.java 2009-05-31 09:54:14 UTC (rev 15619)
@@ -77,7 +77,7 @@
@Override
protected void loadAttributesInfo(Element element, Properties context) {
- if(context.get(XMLStoreConstants.KEY_MODEL_OBJECT) == getId()) {
+ if(context.get(XMLStoreConstants.KEY_MODEL_OBJECT) == getId() && getId() != null) {
XModelObject a = (XModelObject)getId();
attributesInfo.put(XMLStoreConstants.ATTR_NAME, new XMLValueInfo(a, XMLScanner.ATTR_FUNC_NAME));
attributesInfo.put(SIGNATURE, new XMLValueInfo(a, XMLScanner.ATTR_FUNC_SIGN));
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletTag.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletTag.java 2009-05-30 21:59:40 UTC (rev 15618)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletTag.java 2009-05-31 09:54:14 UTC (rev 15619)
@@ -21,4 +21,8 @@
return KbXMLStoreConstants.CLS_FACELET_LIBRARY;
}
+ public FaceletTag clone() throws CloneNotSupportedException {
+ return (FaceletTag)super.clone();
+ }
+
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletTagLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletTagLibrary.java 2009-05-30 21:59:40 UTC (rev 15618)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletTagLibrary.java 2009-05-31 09:54:14 UTC (rev 15619)
@@ -11,14 +11,15 @@
package org.jboss.tools.jst.web.kb.internal.taglib;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.jst.web.kb.internal.KbObject;
import org.jboss.tools.jst.web.kb.internal.KbXMLStoreConstants;
-import org.jboss.tools.jst.web.kb.taglib.Facet;
import org.jboss.tools.jst.web.kb.taglib.IELFunction;
import org.jboss.tools.jst.web.kb.taglib.IFaceletTagLibrary;
import org.w3c.dom.Element;
@@ -50,6 +51,7 @@
public FaceletTagLibrary clone() throws CloneNotSupportedException {
FaceletTagLibrary copy = (FaceletTagLibrary)super.clone();
copy.functions = new ArrayList<ELFunction>();
+ copy.functionArray = null;
for (IELFunction f: getFunctions()) {
copy.addFunction(((ELFunction)f).clone());
}
@@ -62,11 +64,42 @@
public List<Change> merge(KbObject s) {
List<Change> changes = super.merge(s);
- FacesConfigTagLibrary t = (FacesConfigTagLibrary)s;
- //TODO
+ FaceletTagLibrary t = (FaceletTagLibrary)s;
+ Change children = new Change(this, null, null, null);
+ mergeFunctions(t, children);
+ changes = Change.addChange(changes, children);
return changes;
}
+ public void mergeFunctions(FaceletTagLibrary c, Change children) {
+ Map<Object,ELFunction> functionMap = new HashMap<Object, ELFunction>();
+ for (IELFunction f: getFunctions()) functionMap.put(((KbObject)f).getId(), (ELFunction)f);
+ for (IELFunction f: c.getFunctions()) {
+ ELFunction loaded = (ELFunction)f;
+ ELFunction current = functionMap.get(loaded.getId());
+ if(current == null) {
+ addFunction(loaded);
+ Change change = new Change(this, null, null, loaded);
+ children.addChildren(Change.addChange(null, change));
+ } else {
+ List<Change> rc = current.merge(loaded);
+ if(rc != null) children.addChildren(rc);
+ }
+ }
+ for (ELFunction f: functionMap.values()) {
+ ELFunction removed = f;
+ synchronized (functions) {
+ if(functions.contains(removed)) {
+ continue;
+ }
+ functions.remove(removed.getName());
+ functionArray = null;
+ }
+ Change change = new Change(this, null, removed, null);
+ children.addChildren(Change.addChange(null, change));
+ }
+ }
+
public Element toXML(Element parent, Properties context) {
Element element = super.toXML(parent, context);
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigAttribute.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigAttribute.java 2009-05-30 21:59:40 UTC (rev 15618)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigAttribute.java 2009-05-31 09:54:14 UTC (rev 15619)
@@ -30,7 +30,7 @@
@Override
protected void loadAttributesInfo(Element element, Properties context) {
- if(context.get(XMLStoreConstants.KEY_MODEL_OBJECT) == getId()) {
+ if(context.get(XMLStoreConstants.KEY_MODEL_OBJECT) == getId() && getId() != null) {
XModelObject a = (XModelObject)getId();
attributesInfo.put(XMLStoreConstants.ATTR_NAME, new XMLValueInfo(a, XMLScanner.ATTR_ATTRIBUTE_NAME));
attributesInfo.put(AbstractComponent.DESCRIPTION, new XMLValueInfo(a, AbstractComponent.DESCRIPTION));
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigComponent.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigComponent.java 2009-05-30 21:59:40 UTC (rev 15618)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigComponent.java 2009-05-31 09:54:14 UTC (rev 15619)
@@ -38,10 +38,12 @@
public Facet[] getFacets() {
if(facetArray == null) {
- if(facets.isEmpty()) {
- facetArray = EMPTY_FACET_SET;
- } else {
- facetArray = facets.values().toArray(new Facet[0]);
+ synchronized (facets) {
+ if (facets.isEmpty()) {
+ facetArray = EMPTY_FACET_SET;
+ } else {
+ facetArray = facets.values().toArray(new Facet[0]);
+ }
}
}
return facetArray;
@@ -49,11 +51,12 @@
public Facet[] getFacets(String nameTemplate) {
Facet[] fs = getFacets();
- if(fs == null || fs.length == 0) return EMPTY_FACET_SET;
+ if(fs.length == 0) return EMPTY_FACET_SET;
List<Facet> result = new ArrayList<Facet>();
for (Facet f: fs) {
String name = f.getName();
- boolean match = false; //TODO implement
+ //TODO implement better matching name and nameTemplate
+ boolean match = name.startsWith(nameTemplate);
if(match) result.add(f);
}
return result.isEmpty() ? EMPTY_FACET_SET : result.toArray(new Facet[0]);
@@ -61,10 +64,21 @@
public void addFacet(Facet f) {
adopt((KbObject)f);
- facets.put(f.getName(), f);
- facetArray = null;
+ synchronized(facets) {
+ facets.put(f.getName(), f);
+ facetArray = null;
+ }
}
+ public FacesConfigComponent clone() throws CloneNotSupportedException {
+ FacesConfigComponent copy = new FacesConfigComponent();
+ copy.facets = new HashMap<String, Facet>();
+ for (Facet f: getFacets()) {
+ copy.addFacet(f.clone());
+ }
+ return copy;
+ }
+
public String getXMLClass() {
return KbXMLStoreConstants.CLS_FACESCONFIG_LIBRARY;
}
@@ -82,9 +96,9 @@
public void mergeFacets(FacesConfigComponent c, Change children) {
Map<Object,Facet> facetMap = new HashMap<Object, Facet>();
- for (Facet a: facets.values()) facetMap.put(((KbObject)a).getId(), a);
- for (Facet a: c.facets.values()) {
- Facet loaded = (Facet)a;
+ for (Facet f: getFacets()) facetMap.put(f.getId(), f);
+ for (Facet f: c.getFacets()) {
+ Facet loaded = f;
Facet current = facetMap.get(loaded.getId());
if(current == null) {
addFacet(loaded);
@@ -95,14 +109,17 @@
if(rc != null) children.addChildren(rc);
}
}
- for (Facet a: facetMap.values()) {
- Facet removed = a;
- if(facets.get(removed.getName()) == removed) {
+ for (Facet f: facetMap.values()) {
+ Facet removed = f;
+ synchronized (facets) {
+ if(facets.get(removed.getName()) != removed) {
+ continue;
+ }
facets.remove(removed.getName());
facetArray = null;
- Change change = new Change(this, null, removed, null);
- children.addChildren(Change.addChange(null, change));
}
+ Change change = new Change(this, null, removed, null);
+ children.addChildren(Change.addChange(null, change));
}
}
@@ -110,7 +127,7 @@
Element element = super.toXML(parent, context);
for (Facet f: getFacets()) {
- ((KbObject)f).toXML(element, context);
+ f.toXML(element, context);
}
return element;
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigTagLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigTagLibrary.java 2009-05-30 21:59:40 UTC (rev 15618)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigTagLibrary.java 2009-05-31 09:54:14 UTC (rev 15619)
@@ -17,7 +17,6 @@
import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.jst.web.kb.internal.KbObject;
import org.jboss.tools.jst.web.kb.internal.KbXMLStoreConstants;
-import org.jboss.tools.jst.web.kb.taglib.Facet;
import org.jboss.tools.jst.web.kb.taglib.IComponent;
import org.jboss.tools.jst.web.kb.taglib.IFacesConfigTagLibrary;
@@ -46,19 +45,11 @@
public List<Change> merge(KbObject s) {
List<Change> changes = super.merge(s);
- FacesConfigTagLibrary t = (FacesConfigTagLibrary)s;
+// FacesConfigTagLibrary t = (FacesConfigTagLibrary)s;
- Change children = new Change(this, null, null, null);
- mergeFunctions(t, children);
- changes = Change.addChange(changes, children);
-
return changes;
}
- public void mergeFunctions(FacesConfigTagLibrary c, Change children) {
- //TODO
- }
-
public String getXMLClass() {
return KbXMLStoreConstants.CLS_FACESCONFIG_LIBRARY;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDAttribute.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDAttribute.java 2009-05-30 21:59:40 UTC (rev 15618)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDAttribute.java 2009-05-31 09:54:14 UTC (rev 15619)
@@ -14,6 +14,10 @@
public class TLDAttribute extends AbstractAttribute {
+ public TLDAttribute clone() throws CloneNotSupportedException {
+ return (TLDAttribute)super.clone();
+ }
+
public String getXMLClass() {
return KbXMLStoreConstants.CLS_TLD_LIBRARY;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDLibrary.java 2009-05-30 21:59:40 UTC (rev 15618)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDLibrary.java 2009-05-31 09:54:14 UTC (rev 15619)
@@ -11,11 +11,11 @@
package org.jboss.tools.jst.web.kb.internal.taglib;
import java.util.List;
-
import org.jboss.tools.common.model.project.ext.IValueInfo;
import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.jst.web.kb.internal.KbObject;
import org.jboss.tools.jst.web.kb.internal.KbXMLStoreConstants;
+import org.jboss.tools.jst.web.kb.taglib.INameSpace;
import org.jboss.tools.jst.web.kb.taglib.ITLDLibrary;
import org.w3c.dom.Element;
@@ -63,7 +63,16 @@
}
public void createDefaultNameSpace() {
+ setDefaultNameSpace(new INameSpace() {
+ public String getURI() {
+ return uri;
+ }
+
+ public String getPrefix() {
+ return shortName;
+ }
+ });
}
public TLDLibrary clone() throws CloneNotSupportedException {
@@ -72,7 +81,19 @@
public List<Change> merge(KbObject s) {
List<Change> changes = super.merge(s);
- //TODO
+ TLDLibrary l = (TLDLibrary)s;
+ if(!stringsEqual(displayName, l.displayName)) {
+ changes = Change.addChange(changes, new Change(this, DISPLAY_NAME, displayName, l.displayName));
+ displayName = l.displayName;
+ }
+ if(!stringsEqual(shortName, l.shortName)) {
+ changes = Change.addChange(changes, new Change(this, SHORT_NAME, shortName, l.shortName));
+ shortName = l.shortName;
+ }
+ if(!stringsEqual(version, l.version)) {
+ changes = Change.addChange(changes, new Change(this, VERSION, version, l.version));
+ version = l.version;
+ }
return changes;
}
@@ -95,7 +116,6 @@
if(version == null && element.hasAttribute(VERSION)) {
version = element.getAttribute(VERSION);
}
- //TODO
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDTag.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDTag.java 2009-05-30 21:59:40 UTC (rev 15618)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDTag.java 2009-05-31 09:54:14 UTC (rev 15619)
@@ -36,13 +36,12 @@
@Override
protected void loadAttributesInfo(Element element, Properties context) {
- if(context.get(XMLStoreConstants.KEY_MODEL_OBJECT) == getId()) {
+ if(context.get(XMLStoreConstants.KEY_MODEL_OBJECT) == getId() && getId() != null) {
XModelObject a = (XModelObject)getId();
attributesInfo.put(XMLStoreConstants.ATTR_NAME, new XMLValueInfo(a, XMLStoreConstants.ATTR_NAME));
attributesInfo.put(AbstractComponent.DESCRIPTION, new XMLValueInfo(a, AbstractComponent.DESCRIPTION));
attributesInfo.put(COMPONENT_CLASS, new XMLValueInfo(a, XMLScanner.ATTR_TAGCLASS));
attributesInfo.put(BODY_CONTENT, new XMLValueInfo(a, XMLScanner.ATTR_BODY_CONTENT));
- //TODO other attributes as in XMLScanner
} else {
super.loadAttributesInfo(element, context);
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/Facet.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/Facet.java 2009-05-30 21:59:40 UTC (rev 15618)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/Facet.java 2009-05-31 09:54:14 UTC (rev 15619)
@@ -10,10 +10,12 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.taglib;
+import java.util.List;
import java.util.Properties;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.project.ext.store.XMLStoreConstants;
import org.jboss.tools.jst.web.kb.internal.KbObject;
import org.jboss.tools.jst.web.kb.internal.KbXMLStoreConstants;
@@ -63,6 +65,24 @@
attributesInfo.put(AbstractComponent.DESCRIPTION, s);
}
+ public Facet clone() throws CloneNotSupportedException {
+ return (Facet)super.clone();
+ }
+
+ public List<Change> merge(KbObject s) {
+ List<Change> changes = super.merge(s);
+ Facet f = (Facet)s;
+ if(!stringsEqual(name, f.name)) {
+ changes = Change.addChange(changes, new Change(this, XMLStoreConstants.ATTR_NAME, name, f.name));
+ name = f.name;
+ }
+ if(!stringsEqual(description, f.description)) {
+ changes = Change.addChange(changes, new Change(this, AbstractComponent.DESCRIPTION, description, f.description));
+ description = f.description;
+ }
+ return changes;
+ }
+
public String getXMLName() {
return KbXMLStoreConstants.TAG_FACET;
}
@@ -99,7 +119,7 @@
@Override
protected void loadAttributesInfo(Element element, Properties context) {
- if(context.get(XMLStoreConstants.KEY_MODEL_OBJECT) == getId()) {
+ if(context.get(XMLStoreConstants.KEY_MODEL_OBJECT) == getId() && getId() != null) {
XModelObject a = (XModelObject)getId();
attributesInfo.put(XMLStoreConstants.ATTR_NAME, new XMLValueInfo(a, XMLScanner.ATTR_FACET_NAME));
attributesInfo.put(AbstractComponent.DESCRIPTION, new XMLValueInfo(a, AbstractComponent.DESCRIPTION));
15 years, 6 months
JBoss Tools SVN: r15618 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4: src/org/jboss/tools/flow/jpdl4/editor and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-05-30 17:59:40 -0400 (Sat, 30 May 2009)
New Revision: 15618
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/CustomTask.java
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/JpdlPaletteFactory.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskArgumentsSection.java
Log:
- allow config of jbpm 4 runtimes (GPD-346)
- support custom node (GPD-349)
- remove esb node temporarily (GPD-350)
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-05-30 21:57:32 UTC (rev 15617)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-05-30 21:59:40 UTC (rev 15618)
@@ -162,7 +162,7 @@
<figure class="org.jboss.tools.flow.jpdl4.figure.TaskFigure"></figure>
</node>
</element>
- <element
+<!-- <element
class="org.jboss.tools.flow.jpdl4.model.ServiceTask"
figure="icons/16/task_empty.png"
id="org.jboss.tools.flow.jpdl4.serviceTask"
@@ -171,7 +171,7 @@
<node>
<figure class="org.jboss.tools.flow.jpdl4.figure.TaskFigure"></figure>
</node>
- </element>
+ </element> -->
<element
class="org.jboss.tools.flow.jpdl4.model.HumanTask"
figure="icons/16/task_empty.png"
@@ -191,7 +191,17 @@
<node>
<figure class="org.jboss.tools.flow.jpdl4.figure.TaskFigure"></figure>
</node>
+ <element
+ class="org.jboss.tools.flow.jpdl4.model.CustomTask"
+ figure="icons/16/task_empty.png"
+ id="org.jboss.tools.flow.jpdl4.customTask"
+ label="custom"
+ language="org.jboss.tools.flow.jpdl4">
+ <node>
+ <figure class="org.jboss.tools.flow.jpdl4.figure.TaskFigure"></figure>
+ </node>
</element>
+ </element>
<element
class="org.jboss.tools.flow.jpdl4.model.ExclusiveGateway"
figure="icons/16/gateway_exclusive.png"
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 2009-05-30 21:57:32 UTC (rev 15617)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlPaletteFactory.java 2009-05-30 21:59:40 UTC (rev 15618)
@@ -151,16 +151,16 @@
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/32/task_empty.png"))
);
entries.add(combined);
+// combined = new CombinedTemplateCreationEntry(
+// "esb",
+// "Create a new Service Task",
+// "org.jboss.tools.flow.jpdl4.serviceTask",
+// ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.serviceTask"),
+// ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/16/task_empty.png")),
+// ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/32/task_empty.png"))
+// );
+// entries.add(combined);
combined = new CombinedTemplateCreationEntry(
- "esb",
- "Create a new Service Task",
- "org.jboss.tools.flow.jpdl4.serviceTask",
- ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.serviceTask"),
- ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/16/task_empty.png")),
- ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/32/task_empty.png"))
- );
- entries.add(combined);
- combined = new CombinedTemplateCreationEntry(
"task",
"Create a new Human Task",
"org.jboss.tools.flow.jpdl4.humanTask",
@@ -178,6 +178,15 @@
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/32/task_empty.png"))
);
entries.add(combined);
+ combined = new CombinedTemplateCreationEntry(
+ "custom",
+ "Create a new Custom Node",
+ "org.jboss.tools.flow.jpdl4.customTask",
+ ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.customTask"),
+ ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/16/task_empty.png")),
+ ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/32/task_empty.png"))
+ );
+ entries.add(combined);
return entries;
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-05-30 21:57:32 UTC (rev 15617)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-05-30 21:59:40 UTC (rev 15618)
@@ -31,6 +31,7 @@
import org.jboss.tools.flow.jpdl4.Logger;
import org.jboss.tools.flow.jpdl4.model.Assignment;
import org.jboss.tools.flow.jpdl4.model.CancelEndEvent;
+import org.jboss.tools.flow.jpdl4.model.CustomTask;
import org.jboss.tools.flow.jpdl4.model.ErrorEndEvent;
import org.jboss.tools.flow.jpdl4.model.EventListener;
import org.jboss.tools.flow.jpdl4.model.EventListenerContainer;
@@ -197,6 +198,7 @@
else if ("org.jboss.tools.flow.jpdl4.serviceTask".equals(elementId)) return "esb";
else if ("org.jboss.tools.flow.jpdl4.humanTask".equals(elementId)) return "task";
else if ("org.jboss.tools.flow.jpdl4.subprocessTask".equals(elementId)) return "sub-process";
+ else if ("org.jboss.tools.flow.jpdl4.customTask".equals(elementId)) return "node";
else if ("org.jboss.tools.flow.jpdl4.exclusiveGateway".equals(elementId)) return "decision";
else if ("org.jboss.tools.flow.jpdl4.parallelJoinGateway".equals(elementId)) return "join";
else if ("org.jboss.tools.flow.jpdl4.parallelForkGateway".equals(elementId)) return "fork";
@@ -747,6 +749,8 @@
new HumanTaskWrapperSerializer().appendOpening(buffer, wrapper, level);
} else if (element instanceof SubprocessTask) {
new SubprocessTaskWrapperSerializer().appendOpening(buffer, wrapper, level);
+ } else if (element instanceof CustomTask) {
+ new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
} else if (element instanceof ExclusiveGateway) {
new ExclusiveGatewayWrapperSerializer().appendOpening(buffer, wrapper, level);
} else if (element instanceof ForkParallelGateway) {
@@ -802,6 +806,8 @@
new HumanTaskWrapperSerializer().appendBody(buffer, wrapper, level);
} else if (element instanceof SubprocessTask) {
new SubprocessTaskWrapperSerializer().appendBody(buffer, wrapper, level);
+ } else if (element instanceof CustomTask) {
+ new ProcessNodeWrapperSerializer().appendBody(buffer, wrapper, level);
} else if (element instanceof ExclusiveGateway) {
new ExclusiveGatewayWrapperSerializer().appendBody(buffer, wrapper, level);
} else if (element instanceof ForkParallelGateway) {
@@ -867,6 +873,8 @@
buffer.append("</task>");
} else if (element instanceof SubprocessTask) {
buffer.append("</sub-process>");
+ } else if (element instanceof CustomTask) {
+ buffer.append("</node>");
} else if (element instanceof ExclusiveGateway) {
buffer.append("</decision>");
} else if (element instanceof ForkParallelGateway) {
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/CustomTask.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/CustomTask.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/CustomTask.java 2009-05-30 21:59:40 UTC (rev 15618)
@@ -0,0 +1,10 @@
+package org.jboss.tools.flow.jpdl4.model;
+
+
+public class CustomTask extends Task {
+
+ protected boolean isPropagationExclusive() {
+ return true;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/CustomTask.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskArgumentsSection.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskArgumentsSection.java 2009-05-30 21:57:32 UTC (rev 15617)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskArgumentsSection.java 2009-05-30 21:59:40 UTC (rev 15618)
@@ -4,14 +4,13 @@
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.jboss.tools.flow.common.properties.IPropertyId;
public class JavaTaskArgumentsSection extends JpdlPropertySection implements IPropertyId {
- private final static String NO_FIELDS = "The configured class has no fields that can be configured.";
- private final static String CONFIGURE_FIELDS = "Configure the value of the supported fields as needed.";
+ private final static String NO_ARGUMENTS = "The configured method has no arguments that can be configured.";
+ private final static String CONFIGURE_ARGUMENTS = "Configure the value of the supported arguments as needed.";
private CLabel infoLabel;
@@ -51,7 +50,7 @@
private void createInfoLabel(Composite parent) {
- infoLabel = getWidgetFactory().createCLabel(parent, NO_FIELDS);
+ infoLabel = getWidgetFactory().createCLabel(parent, NO_ARGUMENTS);
FormData data = new FormData();
data.left = new FormAttachment(0, 0);
data.top = new FormAttachment(0, 5);
15 years, 6 months
JBoss Tools SVN: r15617 - trunk/jbpm/features/org.jboss.tools.jbpm.common.feature.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-05-30 17:57:32 -0400 (Sat, 30 May 2009)
New Revision: 15617
Modified:
trunk/jbpm/features/org.jboss.tools.jbpm.common.feature/feature.xml
Log:
update licence info
Modified: trunk/jbpm/features/org.jboss.tools.jbpm.common.feature/feature.xml
===================================================================
--- trunk/jbpm/features/org.jboss.tools.jbpm.common.feature/feature.xml 2009-05-30 12:54:25 UTC (rev 15616)
+++ trunk/jbpm/features/org.jboss.tools.jbpm.common.feature/feature.xml 2009-05-30 21:57:32 UTC (rev 15617)
@@ -9,8 +9,201 @@
[Enter Feature Description here.]
</description>
- <copyright url="http://www.example.com/copyright">
- [Enter Copyright Description here.]
+ <copyright>
+ Eclipse Public License - v 1.0
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS
+ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
+DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.
+1. DEFINITIONS
+"Contribution" means:
+a) in the case of the initial Contributor, the initial code and
+documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+i) changes to the Program, and
+ii) additions to the Program;
+where such changes and/or additions to the Program originate
+from and are distributed by that particular Contributor. A Contribution
+'originates' from a Contributor if it was added to the Program
+by such Contributor itself or anyone acting on such Contributor's
+behalf. Contributions do not include additions to the Program
+which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii)
+are not derivative works of the Program.
+"Contributor" means any person or entity that distributes the
+Program.
+"Licensed Patents " mean patent claims licensable by a Contributor
+which are necessarily infringed by the use or sale of its Contribution
+alone or when combined with the Program.
+"Program" means the Contributions distributed in accordance with
+this Agreement.
+"Recipient" means anyone who receives the Program under this
+Agreement, including all Contributors.
+2. GRANT OF RIGHTS
+a) Subject to the terms of this Agreement, each Contributor hereby
+grants Recipient a non-exclusive, worldwide, royalty-free copyright
+license to reproduce, prepare derivative works of, publicly display,
+publicly perform, distribute and sublicense the Contribution
+of such Contributor, if any, and such derivative works, in source
+code and object code form.
+b) Subject to the terms of this Agreement, each Contributor hereby
+grants Recipient a non-exclusive, worldwide, royalty-free patent
+license under Licensed Patents to make, use, sell, offer to sell,
+import and otherwise transfer the Contribution of such Contributor,
+if any, in source code and object code form. This patent license
+shall apply to the combination of the Contribution and the Program
+if, at the time the Contribution is added by the Contributor,
+such addition of the Contribution causes such combination to
+be covered by the Licensed Patents. The patent license shall
+not apply to any other combinations which include the Contribution.
+No hardware per se is licensed hereunder.
+c) Recipient understands that although each Contributor grants
+the licenses to its Contributions set forth herein, no assurances
+are provided by any Contributor that the Program does not infringe
+the patent or other intellectual property rights of any other
+entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement
+of intellectual property rights or otherwise. As a condition
+to exercising the rights and licenses granted hereunder, each
+Recipient hereby assumes sole responsibility to secure any other
+intellectual property rights needed, if any. For example, if
+a third party patent license is required to allow Recipient to
+distribute the Program, it is Recipient's responsibility to acquire
+that license before distributing the Program.
+d) Each Contributor represents that to its knowledge it has sufficient
+copyright rights in its Contribution, if any, to grant the copyright
+license set forth in this Agreement.
+3. REQUIREMENTS
+A Contributor may choose to distribute the Program in object
+code form under its own license agreement, provided that:
+a) it complies with the terms and conditions of this Agreement;
+and
+b) its license agreement:
+i) effectively disclaims on behalf of all Contributors all warranties
+and conditions, express and implied, including warranties or
+conditions of title and non-infringement, and implied warranties
+or conditions of merchantability and fitness for a particular
+purpose;
+ii) effectively excludes on behalf of all Contributors all liability
+for damages, including direct, indirect, special, incidental
+and consequential damages, such as lost profits;
+iii) states that any provisions which differ from this Agreement
+are offered by that Contributor alone and not by any other party;
+and
+iv) states that source code for the Program is available from
+such Contributor, and informs licensees how to obtain it in a
+reasonable manner on or through a medium customarily used for
+software exchange.
+When the Program is made available in source code form:
+a) it must be made available under this Agreement; and
+b) a copy of this Agreement must be included with each copy of
+the Program.
+Contributors may not remove or alter any copyright notices contained
+within the Program.
+Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.
+4. COMMERCIAL DISTRIBUTION
+Commercial distributors of software may accept certain responsibilities
+with respect to end users, business partners and the like. While
+this license is intended to facilitate the commercial use of
+the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create
+potential liability for other Contributors. Therefore, if a Contributor
+includes the Program in a commercial product offering, such Contributor
+("Commercial Contributor") hereby agrees to defend and indemnify
+every other Contributor ("Indemnified Contributor") against any
+losses, damages and costs (collectively "Losses") arising from
+claims, lawsuits and other legal actions brought by a third party
+against the Indemnified Contributor to the extent caused by the
+acts or omissions of such Commercial Contributor in connection
+with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any
+claims or Losses relating to any actual or alleged intellectual
+property infringement. In order to qualify, an Indemnified Contributor
+must: a) promptly notify the Commercial Contributor in writing
+of such claim, and b) allow the Commercial Contributor to control,and
+cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor
+may participate in any such claim at its own expense. For example,
+a Contributor might include the Program in a commercial product
+offering, Product X. That Contributor is then a Commercial Contributor.
+If that Commercial Contributor then makes performance claims,
+or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have
+to defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any
+other Contributor to pay any damages as a result, the Commercial
+Contributor must pay those damages.
+5. NO WARRANTY
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM
+IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
+ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with
+its exercise of rights under this Agreement , including but not
+limited to the risks and costs of program errors, compliance
+with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations.
+6. DISCLAIMER OF LIABILITY
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE
+OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGES.
+7. GENERAL
+If any provision of this Agreement is invalid or unenforceable
+under applicable law, it shall not affect the validity or enforceability
+of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be
+reformed to the minimum extent necessary to make such provision
+valid and enforceable. If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in
+a lawsuit) alleging that the Program itself (excluding combinations
+of the Program with other software or hardware) infringes such
+Recipient's patent(s), then such Recipient's rights granted under
+Section 2(b) shall terminate as of the date such litigation is
+filed. All Recipient's rights under this Agreement shall terminate
+if it fails to comply with any of the material terms or conditions
+of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If
+all Recipient's rights under this Agreement terminate, Recipient
+agrees to cease use and distribution of the Program as soon as
+reasonably practicable. However, Recipient's obligations under
+this Agreement and any licenses granted by Recipient relating
+to the Program shall continue and survive. Everyone is permitted
+to copy and distribute copies of this Agreement,
+but in order to avoid inconsistency the Agreement is copyrighted
+and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including
+revisions) of this Agreement from time to time. No one other
+than the Agreement Steward has the right to modify this Agreement.
+The Eclipse Foundation is the initial Agreement Steward. The
+Eclipse Foundation may assign the responsibility to serve as
+the Agreement Steward to a suitable separate entity. Each new
+version of the Agreement will be given a distinguishing version
+number. The Program (including Contributions) may always be distributed
+subject to the version of the Agreement under which it was received.
+In addition, after a new version of the Agreement is published,
+Contributor may elect to distribute the Program (including its
+Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights
+or licenses to the intellectual property of any Contributor under
+this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under
+this Agreement are reserved. This Agreement is governed by the
+laws of the State of New York and the intellectual property laws
+of the United States of America. No party to this Agreement will
+bring a legal action under this Agreement more than one year
+after the cause of action arose. Each party waives its rights
+to a jury trial in any resulting litigation.
</copyright>
<license url="http://www.example.com/license">
15 years, 6 months
JBoss Tools SVN: r15616 - in trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog: tabs and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-05-30 08:54:25 -0400 (Sat, 30 May 2009)
New Revision: 15616
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/StyleComposite.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/BaseTabControl.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/ICSSTabControl.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabQuickEditControl.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4395
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2009-05-30 12:46:21 UTC (rev 15615)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2009-05-30 12:54:25 UTC (rev 15616)
@@ -218,6 +218,7 @@
clearButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
getStyleComposite().clearStyleComposite();
+ getStyleComposite().updateCurrentTab();
}
});
}
@@ -252,7 +253,7 @@
classCombo.setToolTipText(cssModel.getCSSRuleText(selectorLabel));
getStyleComposite().setStyleProperties(
cssModel.getClassProperties(selectorLabel));
- getStyleComposite().selectTab(StyleComposite.DEFAULT_START_TAB);
+ getStyleComposite().updateCurrentTab();
}
/**
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/StyleComposite.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/StyleComposite.java 2009-05-30 12:46:21 UTC (rev 15615)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/StyleComposite.java 2009-05-30 12:54:25 UTC (rev 15616)
@@ -69,10 +69,7 @@
tabFolder.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
-
- final TabItem tabItem = (TabItem) e.item;
- if (tabItem.getData() instanceof ICSSTabControl)
- ((ICSSTabControl) tabItem.getData()).tabSelected();
+ updateTab((TabItem) e.item);
}
public void widgetDefaultSelected(SelectionEvent e) {
@@ -145,6 +142,8 @@
tabComposite.setContent(baseTabControl);
tabComposite.setMinSize(baseTabControl.computeSize(SWT.DEFAULT,
SWT.DEFAULT));
+
+ tabFolder.setSelection(DEFAULT_START_TAB);
}
@@ -195,9 +194,17 @@
tabFolder.setSelection(index);
TabItem item = tabFolder.getItem(index);
- if (item.getData() instanceof ICSSTabControl)
- ((ICSSTabControl) item.getData()).tabSelected();
+ updateTab(item);
}
+ public void updateCurrentTab() {
+ updateTab(tabFolder.getSelection()[0]);
+ }
+
+ private void updateTab(TabItem item) {
+ if (item.getData() instanceof ICSSTabControl)
+ ((ICSSTabControl) item.getData()).update();
+ }
+
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/BaseTabControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/BaseTabControl.java 2009-05-30 12:46:21 UTC (rev 15615)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/BaseTabControl.java 2009-05-30 12:54:25 UTC (rev 15616)
@@ -505,7 +505,7 @@
}
- public void tabSelected() {
+ public void update() {
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/ICSSTabControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/ICSSTabControl.java 2009-05-30 12:46:21 UTC (rev 15615)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/ICSSTabControl.java 2009-05-30 12:54:25 UTC (rev 15616)
@@ -2,5 +2,5 @@
public interface ICSSTabControl {
- public void tabSelected();
+ public void update();
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java 2009-05-30 12:46:21 UTC (rev 15615)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java 2009-05-30 12:54:25 UTC (rev 15616)
@@ -111,7 +111,7 @@
}
}
- public void tabSelected() {
+ public void update() {
cssModel.updateCSSStyle(selector, styleAttributes);
selectClass(selector);
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabQuickEditControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabQuickEditControl.java 2009-05-30 12:46:21 UTC (rev 15615)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabQuickEditControl.java 2009-05-30 12:54:25 UTC (rev 15616)
@@ -45,24 +45,6 @@
}
/**
- * Update data method.
- */
- protected void updateData() {
-
- Control[] controls = this.getChildren();
- if (controls != null) {
- for (int i = 0; i < controls.length; i++) {
- if (!controls[i].isDisposed()) {
- controls[i].dispose();
- }
- }
- }
-
- addContent();
- this.layout();
- }
-
- /**
* Initialize method.s
*/
private void addContent() {
@@ -81,19 +63,25 @@
String value = getStyleAttributes().getAttribute(key);
if (value != null && value.length() > 0) {
- addLabel(this, getLabel(key));
+ addLabel(this, key);
createControl(this, key);
}
}
}
@Override
- public void tabSelected() {
- updateData();
- }
+ public void update() {
+ Control[] controls = this.getChildren();
+ if (controls != null) {
+ for (int i = 0; i < controls.length; i++) {
+ if (!controls[i].isDisposed()) {
+ controls[i].dispose();
+ }
+ }
+ }
- private String getLabel(String key) {
- return key;
+ addContent();
+ this.layout();
}
}
\ No newline at end of file
15 years, 6 months
JBoss Tools SVN: r15615 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb: internal and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-30 08:46:21 -0400 (Sat, 30 May 2009)
New Revision: 15615
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ELFunction.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbXMLStoreConstants.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletTagLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigAttribute.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigComponent.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigTagLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/Facet.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IComponent.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IFacesConfigTagLibrary.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java 2009-05-30 12:01:27 UTC (rev 15614)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java 2009-05-30 12:46:21 UTC (rev 15615)
@@ -16,10 +16,11 @@
* @author Alexey Kazakov
*/
public interface IProposalProcessor {
+ public TextProposal[] EMPTY_PROPOSAL_LIST = new TextProposal[0];
/**
* @return proposals
*/
- TextProposal[] getProposals(KbQuery query, IPageContext context);
+ public TextProposal[] getProposals(KbQuery query, IPageContext context);
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbXMLStoreConstants.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbXMLStoreConstants.java 2009-05-30 12:01:27 UTC (rev 15614)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbXMLStoreConstants.java 2009-05-30 12:46:21 UTC (rev 15615)
@@ -20,6 +20,8 @@
public String TAG_LIBRARY = "library"; //$NON-NLS-1$
public String TAG_COMPONENT = "component"; //$NON-NLS-1$
public String TAG_ATTRIBUTE = "attribute"; //$NON-NLS-1$
+ public String TAG_FACET = "facet"; //$NON-NLS-1$
+ public String TAG_FUNCTION = "function"; //$NON-NLS-1$
public String CLS_TLD_LIBRARY = "tld"; //$NON-NLS-1$
public String CLS_FACELET_LIBRARY = "facelet"; //$NON-NLS-1$
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java 2009-05-30 12:01:27 UTC (rev 15614)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java 2009-05-30 12:46:21 UTC (rev 15615)
@@ -27,6 +27,7 @@
import org.jboss.tools.jst.web.kb.internal.taglib.AbstractAttribute;
import org.jboss.tools.jst.web.kb.internal.taglib.AbstractComponent;
import org.jboss.tools.jst.web.kb.internal.taglib.AbstractTagLib;
+import org.jboss.tools.jst.web.kb.internal.taglib.ELFunction;
import org.jboss.tools.jst.web.kb.internal.taglib.FaceletTag;
import org.jboss.tools.jst.web.kb.internal.taglib.FaceletTagLibrary;
import org.jboss.tools.jst.web.kb.internal.taglib.FacesConfigAttribute;
@@ -35,6 +36,7 @@
import org.jboss.tools.jst.web.kb.internal.taglib.TLDAttribute;
import org.jboss.tools.jst.web.kb.internal.taglib.TLDLibrary;
import org.jboss.tools.jst.web.kb.internal.taglib.TLDTag;
+import org.jboss.tools.jst.web.kb.taglib.Facet;
import org.jboss.tools.jst.web.model.helpers.InnerModelHelper;
import org.jboss.tools.jst.web.model.project.ext.store.XMLValueInfo;
@@ -44,6 +46,10 @@
public class XMLScanner implements IFileScanner {
public static final String ATTR_TAGCLASS ="tagclass"; //$NON-NLS-1$
public static final String ATTR_BODY_CONTENT = "bodycontent"; //$NON-NLS-1$
+ public static final String ATTR_FACET_NAME = "facet-name"; //$NON-NLS-1$
+ public static final String ATTR_ATTRIBUTE_NAME = "attribute-name"; //$NON-NLS-1$
+ public static final String ATTR_FUNC_SIGN = "function-signature"; //$NON-NLS-1$
+ public static final String ATTR_FUNC_NAME = "function-name"; //$NON-NLS-1$
public XMLScanner() {}
@@ -192,11 +198,13 @@
FaceletTag tag = new FaceletTag();
tag.setId(t);
tag.setName(new XMLValueInfo(t, "tag-name"));
- //what else?
-
library.addComponent(tag);
} else if(entity.startsWith("FaceletTaglibFunction")) {
- //TODO
+ ELFunction f = new ELFunction();
+ f.setId(t);
+ f.setName(new XMLValueInfo(t, ATTR_FUNC_NAME));
+ f.setSignature(new XMLValueInfo(t, ATTR_FUNC_SIGN));
+ library.addFunction(f);
}
}
}
@@ -214,8 +222,8 @@
for (XModelObject c: os) {
FacesConfigComponent component = new FacesConfigComponent();
component.setId(c);
+ //what else can we take for the name? only attribute 'component-type' is available
component.setName(new XMLValueInfo(c, "component-type"));
- //TODO what else can we take for the name? only attribute 'component-type' is available
component.setComponentClass(new XMLValueInfo(c, "component-class"));
component.setComponentType(c.getAttributeValue("component-type"));
@@ -226,10 +234,16 @@
String entity = child.getModelEntity().getName();
if(entity.startsWith("JSFAttribute")) {
FacesConfigAttribute attr = new FacesConfigAttribute();
+ attr.setId(child);
+ attr.setName(new XMLValueInfo(child, ATTR_ATTRIBUTE_NAME));
component.addAttribute(attr);
} else if(entity.startsWith("JSFFacet")) {
- //TODO
+ Facet f = new Facet();
+ f.setId(child);
+ f.setName(new XMLValueInfo(child, ATTR_FACET_NAME));
+ f.setDescription(new XMLValueInfo(child, AbstractComponent.DESCRIPTION));
+ component.addFacet(f);
}
}
library.addComponent(component);
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java 2009-05-30 12:01:27 UTC (rev 15614)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java 2009-05-30 12:46:21 UTC (rev 15615)
@@ -107,11 +107,19 @@
* @see org.jboss.tools.jst.web.kb.IProposalProcessor#getProposals(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.IPageContext)
*/
public TextProposal[] getProposals(KbQuery query, IPageContext context) {
- List<TextProposal> proposals = new ArrayList<TextProposal>();
+ List<TextProposal> proposals = null;
ELResolver[] resolvers = context.getElResolvers();
for (int i = 0; i < resolvers.length; i++) {
- proposals.addAll(resolvers[i].getCompletions(query.getValue(), false, query.getValue().length(), context));
+ List<TextProposal> list = resolvers[i].getCompletions(query.getValue(), false, query.getValue().length(), context);
+ if(list == null || list.isEmpty()) continue;
+ if(proposals == null) {
+ proposals = new ArrayList<TextProposal>();
+ }
+ proposals.addAll(list);
}
+ if(proposals == null || proposals.isEmpty()) {
+ return EMPTY_PROPOSAL_LIST;
+ }
return proposals.toArray(new TextProposal[proposals.size()]);
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java 2009-05-30 12:01:27 UTC (rev 15614)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java 2009-05-30 12:46:21 UTC (rev 15615)
@@ -25,6 +25,7 @@
import org.jboss.tools.jst.web.kb.KbQuery;
import org.jboss.tools.jst.web.kb.internal.KbObject;
import org.jboss.tools.jst.web.kb.internal.KbXMLStoreConstants;
+import org.jboss.tools.jst.web.kb.taglib.Facet;
import org.jboss.tools.jst.web.kb.taglib.IAttribute;
import org.jboss.tools.jst.web.kb.taglib.IComponent;
import org.w3c.dom.Element;
@@ -207,13 +208,36 @@
}
}
+ /**
+ * Facets are a feature of JSF only, they are included into
+ * the base interface and implementation
+ * for the sake of common approach.
+ */
+ public Facet getFacet(String name) {
+ return null;
+ }
+
+ public static final Facet[] EMPTY_FACET_SET = new Facet[0];
+
+ public Facet[] getFacets() {
+ return EMPTY_FACET_SET;
+ }
+
+ public Facet[] getFacets(String nameTemplate) {
+ return EMPTY_FACET_SET;
+ }
+
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.IProposalProcessor#getProposals(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.IPageContext)
*/
public TextProposal[] getProposals(KbQuery query, IPageContext context) {
- List<TextProposal> proposals = new ArrayList<TextProposal>();
IAttribute[] attributes = getAttributes(query, context);
+ if(attributes.length == 0) {
+ return EMPTY_PROPOSAL_LIST;
+ }
+ List<TextProposal> proposals = null;
if(query.getType() == KbQuery.Type.ATTRIBUTE_NAME) {
+ proposals = new ArrayList<TextProposal>();
for (int i = 0; i < attributes.length; i++) {
TextProposal proposal = new TextProposal();
proposal.setContextInfo(attributes[i].getDescription());
@@ -224,11 +248,17 @@
} else if(query.getType() == KbQuery.Type.ATTRIBUTE_VALUE) {
for (int i = 0; i < attributes.length; i++) {
TextProposal[] attributeProposals = attributes[i].getProposals(query, context);
+ if(attributeProposals.length > 0 && proposals == null) {
+ proposals = new ArrayList<TextProposal>();
+ }
for (int j = 0; j < attributeProposals.length; j++) {
proposals.add(attributeProposals[j]);
}
}
}
+ if(proposals == null || proposals.isEmpty()) {
+ return EMPTY_PROPOSAL_LIST;
+ }
return proposals.toArray(new TextProposal[proposals.size()]);
}
@@ -314,6 +344,9 @@
}
}
+ public AbstractComponent clone() throws CloneNotSupportedException {
+ return (AbstractComponent)super.clone();
+ }
public String getXMLName() {
return KbXMLStoreConstants.TAG_COMPONENT;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-05-30 12:01:27 UTC (rev 15614)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-05-30 12:46:21 UTC (rev 15615)
@@ -276,6 +276,9 @@
public AbstractTagLib clone() throws CloneNotSupportedException {
AbstractTagLib t = (AbstractTagLib)super.clone();
t.components = new HashMap<String, IComponent>();
+ for (IComponent c: components.values()) {
+ t.addComponent(((AbstractComponent)c).clone());
+ }
t.components.putAll(components);
return t;
}
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ELFunction.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ELFunction.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ELFunction.java 2009-05-30 12:46:21 UTC (rev 15615)
@@ -0,0 +1,89 @@
+package org.jboss.tools.jst.web.kb.internal.taglib;
+
+import java.util.Properties;
+
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.store.XMLStoreConstants;
+import org.jboss.tools.jst.web.kb.internal.KbObject;
+import org.jboss.tools.jst.web.kb.internal.KbXMLStoreConstants;
+import org.jboss.tools.jst.web.kb.internal.scanner.XMLScanner;
+import org.jboss.tools.jst.web.kb.taglib.IELFunction;
+import org.jboss.tools.jst.web.model.project.ext.store.XMLValueInfo;
+import org.w3c.dom.Element;
+
+public class ELFunction extends KbObject implements IELFunction {
+ public static final String SIGNATURE = "signature";
+ private String name;
+ private String signature;
+
+ public ELFunction() {}
+
+ public String getName() {
+ return name;
+ }
+
+ public String getFunctionSignature() {
+ return signature;
+ }
+
+ public void setName(IValueInfo s) {
+ name = s == null ? null : s.getValue();
+ attributesInfo.put(XMLStoreConstants.ATTR_NAME, s);
+ }
+
+ public void setSignature(IValueInfo s) {
+ signature = s == null ? null : s.getValue();
+ attributesInfo.put(SIGNATURE, s);
+ }
+
+ public ELFunction clone() throws CloneNotSupportedException {
+ return (ELFunction)super.clone();
+ }
+
+ public String getXMLName() {
+ return KbXMLStoreConstants.TAG_FUNCTION;
+ }
+
+ public Element toXML(Element parent, Properties context) {
+ Element element = super.toXML(parent, context);
+
+ if(attributesInfo.get(XMLStoreConstants.ATTR_NAME) == null && name != null) {
+ element.setAttribute(XMLStoreConstants.ATTR_NAME, name);
+ }
+
+ return element;
+ }
+
+ public void loadXML(Element element, Properties context) {
+ super.loadXML(element, context);
+
+ setName(attributesInfo.get(XMLStoreConstants.ATTR_NAME));
+ setSignature(attributesInfo.get(SIGNATURE));
+
+ if(name == null && element.hasAttribute(XMLStoreConstants.ATTR_NAME)) {
+ name = element.getAttribute(XMLStoreConstants.ATTR_NAME);
+ }
+ }
+
+ @Override
+ protected void saveAttributesInfo(Element element, Properties context) {
+ if(context.get(XMLStoreConstants.KEY_MODEL_OBJECT) == getId()) {
+
+ } else {
+ super.saveAttributesInfo(element, context);
+ }
+ }
+
+ @Override
+ protected void loadAttributesInfo(Element element, Properties context) {
+ if(context.get(XMLStoreConstants.KEY_MODEL_OBJECT) == getId()) {
+ XModelObject a = (XModelObject)getId();
+ attributesInfo.put(XMLStoreConstants.ATTR_NAME, new XMLValueInfo(a, XMLScanner.ATTR_FUNC_NAME));
+ attributesInfo.put(SIGNATURE, new XMLValueInfo(a, XMLScanner.ATTR_FUNC_SIGN));
+ } else {
+ super.loadAttributesInfo(element, context);
+ }
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ELFunction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletTagLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletTagLibrary.java 2009-05-30 12:01:27 UTC (rev 15614)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletTagLibrary.java 2009-05-30 12:46:21 UTC (rev 15615)
@@ -10,27 +10,49 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.internal.taglib;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.jboss.tools.common.model.project.ext.event.Change;
+import org.jboss.tools.common.xml.XMLUtilities;
+import org.jboss.tools.jst.web.kb.internal.KbObject;
import org.jboss.tools.jst.web.kb.internal.KbXMLStoreConstants;
+import org.jboss.tools.jst.web.kb.taglib.Facet;
import org.jboss.tools.jst.web.kb.taglib.IELFunction;
import org.jboss.tools.jst.web.kb.taglib.IFaceletTagLibrary;
+import org.w3c.dom.Element;
/**
* @author Viacheslav Kabanovich
*/
public class FaceletTagLibrary extends AbstractTagLib implements
IFaceletTagLibrary {
+ List<ELFunction> functions = new ArrayList<ELFunction>();
+ IELFunction[] functionArray = null;
public FaceletTagLibrary() {
}
public IELFunction[] getFunctions() {
- // TODO Auto-generated method stub
- return null;
+ if(functionArray == null) {
+ functionArray = functions.toArray(new ELFunction[0]);
+ }
+ return functionArray;
}
+ public void addFunction(ELFunction f) {
+ functions.add(f);
+ functionArray = null;
+ }
+
public FaceletTagLibrary clone() throws CloneNotSupportedException {
FaceletTagLibrary copy = (FaceletTagLibrary)super.clone();
+ copy.functions = new ArrayList<ELFunction>();
+ for (IELFunction f: getFunctions()) {
+ copy.addFunction(((ELFunction)f).clone());
+ }
return copy;
}
@@ -38,4 +60,32 @@
return KbXMLStoreConstants.CLS_FACELET_LIBRARY;
}
+ public List<Change> merge(KbObject s) {
+ List<Change> changes = super.merge(s);
+ FacesConfigTagLibrary t = (FacesConfigTagLibrary)s;
+ //TODO
+ return changes;
+ }
+
+ public Element toXML(Element parent, Properties context) {
+ Element element = super.toXML(parent, context);
+
+ for (IELFunction f: getFunctions()) {
+ ((KbObject)f).toXML(element, context);
+ }
+
+ return element;
+ }
+
+ public void loadXML(Element element, Properties context) {
+ super.loadXML(element, context);
+
+ Element[] cs = XMLUtilities.getChildren(element, KbXMLStoreConstants.TAG_FUNCTION);
+ for (Element e: cs) {
+ ELFunction f = new ELFunction();
+ f.loadXML(e, context);
+ addFunction(f);
+ }
+ }
+
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigAttribute.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigAttribute.java 2009-05-30 12:01:27 UTC (rev 15614)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigAttribute.java 2009-05-30 12:46:21 UTC (rev 15615)
@@ -15,6 +15,7 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.project.ext.store.XMLStoreConstants;
import org.jboss.tools.jst.web.kb.internal.KbXMLStoreConstants;
+import org.jboss.tools.jst.web.kb.internal.scanner.XMLScanner;
import org.jboss.tools.jst.web.model.project.ext.store.XMLValueInfo;
import org.w3c.dom.Element;
@@ -31,9 +32,9 @@
protected void loadAttributesInfo(Element element, Properties context) {
if(context.get(XMLStoreConstants.KEY_MODEL_OBJECT) == getId()) {
XModelObject a = (XModelObject)getId();
- attributesInfo.put(XMLStoreConstants.ATTR_NAME, new XMLValueInfo(a, "attribute-name"));
+ attributesInfo.put(XMLStoreConstants.ATTR_NAME, new XMLValueInfo(a, XMLScanner.ATTR_ATTRIBUTE_NAME));
+ attributesInfo.put(AbstractComponent.DESCRIPTION, new XMLValueInfo(a, AbstractComponent.DESCRIPTION));
//TODO how to define required?
- attributesInfo.put(AbstractComponent.DESCRIPTION, new XMLValueInfo(a, AbstractComponent.DESCRIPTION));
// attributesInfo.put(REQUIRED, new XMLValueInfo(a, REQUIRED));
} else {
super.loadAttributesInfo(element, context);
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigComponent.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigComponent.java 2009-05-30 12:01:27 UTC (rev 15614)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigComponent.java 2009-05-30 12:46:21 UTC (rev 15615)
@@ -10,15 +10,121 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.internal.taglib;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.jboss.tools.common.model.project.ext.event.Change;
+import org.jboss.tools.common.xml.XMLUtilities;
+import org.jboss.tools.jst.web.kb.internal.KbObject;
import org.jboss.tools.jst.web.kb.internal.KbXMLStoreConstants;
+import org.jboss.tools.jst.web.kb.taglib.Facet;
+import org.w3c.dom.Element;
/**
* @author Viacheslav Kabanovich
*/
public class FacesConfigComponent extends AbstractComponent {
+ Map<String,Facet> facets = new HashMap<String, Facet>();
+ Facet[] facetArray = EMPTY_FACET_SET;
+ public Facet getFacet(String name) {
+ return facets.get(name);
+ }
+
+ public static final Facet[] EMPTY_FACET_SET = new Facet[0];
+
+ public Facet[] getFacets() {
+ if(facetArray == null) {
+ if(facets.isEmpty()) {
+ facetArray = EMPTY_FACET_SET;
+ } else {
+ facetArray = facets.values().toArray(new Facet[0]);
+ }
+ }
+ return facetArray;
+ }
+
+ public Facet[] getFacets(String nameTemplate) {
+ Facet[] fs = getFacets();
+ if(fs == null || fs.length == 0) return EMPTY_FACET_SET;
+ List<Facet> result = new ArrayList<Facet>();
+ for (Facet f: fs) {
+ String name = f.getName();
+ boolean match = false; //TODO implement
+ if(match) result.add(f);
+ }
+ return result.isEmpty() ? EMPTY_FACET_SET : result.toArray(new Facet[0]);
+ }
+
+ public void addFacet(Facet f) {
+ adopt((KbObject)f);
+ facets.put(f.getName(), f);
+ facetArray = null;
+ }
+
public String getXMLClass() {
return KbXMLStoreConstants.CLS_FACESCONFIG_LIBRARY;
}
+ public List<Change> merge(KbObject s) {
+ List<Change> changes = super.merge(s);
+ FacesConfigComponent c = (FacesConfigComponent)s;
+
+ Change children = new Change(this, null, null, null);
+ mergeFacets(c, children);
+ changes = Change.addChange(changes, children);
+
+ return changes;
+ }
+
+ public void mergeFacets(FacesConfigComponent c, Change children) {
+ Map<Object,Facet> facetMap = new HashMap<Object, Facet>();
+ for (Facet a: facets.values()) facetMap.put(((KbObject)a).getId(), a);
+ for (Facet a: c.facets.values()) {
+ Facet loaded = (Facet)a;
+ Facet current = facetMap.get(loaded.getId());
+ if(current == null) {
+ addFacet(loaded);
+ Change change = new Change(this, null, null, loaded);
+ children.addChildren(Change.addChange(null, change));
+ } else {
+ List<Change> rc = current.merge(loaded);
+ if(rc != null) children.addChildren(rc);
+ }
+ }
+ for (Facet a: facetMap.values()) {
+ Facet removed = a;
+ if(facets.get(removed.getName()) == removed) {
+ facets.remove(removed.getName());
+ facetArray = null;
+ Change change = new Change(this, null, removed, null);
+ children.addChildren(Change.addChange(null, change));
+ }
+ }
+ }
+
+ public Element toXML(Element parent, Properties context) {
+ Element element = super.toXML(parent, context);
+
+ for (Facet f: getFacets()) {
+ ((KbObject)f).toXML(element, context);
+ }
+
+ return element;
+ }
+
+ public void loadXML(Element element, Properties context) {
+ super.loadXML(element, context);
+
+ Element[] cs = XMLUtilities.getChildren(element, KbXMLStoreConstants.TAG_FACET);
+ for (Element e: cs) {
+ Facet f = new Facet();
+ f.loadXML(e, context);
+ addFacet(f);
+ }
+ }
+
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigTagLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigTagLibrary.java 2009-05-30 12:01:27 UTC (rev 15614)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacesConfigTagLibrary.java 2009-05-30 12:46:21 UTC (rev 15615)
@@ -38,34 +38,27 @@
return componentsByType.get(type);
}
- public Facet getFacet(String name) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Facet[] getFacets() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Facet[] getFacets(String nameTemplate) {
- // TODO Auto-generated method stub
- return null;
- }
-
public FacesConfigTagLibrary clone() throws CloneNotSupportedException {
FacesConfigTagLibrary copy = (FacesConfigTagLibrary)super.clone();
- //TODO
+
return copy;
}
public List<Change> merge(KbObject s) {
List<Change> changes = super.merge(s);
FacesConfigTagLibrary t = (FacesConfigTagLibrary)s;
- //TODO
+
+ Change children = new Change(this, null, null, null);
+ mergeFunctions(t, children);
+ changes = Change.addChange(changes, children);
+
return changes;
}
+ public void mergeFunctions(FacesConfigTagLibrary c, Change children) {
+ //TODO
+ }
+
public String getXMLClass() {
return KbXMLStoreConstants.CLS_FACESCONFIG_LIBRARY;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/Facet.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/Facet.java 2009-05-30 12:01:27 UTC (rev 15614)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/Facet.java 2009-05-30 12:46:21 UTC (rev 15615)
@@ -10,11 +10,23 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.taglib;
+import java.util.Properties;
+
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.store.XMLStoreConstants;
+import org.jboss.tools.jst.web.kb.internal.KbObject;
+import org.jboss.tools.jst.web.kb.internal.KbXMLStoreConstants;
+import org.jboss.tools.jst.web.kb.internal.scanner.XMLScanner;
+import org.jboss.tools.jst.web.kb.internal.taglib.AbstractComponent;
+import org.jboss.tools.jst.web.model.project.ext.store.XMLValueInfo;
+import org.w3c.dom.Element;
+
/**
* JSF Facet Component
* @author Alexey Kazakov
*/
-public class Facet {
+public class Facet extends KbObject {
private String description;
private String name;
@@ -40,4 +52,60 @@
public void setName(String name) {
this.name = name;
}
+
+ public void setName(IValueInfo s) {
+ name = s == null ? null : s.getValue();
+ attributesInfo.put(XMLStoreConstants.ATTR_NAME, s);
+ }
+
+ public void setDescription(IValueInfo s) {
+ description = s == null ? null : s.getValue();
+ attributesInfo.put(AbstractComponent.DESCRIPTION, s);
+ }
+
+ public String getXMLName() {
+ return KbXMLStoreConstants.TAG_FACET;
+ }
+
+ public Element toXML(Element parent, Properties context) {
+ Element element = super.toXML(parent, context);
+
+ if(attributesInfo.get(XMLStoreConstants.ATTR_NAME) == null && name != null) {
+ element.setAttribute(XMLStoreConstants.ATTR_NAME, name);
+ }
+
+ return element;
+ }
+
+ public void loadXML(Element element, Properties context) {
+ super.loadXML(element, context);
+
+ setName(attributesInfo.get(XMLStoreConstants.ATTR_NAME));
+ setDescription(attributesInfo.get(AbstractComponent.DESCRIPTION));
+
+ if(name == null && element.hasAttribute(XMLStoreConstants.ATTR_NAME)) {
+ name = element.getAttribute(XMLStoreConstants.ATTR_NAME);
+ }
+ }
+
+ @Override
+ protected void saveAttributesInfo(Element element, Properties context) {
+ if(context.get(XMLStoreConstants.KEY_MODEL_OBJECT) == getId()) {
+
+ } else {
+ super.saveAttributesInfo(element, context);
+ }
+ }
+
+ @Override
+ protected void loadAttributesInfo(Element element, Properties context) {
+ if(context.get(XMLStoreConstants.KEY_MODEL_OBJECT) == getId()) {
+ XModelObject a = (XModelObject)getId();
+ attributesInfo.put(XMLStoreConstants.ATTR_NAME, new XMLValueInfo(a, XMLScanner.ATTR_FACET_NAME));
+ attributesInfo.put(AbstractComponent.DESCRIPTION, new XMLValueInfo(a, AbstractComponent.DESCRIPTION));
+ } else {
+ super.loadAttributesInfo(element, context);
+ }
+ }
+
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IComponent.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IComponent.java 2009-05-30 12:01:27 UTC (rev 15614)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IComponent.java 2009-05-30 12:46:21 UTC (rev 15615)
@@ -78,4 +78,24 @@
* @return
*/
public IAttribute[] getAttributes(KbQuery query, IPageContext context);
+
+ /**
+ * Facets are a feature of JSF only, they are included into
+ * the base interface for the sake of common approach.
+ *
+ * @return all facets of this component
+ */
+ Facet[] getFacets();
+
+ /**
+ * @param nameTemplate
+ * @return facets with names which start with given template.
+ */
+ Facet[] getFacets(String nameTemplate);
+
+ /**
+ * @param name
+ * @return facet by name
+ */
+ Facet getFacet(String name);
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IFacesConfigTagLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IFacesConfigTagLibrary.java 2009-05-30 12:01:27 UTC (rev 15614)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IFacesConfigTagLibrary.java 2009-05-30 12:46:21 UTC (rev 15615)
@@ -21,20 +21,4 @@
*/
IComponent getComponentByType(String type);
- /**
- * @return all facets of this component
- */
- Facet[] getFacets();
-
- /**
- * @param nameTemplate
- * @return facets with names which start with given template.
- */
- Facet[] getFacets(String nameTemplate);
-
- /**
- * @param name
- * @return facet by name
- */
- Facet getFacet(String name);
}
\ No newline at end of file
15 years, 6 months
JBoss Tools SVN: r15614 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-05-30 08:01:27 -0400 (Sat, 30 May 2009)
New Revision: 15614
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/AbstractCSSDialog.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSStyleDialog.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4396
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/AbstractCSSDialog.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/AbstractCSSDialog.java 2009-05-30 01:35:08 UTC (rev 15613)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/AbstractCSSDialog.java 2009-05-30 12:01:27 UTC (rev 15614)
@@ -86,8 +86,6 @@
gridData.heightHint = DEFAULT_DIALOG_HEIGHT;
gridData.widthHint = DEFAULT_DIALOG_WIDTH;
- setTitle(JstUIMessages.CSS_STYLE_CLASS_EDITOR_TITLE);
-
createControlPane(parentComposite);
return parentComposite;
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2009-05-30 01:35:08 UTC (rev 15613)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2009-05-30 12:01:27 UTC (rev 15614)
@@ -77,16 +77,23 @@
public CSSClassDialog(Shell parentShell, IFile file,
IStructuredSelection selection) {
super(parentShell);
-
setShellStyle(getShellStyle() | SWT.RESIZE | SWT.MAX
| SWT.APPLICATION_MODAL);
this.file = file;
this.cssModel = new CSSModel(file);
this.selection = selection;
+
}
@Override
+ protected void configureShell(Shell newShell) {
+ super.configureShell(newShell);
+ newShell.setText(JstUIMessages.CSS_STYLE_CLASS_EDITOR_TITLE);
+
+ }
+
+ @Override
protected Control createContents(Composite parent) {
Control contents = super.createContents(parent);
updateControlPane();
@@ -94,6 +101,12 @@
}
@Override
+ protected Control createDialogArea(Composite parent) {
+ setTitle(JstUIMessages.CSS_STYLE_CLASS_EDITOR_TITLE);
+ return super.createDialogArea(parent);
+ }
+
+ @Override
protected StyleComposite createStyleComposite(Composite parent) {
StyleComposite styleComposite = super.createStyleComposite(parent);
@@ -257,13 +270,12 @@
classCombo.select(classCombo.getItemCount() - 1);
}
-
@Override
public void releaseResources() {
-
+
super.releaseResources();
preview.releaseModel();
-
+
if (cssModel != null) {
cssModel.release();
cssModel = null;
@@ -364,17 +376,17 @@
applyButton.setEnabled(false);
}
-
+
protected Button getApplyButton() {
return applyButton;
}
-
+
protected Button getAddNewClassButton() {
return addNewClassButton;
}
-
+
protected Combo getClassCombo() {
return classCombo;
}
-
+
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSStyleDialog.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSStyleDialog.java 2009-05-30 01:35:08 UTC (rev 15613)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSStyleDialog.java 2009-05-30 12:01:27 UTC (rev 15614)
@@ -14,7 +14,10 @@
import java.util.Map;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.jst.jsp.messages.JstUIMessages;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSConstants;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Util;
@@ -61,4 +64,16 @@
}
return properties;
}
+
+ @Override
+ protected void configureShell(Shell newShell) {
+ super.configureShell(newShell);
+ newShell.setText(JstUIMessages.CSS_STYLE_EDITOR_TITLE);
+ }
+
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ setTitle(JstUIMessages.CSS_STYLE_EDITOR_TITLE);
+ return super.createDialogArea(parent);
+ }
}
15 years, 6 months
JBoss Tools SVN: r15613 - in trunk/jbpm/plugins/org.jboss.tools.jbpm.common: src/org/jboss/tools/jbpm and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-05-29 21:35:08 -0400 (Fri, 29 May 2009)
New Revision: 15613
Removed:
trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/Activator.java
Modified:
trunk/jbpm/plugins/org.jboss.tools.jbpm.common/META-INF/MANIFEST.MF
trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/AddJbpmInstallationDialog.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/JbpmLocationsPage.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/PreferencesManager.java
Log:
- allow for configurations of jbpm 4 runtimes (GPD-346)
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.common/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.common/META-INF/MANIFEST.MF 2009-05-30 01:34:31 UTC (rev 15612)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.common/META-INF/MANIFEST.MF 2009-05-30 01:35:08 UTC (rev 15613)
@@ -10,5 +10,3 @@
org.eclipse.core.runtime;bundle-version="3.4.0"
Export-Package: org.jboss.tools.jbpm.preferences,
org.jboss.tools.jbpm.util
-Bundle-Activator: org.jboss.tools.jbpm.Activator
-Bundle-ActivationPolicy: lazy
Deleted: trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/Activator.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/Activator.java 2009-05-30 01:34:31 UTC (rev 15612)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/Activator.java 2009-05-30 01:35:08 UTC (rev 15613)
@@ -1,18 +0,0 @@
-package org.jboss.tools.jbpm;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-public class Activator extends AbstractUIPlugin {
-
- private static Activator activator;
-
- public static Activator getDefault() {
- return activator;
- }
-
- public Activator() {
- super();
- activator = this;
- }
-
-}
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/AddJbpmInstallationDialog.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/AddJbpmInstallationDialog.java 2009-05-30 01:34:31 UTC (rev 15612)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/AddJbpmInstallationDialog.java 2009-05-30 01:35:08 UTC (rev 15613)
@@ -22,10 +22,9 @@
package org.jboss.tools.jbpm.preferences;
-import java.io.File;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.StatusDialog;
@@ -43,34 +42,29 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-import org.jboss.tools.jbpm.Activator;
public abstract class AddJbpmInstallationDialog extends StatusDialog {
- private static final String pluginId = Activator.getDefault().getBundle().getSymbolicName();
+ private static final String ENTER_NAME = "Enter the name of the jBPM installation.";
+ private static final String ENTER_LOCATION = "Enter the location of the jBPM installation.";
+ private static final String UNEXISTING_LOCATION = "The location does not exist.";
+ private static final String NAME_ALREADY_USED = "The name is already used.";
+ private static final String INVALID_JBPM_INSTALLATION = "This is not a valid jBPM installation.";
- private static final IStatus enterNameStatus = new Status(
- Status.INFO, pluginId, 0, "Enter the name of the jBPM installation.", null);
- private static final IStatus enterLocationStatus = new Status(
- Status.INFO, pluginId, 0, "Enter the location of the jBPM installation.", null);
- private static final IStatus unExistingLocationStatus = new Status(
- Status.ERROR, pluginId, 0, "The location does not exist.", null);
- private static final IStatus nameAlreadyUsedStatus = new Status(
- Status.ERROR, pluginId, 0, "The name is already used.", null);
- private static final IStatus inValidJbpmInstallationStatus = new Status(
- Status.ERROR, pluginId, 0, "This is not a valid jBPM installation.", null);
+ private Plugin plugin;
String title;
Text nameText, locationText;
Button locationButton;
- IStatus currentStatus = enterNameStatus;
+ IStatus currentStatus; ;
String name, location;
IStatus status;
- public AddJbpmInstallationDialog(Shell parentShell) {
+ public AddJbpmInstallationDialog(Shell parentShell, Plugin plugin) {
super(parentShell);
+ this.plugin = plugin;
}
public void initialize(String t, String n, String l) {
@@ -97,7 +91,7 @@
protected Control createContents(Composite parent) {
Control result = super.createContents(parent);
- updateStatus(currentStatus);
+ updateCurrentStatus();
return result;
}
@@ -117,7 +111,6 @@
private void handleLocationChanged() {
location = locationText.getText();
updateCurrentStatus();
- updateStatus(currentStatus);
}
private void createLocationButton(Composite area) {
@@ -166,29 +159,33 @@
private void handleNameChanged() {
name = nameText.getText();
updateCurrentStatus();
- updateStatus(currentStatus);
}
+ private IStatus getStatus(int severity, String str) {
+ return new Status(severity, plugin.getBundle().getSymbolicName(), str, null);
+ }
+
private void updateCurrentStatus() {
if (isNameEmpty() && isLocationEmpty()) {
- currentStatus = enterNameStatus;
+ currentStatus = getStatus(Status.INFO, ENTER_NAME);
} else if (isNameAlreadyUsed() && !"Edit Location".equals(title)) {
- currentStatus = nameAlreadyUsedStatus;
+ currentStatus = getStatus(Status.ERROR, NAME_ALREADY_USED);
} else if (isLocationEmpty()) {
- currentStatus = enterLocationStatus;
+ currentStatus = getStatus(Status.INFO, ENTER_LOCATION);
} else if (!isLocationExisting()) {
- currentStatus = unExistingLocationStatus;
+ currentStatus = getStatus(Status.ERROR, UNEXISTING_LOCATION);
} else if (!isValidJbpmInstallation()) {
- currentStatus = inValidJbpmInstallationStatus;
+ currentStatus = getStatus(Status.ERROR, INVALID_JBPM_INSTALLATION);
} else if (isNameEmpty()) {
- currentStatus = enterNameStatus;
+ currentStatus = getStatus(Status.INFO, ENTER_NAME);
} else {
currentStatus = Status.OK_STATUS;
}
+ updateStatus(currentStatus);
}
private boolean isNameAlreadyUsed() {
- return PreferencesManager.INSTANCE.getJbpmInstallation(nameText.getText()) != null;
+ return PreferencesManager.getPreferencesManager(plugin).getJbpmInstallation(nameText.getText()) != null;
}
private boolean isLocationExisting() {
@@ -202,15 +199,7 @@
private boolean isLocationEmpty() {
return location == null || "".equals(location);
}
-
- private boolean isValidJbpmInstallation() {
- return getJbpmVersionInfoFile().exists();
- }
-
- private File getJbpmVersionInfoFile() {
- return new Path(location).append("/src/resources/gpd/version.info.xml").toFile();
- }
-
+
protected void updateButtonsEnableState(IStatus status) {
Button ok = getButton(IDialogConstants.OK_ID);
if (ok != null && !ok.isDisposed())
@@ -223,7 +212,7 @@
label.setLayoutData(gridData);
label.setText("Name :");
}
-
+
public String getName() {
return name;
}
@@ -232,6 +221,7 @@
return location;
}
- public abstract String getVersion();
+ protected abstract String getVersion();
+ protected abstract boolean isValidJbpmInstallation();
}
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/JbpmLocationsPage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/JbpmLocationsPage.java 2009-05-30 01:34:31 UTC (rev 15612)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/JbpmLocationsPage.java 2009-05-30 01:35:08 UTC (rev 15613)
@@ -21,7 +21,6 @@
*/
package org.jboss.tools.jbpm.preferences;
-import org.eclipse.core.runtime.Preferences;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.viewers.ColumnWeightData;
@@ -41,7 +40,7 @@
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.jboss.tools.jbpm.Activator;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.jboss.tools.jbpm.Constants;
import org.jboss.tools.jbpm.util.AutoResizeTableLayout;
@@ -49,10 +48,13 @@
private TableViewer tableViewer;
private Button addButton, editButton, removeButton;
+
+ private AbstractUIPlugin plugin;
- public JbpmLocationsPage() {
+ public JbpmLocationsPage(AbstractUIPlugin plugin) {
super();
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ this.plugin = plugin;
+ setPreferenceStore(plugin.getPreferenceStore());
}
protected abstract AddJbpmInstallationDialog createAddJbpmInstallationDialog(Shell shell);
@@ -177,12 +179,12 @@
}
private void initializeInput(TableViewer viewer) {
- viewer.setInput(PreferencesManager.INSTANCE);
+ viewer.setInput(PreferencesManager.getPreferencesManager(plugin));
checkItemToCheck(viewer);
}
private void checkItemToCheck(TableViewer viewer) {
- String name = getPreferences().getString(Constants.JBPM_NAME);
+ String name = plugin.getPreferenceStore().getString(Constants.JBPM_NAME);
if (name != null) {
TableItem tableItem = getItemToCheck(viewer, name);
if (tableItem != null) {
@@ -299,7 +301,7 @@
if (item != null) {
name = item.getText(0);
}
- getPreferences().setValue(Constants.JBPM_NAME, name);
+ plugin.getPluginPreferences().setValue(Constants.JBPM_NAME, name);
return true;
}
@@ -312,7 +314,7 @@
}
public void performDefaults() {
- getPreferences().setToDefault(Constants.JBPM_NAME);
+ plugin.getPluginPreferences().setToDefault(Constants.JBPM_NAME);
PreferencesManager inputManager =
(PreferencesManager)tableViewer.getInput();
inputManager.getJbpmInstallationMap().clear();
@@ -322,9 +324,5 @@
updateButtons();
setValid(true);
}
-
- private Preferences getPreferences() {
- return Activator.getDefault().getPluginPreferences();
- }
}
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/PreferencesManager.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/PreferencesManager.java 2009-05-30 01:34:31 UTC (rev 15612)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/PreferencesManager.java 2009-05-30 01:35:08 UTC (rev 15613)
@@ -31,21 +31,32 @@
import java.util.Iterator;
import java.util.Map;
+import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.XMLMemento;
-import org.jboss.tools.jbpm.Activator;
import org.jboss.tools.jbpm.Constants;
public class PreferencesManager {
- public static final PreferencesManager INSTANCE = new PreferencesManager();
+ private static Map<Plugin, PreferencesManager> managerMap = new HashMap<Plugin, PreferencesManager>();
private Map<String, JbpmInstallation> jbpmInstallations = null;
private File installationsFile = null;
+ private Plugin plugin;
+
+ public static PreferencesManager getPreferencesManager(Plugin key) {
+ PreferencesManager preferencesManager = managerMap.get(key);
+ if (preferencesManager == null) {
+ preferencesManager = new PreferencesManager(key);
+ managerMap.put(key, preferencesManager);
+ }
+ return preferencesManager;
+ }
- private PreferencesManager() {
+ private PreferencesManager(Plugin plugin) {
+ this.plugin = plugin;
initializeInstallations();
}
@@ -63,13 +74,13 @@
return jbpmInstallations;
}
- private static Preferences getPreferences() {
- return Activator.getDefault().getPluginPreferences();
+ private Preferences getPreferences() {
+ return plugin.getPluginPreferences();
}
private void initializeInstallations() {
installationsFile =
- Activator.getDefault().getStateLocation().append("jbpm-installations.xml").toFile();
+ plugin.getStateLocation().append("jbpm-installations.xml").toFile();
if (!installationsFile.exists()) {
createInstallationsFile();
} else {
15 years, 6 months
JBoss Tools SVN: r15612 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4: src/org/jboss/tools/flow/jpdl4 and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-05-29 21:34:31 -0400 (Fri, 29 May 2009)
New Revision: 15612
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskArgumentsSection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskFieldsSection.java
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/Activator.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/preferences/Jbpm4LocationsPage.java
Log:
- allow for configurations of jbpm 4 runtimes (GPD-346)
- fields and method arguments configuration pages
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-05-29 20:58:15 UTC (rev 15611)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-05-30 01:34:31 UTC (rev 15612)
@@ -315,6 +315,16 @@
category="general"
id="org.jboss.tools.jpdl4.subprocess"
label="Subprocess"/>
+ <propertyTab
+ afterTab="org.jboss.tools.jpdl4.general"
+ category="general"
+ id="org.jboss.tools.jpdl4.javaTask.fields"
+ label="Fields"/>
+ <propertyTab
+ afterTab="org.jboss.tools.jpdl4.javaTask.fields"
+ category="general"
+ id="org.jboss.tools.jpdl4.javaTask.arguments"
+ label="Arguments"/>
<!-- <propertyTab
afterTab="org.jboss.tools.jpdl4.general"
category="details"
@@ -561,6 +571,18 @@
tab="org.jboss.tools.jpdl4.general">
<input type="org.jboss.tools.flow.jpdl4.model.OutputParameter"/>
</propertySection>
+ <propertySection
+ class="org.jboss.tools.flow.jpdl4.properties.JavaTaskFieldsSection"
+ id="org.jboss.tools.jpdl4.javaTask.fields"
+ tab="org.jboss.tools.jpdl4.javaTask.fields">
+ <input type="org.jboss.tools.flow.jpdl4.model.JavaTask"/>
+ </propertySection>
+ <propertySection
+ class="org.jboss.tools.flow.jpdl4.properties.JavaTaskArgumentsSection"
+ id="org.jboss.tools.jpdl4.javaTask.arguments"
+ tab="org.jboss.tools.jpdl4.javaTask.arguments">
+ <input type="org.jboss.tools.flow.jpdl4.model.JavaTask"/>
+ </propertySection>
</propertySections>
</extension>
<extension
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/Activator.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/Activator.java 2009-05-29 20:58:15 UTC (rev 15611)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/Activator.java 2009-05-30 01:34:31 UTC (rev 15612)
@@ -17,6 +17,7 @@
*/
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.jboss.tools.jbpm.preferences.PreferencesManager;
import org.osgi.framework.BundleContext;
public class Activator extends AbstractUIPlugin {
@@ -27,6 +28,10 @@
public Activator() {
}
+
+ public PreferencesManager getPreferencesManager() {
+ return PreferencesManager.getPreferencesManager(this);
+ }
public void start(BundleContext context) throws Exception {
super.start(context);
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/preferences/Jbpm4LocationsPage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/preferences/Jbpm4LocationsPage.java 2009-05-29 20:58:15 UTC (rev 15611)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/preferences/Jbpm4LocationsPage.java 2009-05-30 01:34:31 UTC (rev 15612)
@@ -21,15 +21,24 @@
*/
package org.jboss.tools.flow.jpdl4.preferences;
+import org.eclipse.core.runtime.Path;
import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.flow.jpdl4.Activator;
import org.jboss.tools.jbpm.preferences.AddJbpmInstallationDialog;
import org.jboss.tools.jbpm.preferences.JbpmLocationsPage;
public class Jbpm4LocationsPage extends JbpmLocationsPage {
+ public Jbpm4LocationsPage() {
+ super(Activator.getDefault());
+ }
+
protected AddJbpmInstallationDialog createAddJbpmInstallationDialog(Shell shell) {
- return new AddJbpmInstallationDialog(getShell()) {
- public String getVersion() {
+ return new AddJbpmInstallationDialog(getShell(), Activator.getDefault()) {
+ protected boolean isValidJbpmInstallation() {
+ return new Path(getLocation()).append("/jbpm.jar").toFile().exists();
+ }
+ protected String getVersion() {
return "4.0";
}
};
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskArgumentsSection.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskArgumentsSection.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskArgumentsSection.java 2009-05-30 01:34:31 UTC (rev 15612)
@@ -0,0 +1,88 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+import org.jboss.tools.flow.common.properties.IPropertyId;
+
+public class JavaTaskArgumentsSection extends JpdlPropertySection implements IPropertyId {
+
+ private final static String NO_FIELDS = "The configured class has no fields that can be configured.";
+ private final static String CONFIGURE_FIELDS = "Configure the value of the supported fields as needed.";
+
+ private CLabel infoLabel;
+
+// private ModifyListener nameTextModifyListener = new ModifyListener() {
+// public void modifyText(ModifyEvent arg0) {
+// IPropertySource input = getInput();
+// if (input != null) {
+// RenameElementCommand rec = new RenameElementCommand();
+// rec.setSource(input);
+// rec.setOldName((String)input.getPropertyValue(NAME));
+// rec.setName(nameText.getText());
+// getCommandStack().execute(rec);
+// }
+// }
+// };
+//
+// private CommandStackListener commandStackListener = new CommandStackListener() {
+// public void commandStackChanged(EventObject event) {
+// refresh();
+// }
+// };
+//
+// public void dispose() {
+// if (getCommandStack() != null) {
+// getCommandStack().removeCommandStackListener(commandStackListener);
+// }
+// super.dispose();
+// }
+
+ public void createControls(Composite parent,
+ TabbedPropertySheetPage aTabbedPropertySheetPage) {
+ super.createControls(parent, aTabbedPropertySheetPage);
+ Composite composite = getFlatFormComposite();
+ createInfoLabel(composite);
+ createFieldsComposite(composite);
+ }
+
+
+ private void createInfoLabel(Composite parent) {
+ infoLabel = getWidgetFactory().createCLabel(parent, NO_FIELDS);
+ FormData data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(0, 5);
+ data.right = new FormAttachment(100, 0);
+ infoLabel.setLayoutData(data);
+ }
+
+ private void createFieldsComposite(Composite parent) {
+ Composite fieldsComposite = getWidgetFactory().createComposite(parent);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.left = new FormAttachment(JpdlPropertySection.SECOND_COLUMN_LEFT_LIMIT, 0);
+ data.right = new FormAttachment(100, 0);
+ fieldsComposite.setLayoutData(data);
+ }
+
+ protected void hookListeners() {
+// nameText.addModifyListener(nameTextModifyListener);
+ }
+
+ protected void unhookListeners() {
+// nameText.removeModifyListener(nameTextModifyListener);
+ }
+
+ protected void updateValues() {
+// IPropertySource input = getInput();
+// if (input != null) {
+// nameText.setText(getValueNotNull((String)input.getPropertyValue(NAME)));
+// } else {
+// nameText.setText("");
+// }
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskArgumentsSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskFieldsSection.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskFieldsSection.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskFieldsSection.java 2009-05-30 01:34:31 UTC (rev 15612)
@@ -0,0 +1,124 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gef.EditPart;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+import org.jboss.tools.flow.common.properties.IPropertyId;
+import org.jboss.tools.flow.common.wrapper.ModelEvent;
+import org.jboss.tools.flow.common.wrapper.ModelListener;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.model.JavaTask;
+
+public class JavaTaskFieldsSection extends JpdlPropertySection implements IPropertyId {
+
+ private final static String NO_FIELDS = "The configured class has no fields that can be configured.";
+ private final static String CONFIGURE_FIELDS = "Configure the value of the supported fields as needed.";
+
+ private Wrapper input;
+
+ private CLabel infoLabel;
+
+ private ModelListener modelListener = new ModelListener() {
+ public void modelChanged(ModelEvent event) {
+ System.out.println("changeDiscriminator; " + event.getChangeDiscriminator());
+ System.out.println("changeType " + event.getChangeType());
+ }
+
+ };
+
+// private ModifyListener nameTextModifyListener = new ModifyListener() {
+// public void modifyText(ModifyEvent arg0) {
+// IPropertySource input = getInput();
+// if (input != null) {
+// RenameElementCommand rec = new RenameElementCommand();
+// rec.setSource(input);
+// rec.setOldName((String)input.getPropertyValue(NAME));
+// rec.setName(nameText.getText());
+// getCommandStack().execute(rec);
+// }
+// }
+// };
+//
+// private CommandStackListener commandStackListener = new CommandStackListener() {
+// public void commandStackChanged(EventObject event) {
+// refresh();
+// }
+// };
+//
+ public void dispose() {
+ if (input != null) {
+ input.removeListener(modelListener);
+ }
+ super.dispose();
+ }
+
+ public void createControls(Composite parent,
+ TabbedPropertySheetPage aTabbedPropertySheetPage) {
+ super.createControls(parent, aTabbedPropertySheetPage);
+ Composite composite = getFlatFormComposite();
+ createInfoLabel(composite);
+ createFieldsComposite(composite);
+ }
+
+
+ private void createInfoLabel(Composite parent) {
+ infoLabel = getWidgetFactory().createCLabel(parent, NO_FIELDS);
+ FormData data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(0, 5);
+ data.right = new FormAttachment(100, 0);
+ infoLabel.setLayoutData(data);
+ }
+
+ private void createFieldsComposite(Composite parent) {
+ Composite fieldsComposite = getWidgetFactory().createComposite(parent);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.left = new FormAttachment(JpdlPropertySection.SECOND_COLUMN_LEFT_LIMIT, 0);
+ data.right = new FormAttachment(100, 0);
+ fieldsComposite.setLayoutData(data);
+ }
+
+ public void setInput(IWorkbenchPart part, ISelection selection) {
+ if (input != null) {
+ input.removeListener(modelListener);
+ }
+ super.setInput(part, selection);
+ if (selection instanceof IStructuredSelection) {
+ Object object = ((IStructuredSelection)selection).getFirstElement();
+ if (object instanceof EditPart && ((EditPart)object).getModel() instanceof Wrapper) {
+ input = (Wrapper)((EditPart)object).getModel();
+ input.addListener(modelListener);
+ return;
+ }
+ }
+ input = null;
+ }
+
+ protected void hookListeners() {
+// nameText.addModifyListener(nameTextModifyListener);
+ }
+
+ protected void unhookListeners() {
+// nameText.removeModifyListener(nameTextModifyListener);
+ }
+
+ protected void updateValues() {
+// IPropertySource input = getInput();
+// if (input != null) {
+// nameText.setText(getValueNotNull((String)input.getPropertyValue(NAME)));
+// } else {
+// nameText.setText("");
+// }
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskFieldsSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 6 months
JBoss Tools SVN: r15611 - trunk/jmx/releng.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-05-29 16:58:15 -0400 (Fri, 29 May 2009)
New Revision: 15611
Modified:
trunk/jmx/releng/
Log:
Property changes on: trunk/jmx/releng
___________________________________________________________________
Name: svn:ignore
+ buildlog.latest.txt
15 years, 6 months