JBoss Tools SVN: r15367 - in trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/components: text and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2009-05-20 11:52:00 -0400 (Wed, 20 May 2009)
New Revision: 15367
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/components/other/xmp.xhtml.xml
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/components/text/pre.html.xml
Log:
RESOLVED - issue JBIDE-4225: 3 tests fail in HtmlAllTests (testJBIDE3280, testPre)
https://jira.jboss.org/jira/browse/JBIDE-4225
- testPre and testPre are fixed
Modified: trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/components/other/xmp.xhtml.xml
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/components/other/xmp.xhtml.xml 2009-05-20 15:48:31 UTC (rev 15366)
+++ trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/components/other/xmp.xhtml.xml 2009-05-20 15:52:00 UTC (rev 15367)
@@ -1,48 +1,27 @@
<tests>
<test id="xmp">
<XMP ID="xmp" STYLE="-moz-user-modify: read-only;" >
-<SPAN><BR _MOZ_DIRTY=""/>
-
-while (<>) {<BR _MOZ_DIRTY=""/>
-
-$org=$_;<BR _MOZ_DIRTY=""/>
-
-s/\\["']//g;<BR _MOZ_DIRTY=""/>
-
-s/\/\/[^:].*//;<BR _MOZ_DIRTY=""/>
-
-s/\/\*.*\*\///g;<BR _MOZ_DIRTY=""/>
-
-if ($comment == 1) {<BR _MOZ_DIRTY=""/>
-
-if (s/.*\*\///) {<BR _MOZ_DIRTY=""/>
-
-$comment = 0;<BR _MOZ_DIRTY=""/>
-
-}<BR _MOZ_DIRTY=""/>
-
-else {<BR _MOZ_DIRTY=""/>
-
-next;<BR _MOZ_DIRTY=""/>
-
-}<BR _MOZ_DIRTY=""/>
-
-}<BR _MOZ_DIRTY=""/>
-
-if (s/\/\*.*//) {<BR _MOZ_DIRTY=""/>
-
-$comment = 1;<BR _MOZ_DIRTY=""/>
-
-}<BR _MOZ_DIRTY=""/>
-
-if (/^\s*#/) {<BR _MOZ_DIRTY=""/>
-
-next;<BR _MOZ_DIRTY=""/>
-
-}<BR _MOZ_DIRTY=""/>
-
-}<BR _MOZ_DIRTY=""/>
-
+<SPAN>
+while (<>) {
+ $org=$_;
+ s/\\["']//g;
+ s/\/\/[^:].*//;
+ s/\/\*.*\*\///g;
+ if ($comment == 1) {
+ if (s/.*\*\///) {
+ $comment = 0;
+ }
+ else {
+ next;
+ }
+ }
+ if (s/\/\*.*//) {
+ $comment = 1;
+ }
+ if (/^\s*#/) {
+ next;
+ }
+ }
</SPAN>
</XMP>
</test>
Modified: trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/components/text/pre.html.xml
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/components/text/pre.html.xml 2009-05-20 15:48:31 UTC (rev 15366)
+++ trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/components/text/pre.html.xml 2009-05-20 15:52:00 UTC (rev 15367)
@@ -2,16 +2,10 @@
<test id="pre">
<PRE WIDTH="30" ID="pre" CLASS="preClass"
STYLE="color: red; -moz-user-modify: read-write;">
- <SPAN CLASS="vpe-text">
- <BR _MOZ_DIRTY="" />
-
- string 1
- <BR _MOZ_DIRTY="" />
-
- string 2
- <BR _MOZ_DIRTY="" />
-
- </SPAN>
+<SPAN CLASS="vpe-text">
+string 1
+ string 2
+</SPAN>
</PRE>
</test>
</tests>
\ No newline at end of file
15 years, 5 months
JBoss Tools SVN: r15366 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb: internal and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-20 11:48:31 -0400 (Wed, 20 May 2009)
New Revision: 15366
Added:
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/taglib/TLDAttribute.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDTag.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.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/KbXMLStoreConstants.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ClassPathMonitor.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/TLDLibrary.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/KbProjectFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java 2009-05-20 15:01:44 UTC (rev 15365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java 2009-05-20 15:48:31 UTC (rev 15366)
@@ -17,12 +17,12 @@
public class KbProjectFactory {
/**
- * Factory method creating seam project instance by project resource.
+ * Factory method creating kb project instance by project resource.
* Returns null if
* (1) project does not exist
* (2) project is closed
- * (3) project has no seam nature
- * (4) creating seam project failed.
+ * (3) project has no kb nature
+ * (4) creating kb project failed.
* @param project
* @param resolve if true and results of last build have not been resolved they are loaded.
* @return
Added: 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 (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbObject.java 2009-05-20 15:48:31 UTC (rev 15366)
@@ -0,0 +1,236 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import java.util.Properties;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+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.common.xml.XMLUtilities;
+import org.jboss.tools.jst.web.kb.IKbProject;
+import org.jboss.tools.jst.web.model.project.ext.store.XMLStoreHelper;
+import org.w3c.dom.Element;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class KbObject {
+ /**
+ * Object that allows to identify this object.
+ */
+ protected Object id;
+
+ /**
+ * Path of resource where this object is declared.
+ */
+ protected IPath source;
+
+ /**
+ * Resource where this object is declared.
+ */
+ protected IResource resource = null;
+
+ /**
+ * Parent kb object in the kb model.
+ */
+ protected KbObject parent;
+
+ //locations of xml attributes
+ protected Map<String,IValueInfo> attributesInfo = new HashMap<String, IValueInfo>();
+
+ public KbObject() {}
+
+ public IKbProject getKbProject() {
+ return parent == null ? null : parent.getKbProject();
+ }
+
+ public Object getId() {
+ return id;
+ }
+
+ /**
+ * Sets id for this object.
+ * For most objects it is object of Java or XML model
+ * from which this object is loaded.
+ */
+ public void setId(Object id) {
+ this.id = id;
+ }
+
+ /**
+ * Sets path of resource that declares this object.
+ */
+ public void setSourcePath(IPath path) {
+ source = path;
+ }
+
+ /**
+ * Returns path of resource that declares this object.
+ * @return
+ */
+ public IPath getSourcePath() {
+ if(source == null && parent != null) return parent.getSourcePath();
+ return source;
+ }
+
+ public IResource getResource() {
+ if(resource != null) return resource;
+ if(source != null) {
+ resource = ResourcesPlugin.getWorkspace().getRoot().getFile(source);
+ }
+ if(resource == null && parent != null) {
+ return parent.getResource();
+ }
+ return resource;
+ }
+
+ /**
+ * Returns parent object of kb model.
+ * @return
+ */
+ public KbObject getParent() {
+ return parent;
+ }
+
+ public void setParent(KbObject parent) {
+ this.parent = parent;
+ }
+
+ protected void adopt(KbObject child) {
+ if(child.getKbProject() != null && child.getKbProject() != getKbProject()) return;
+ ((KbObject)child).setParent(this);
+ }
+
+
+ /**
+ * Merges loaded object into current object.
+ * If changes were done returns a list of changes.
+ * If there are no changes, null is returned,
+ * which prevents creating a lot of unnecessary objects.
+ * @param f
+ * @return list of changes
+ */
+ public List<Change> merge(KbObject s) {
+ KbObject o = (KbObject)s;
+ source = o.source;
+ id = o.id;
+ resource = o.resource;
+ //If there are no changes, null is returned,
+ //which prevents creating a lot of unnecessary objects.
+ //Subclasses and clients must check returned
+ //value for null, before using it.
+ o.attributesInfo = new HashMap<String, IValueInfo>();
+ o.attributesInfo.putAll(attributesInfo);
+ return null;
+ }
+
+ public KbObject clone() throws CloneNotSupportedException {
+ KbObject c = (KbObject)super.clone();
+ c.parent = null;
+ //do not copy parent
+ return c;
+ }
+
+ //Serializing to XML
+
+ public String getXMLName() {
+ return "object";
+ }
+
+ public String getXMLClass() {
+ return null;
+ }
+
+ public Element toXML(Element parent, Properties context) {
+ Element element = XMLUtilities.createElement(parent, getXMLName());
+ if(getXMLClass() != null) {
+ element.setAttribute(XMLStoreConstants.ATTR_CLASS, getXMLClass());
+ }
+ if(source != null && !source.equals(context.get(XMLStoreConstants.ATTR_PATH))) {
+ element.setAttribute(XMLStoreConstants.ATTR_PATH, source.toString());
+ }
+ if(id != null) {
+ if(id instanceof String) {
+ Element eid = XMLUtilities.createElement(element, XMLStoreConstants.TAG_ID);
+ eid.setAttribute(XMLStoreConstants.ATTR_CLASS, XMLStoreConstants.CLS_STRING);
+ eid.setAttribute(XMLStoreConstants.ATTR_VALUE, id.toString());
+ } else if(id instanceof XModelObject) {
+ XModelObject o = (XModelObject)id;
+ XMLStoreHelper.saveModelObject(element, o, XMLStoreConstants.TAG_ID, context);
+ } else {
+ //TODO consider other kinds of id
+ }
+ }
+ XModelObject old = pushModelObject(context);
+ XMLStoreHelper.saveMap(element, attributesInfo, "attributes", context);
+ popModelObject(context, old);
+ return element;
+ }
+
+ public void loadXML(Element element, Properties context) {
+ String s = element.getAttribute(XMLStoreConstants.ATTR_PATH);
+ if(s != null && s.length() > 0) {
+ source = new Path(s);
+ } else {
+ source = (IPath)context.get(XMLStoreConstants.ATTR_PATH);
+ }
+ Element e_id = XMLUtilities.getUniqueChild(element, XMLStoreConstants.TAG_ID);
+ if(e_id != null) {
+ String cls = e_id.getAttribute(XMLStoreConstants.ATTR_CLASS);
+ if(XMLStoreConstants.CLS_STRING.equals(cls)) {
+ id = e_id.getAttribute("string");
+ } else if(XMLStoreConstants.CLS_MODEL_OBJECT.equals(cls)) {
+ id = XMLStoreHelper.loadModelObject(e_id, context);
+ } else {
+ //TODO consider other kinds of id
+ }
+ }
+ XModelObject old = pushModelObject(context);
+ XMLStoreHelper.loadMap(element, attributesInfo, "attributes", context);
+ popModelObject(context, old);
+ }
+
+ protected XModelObject pushModelObject(Properties context) {
+ XModelObject old = (XModelObject)context.get(XMLStoreConstants.KEY_MODEL_OBJECT);
+
+ if(id instanceof XModelObject) {
+ context.put(XMLStoreConstants.KEY_MODEL_OBJECT, id);
+ }
+
+ return old;
+ }
+
+ protected void popModelObject(Properties context, XModelObject old) {
+ if(old != null) {
+ context.put(XMLStoreConstants.KEY_MODEL_OBJECT, old);
+ } else {
+ context.remove(XMLStoreConstants.KEY_MODEL_OBJECT);
+ }
+ }
+
+ protected boolean stringsEqual(String s1, String s2) {
+ return s1 == null ? s2 == null : s1.equals(s2);
+ }
+
+ public Object getAdapter(Class cls) {
+ return null;
+ }
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbObject.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/KbProject.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2009-05-20 15:01:44 UTC (rev 15365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2009-05-20 15:48:31 UTC (rev 15366)
@@ -15,6 +15,7 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -49,12 +50,12 @@
* @author V.Kabanovich
*
*/
-public class KbProject implements IKbProject {
+public class KbProject extends KbObject implements IKbProject {
IProject project;
ClassPathMonitor classPath = new ClassPathMonitor(this);
- Set<IPath> sourcePaths = new HashSet<IPath>();
+// Set<IPath> sourcePaths = new HashSet<IPath>();
Map<IPath, LoadedDeclarations> sourcePaths2 = new HashMap<IPath, LoadedDeclarations>();
@@ -67,7 +68,7 @@
LibraryStorage libraries = new LibraryStorage();
public ITagLibrary[] getTagLibraries() {
- return libraries.getAllFactoriesArray();
+ return libraries.getAllLibrariesArray();
}
public void configure() throws CoreException {
@@ -82,12 +83,14 @@
return project;
}
- public IPath getSourcePath() {
- return project == null ? null : project.getFullPath();
+ public IKbProject getKbProject() {
+ return this;
}
public void setProject(IProject project) {
this.project = project;
+ setSourcePath(project.getFullPath());
+ resource = project;
classPath.init();
}
@@ -95,10 +98,10 @@
*
* @param p
*/
- public void addSeamProject(KbProject p) {
+ public void addKbProject(KbProject p) {
if(dependsOn.contains(p)) return;
dependsOn.add(p);
- p.addDependentSeamProject(this);
+ p.addDependentKbProject(this);
if(!p.isStorageResolved) {
p.resolve();
} else {
@@ -119,7 +122,7 @@
*
* @return
*/
- public Set<KbProject> getSeamProjects() {
+ public Set<KbProject> getKbProjects() {
return dependsOn;
}
@@ -127,7 +130,7 @@
*
* @param p
*/
- public void addDependentSeamProject(KbProject p) {
+ public void addDependentKbProject(KbProject p) {
usedBy.add(p);
}
@@ -135,7 +138,7 @@
*
* @param p
*/
- public void removeSeamProject(KbProject p) {
+ public void removeKbProject(KbProject p) {
if(!dependsOn.contains(p)) return;
p.usedBy.remove(this);
dependsOn.remove(p);
@@ -233,11 +236,11 @@
/**
- * Method testing how long it takes to load Seam model
+ * Method testing how long it takes to load Kb model
* serialized previously.
* This approach makes sure, that all other services
* (JDT, XModel, etc) are already loaded at first start of
- * Seam model, so that now it is more or less pure time
+ * Kb model, so that now it is more or less pure time
* to be computed.
*
* @return
@@ -245,7 +248,7 @@
public long reload() {
statistics = new ArrayList<Long>();
classPath = new ClassPathMonitor(this);
- sourcePaths.clear();
+// sourcePaths.clear();
sourcePaths2.clear();
isStorageResolved = false;
dependsOn.clear();
@@ -270,10 +273,9 @@
File file = getStorageFile();
file.getParentFile().mkdirs();
- Element root = XMLUtilities.createDocumentElement("seam-project"); //$NON-NLS-1$
+ Element root = XMLUtilities.createDocumentElement("kb-project"); //$NON-NLS-1$
storeProjectDependencies(root);
-// storeSourcePaths(root);
storeSourcePaths2(root);
XMLUtilities.serialize(root, file.getAbsolutePath());
@@ -308,7 +310,7 @@
KbProject sp = (KbProject)KbProjectFactory.getKbProject(project, false);
if(sp != null) {
dependsOn.add(sp);
- sp.addDependentSeamProject(this);
+ sp.addDependentKbProject(this);
}
}
}
@@ -330,7 +332,7 @@
private void loadSourcePaths2(Element root) {
Properties context = new Properties();
- context.put("seamProject", this);
+ context.put("kbProject", this);
Element sourcePathsElement = XMLUtilities.getUniqueChild(root, "paths"); //$NON-NLS-1$
if(sourcePathsElement == null) return;
Element[] paths = XMLUtilities.getChildren(sourcePathsElement, "path"); //$NON-NLS-1$
@@ -503,9 +505,70 @@
* @param source
*/
public void registerComponents(LoadedDeclarations ds, IPath source) {
+ ITagLibrary[] libraries = ds.getLibraries().toArray(new ITagLibrary[0]);
+
+ if(libraries.length == 0) {
+ pathRemoved(source);
+ if(EclipseResourceUtil.isJar(source.toString())) {
+// if(!sourcePaths.contains(source)) sourcePaths.add(source);
+ sourcePaths2.put(source, ds);
+ }
+ return;
+ }
+ sourcePaths2.put(source, ds);
+
+ Map<Object,ITagLibrary> currentLibraries = findLibraryDeclarations(source);
+ List<Change> addedLibraries = null;
+
+ for (ITagLibrary library: libraries) {
+ AbstractTagLib loaded = (AbstractTagLib)library;
+ AbstractTagLib current = (AbstractTagLib)currentLibraries.remove(loaded.getId());
+ if(current != null && current.getClass() != loaded.getClass()) {
+ this.libraries.removeLibrary((ITagLibrary)current);
+ current = null;
+ }
+ if(current != null) {
+ List<Change> changes = current.merge(loaded);
+ fireChanges(changes);
+ continue;
+ }
+ if(((KbObject)library).getParent() == null) {
+ adopt((KbObject)library);
+ }
+ this.libraries.addLibrary(library);
+ addedLibraries = Change.addChange(addedLibraries, new Change(this, null, null, loaded));
+ }
+ fireChanges(addedLibraries);
+
+ libraryDeclarationsRemoved(currentLibraries);
//TODO
+ try {
+ registerComponentsInDependentProjects(ds, source);
+ } catch (CloneNotSupportedException e) {
+ WebModelPlugin.getPluginLog().logError(e);
+ }
}
+ /**
+ *
+ * @param ds
+ * @param source
+ * @throws CloneNotSupportedException
+ */
+ public void registerComponentsInDependentProjects(LoadedDeclarations ds, IPath source) throws CloneNotSupportedException {
+ if(usedBy.isEmpty()) return;
+ if(EclipseResourceUtil.isJar(source.toString())) return;
+
+ for (KbProject p : usedBy) {
+ p.resolve();
+ LoadedDeclarations ds1 = new LoadedDeclarations();
+ for (ITagLibrary f : ds.getLibraries()) {
+ ds1.getLibraries().add(f.clone());
+ }
+ p.registerComponents(ds1, source);
+ }
+ }
+
public boolean isPathLoaded(IPath source) {
return sourcePaths2.containsKey(source);
}
@@ -516,12 +579,10 @@
* @param source
*/
public void pathRemoved(IPath source) {
- if(!sourcePaths.contains(source) && !sourcePaths2.containsKey(source)) return;
- sourcePaths.remove(source);
+ if(!sourcePaths2.containsKey(source)) return;
sourcePaths2.remove(source);
List<Change> changes = null;
- //TODO
Set<ITagLibrary> ls = libraries.removePath(source);
if(ls != null) for (ITagLibrary l: ls) {
@@ -529,9 +590,50 @@
}
fireChanges(changes);
-// firePathRemovedToDependentProjects(source);
+ firePathRemovedToDependentProjects(source);
}
+ public void firePathRemovedToDependentProjects(IPath source) {
+ if(usedBy.isEmpty()) return;
+ if(EclipseResourceUtil.isJar(source.toString())) return;
+
+ for (KbProject p : usedBy) {
+ p.resolve();
+ p.pathRemoved(source);
+ }
+ }
+
+ /**
+ *
+ * @param source
+ * @return
+ */
+ public Map<Object,ITagLibrary> findLibraryDeclarations(IPath source) {
+ Map<Object,ITagLibrary> map = new HashMap<Object, ITagLibrary>();
+ Set<ITagLibrary> fs = libraries.getLibrariesBySource(source);
+ if(fs != null) for (ITagLibrary c: fs) {
+ KbObject ci = (KbObject)c;
+ map.put(ci.getId(), c);
+ }
+ return map;
+ }
+
+ /**
+ *
+ * @param removed
+ */
+ void libraryDeclarationsRemoved(Map<Object,ITagLibrary> removed) {
+ if(removed == null || removed.isEmpty()) return;
+ Iterator<ITagLibrary> iterator = removed.values().iterator();
+ List<Change> changes = null;
+ while(iterator.hasNext()) {
+ ITagLibrary c = iterator.next();
+ libraries.removeLibrary(c);
+ changes = Change.addChange(changes, new Change(this, null, c, null));
+ }
+ fireChanges(changes);
+ }
+
List<Change> postponedChanges = null;
public void postponeFiring() {
@@ -559,77 +661,78 @@
}
//TODO
}
+
class LibraryStorage {
- private Set<ITagLibrary> allFactories = new HashSet<ITagLibrary>();
- private ITagLibrary[] allFactoriesArray = null;
- Map<IPath, Set<ITagLibrary>> factoriesBySource = new HashMap<IPath, Set<ITagLibrary>>();
+ private Set<ITagLibrary> allLibraries = new HashSet<ITagLibrary>();
+ private ITagLibrary[] allLibrariesArray = null;
+ Map<IPath, Set<ITagLibrary>> librariesBySource = new HashMap<IPath, Set<ITagLibrary>>();
public void clear() {
- synchronized(allFactories) {
- allFactories.clear();
- allFactoriesArray = null;
+ synchronized(allLibraries) {
+ allLibraries.clear();
+ allLibrariesArray = null;
}
- factoriesBySource.clear();
+ librariesBySource.clear();
}
- public ITagLibrary[] getAllFactoriesArray() {
- ITagLibrary[] result = allFactoriesArray;
+ public ITagLibrary[] getAllLibrariesArray() {
+ ITagLibrary[] result = allLibrariesArray;
if(result == null) {
- synchronized(allFactories) {
- allFactoriesArray = allFactories.toArray(new ITagLibrary[0]);
- result = allFactoriesArray;
+ synchronized(allLibraries) {
+ allLibrariesArray = allLibraries.toArray(new ITagLibrary[0]);
+ result = allLibrariesArray;
}
}
return result;
}
- public Set<ITagLibrary> getFactoriesBySource(IPath path) {
- return factoriesBySource.get(path);
+ public Set<ITagLibrary> getLibrariesBySource(IPath path) {
+ return librariesBySource.get(path);
}
- public void addFactory(ITagLibrary f) {
- synchronized(allFactories) {
- allFactories.add(f);
- allFactoriesArray = null;
+ public void addLibrary(ITagLibrary f) {
+ synchronized(allLibraries) {
+ allLibraries.add(f);
+ allLibrariesArray = null;
}
IPath path = f.getSourcePath();
if(path != null) {
- Set<ITagLibrary> fs = factoriesBySource.get(path);
+ Set<ITagLibrary> fs = librariesBySource.get(path);
if(fs == null) {
fs = new HashSet<ITagLibrary>();
- factoriesBySource.put(path, fs);
+ librariesBySource.put(path, fs);
}
fs.add(f);
}
}
- public void removeFactory(ITagLibrary f) {
- synchronized(allFactories) {
- allFactories.remove(f);
- allFactoriesArray = null;
+ public void removeLibrary(ITagLibrary f) {
+ synchronized(allLibraries) {
+ allLibraries.remove(f);
+ allLibrariesArray = null;
}
IPath path = f.getSourcePath();
if(path != null) {
- Set<ITagLibrary> fs = factoriesBySource.get(path);
+ Set<ITagLibrary> fs = librariesBySource.get(path);
if(fs != null) {
fs.remove(f);
}
if(fs.isEmpty()) {
- factoriesBySource.remove(fs);
+ librariesBySource.remove(fs);
}
}
}
public Set<ITagLibrary> removePath(IPath path) {
- Set<ITagLibrary> fs = factoriesBySource.get(path);
+ Set<ITagLibrary> fs = librariesBySource.get(path);
if(fs == null) return null;
for (ITagLibrary f: fs) {
- synchronized(allFactories) {
- allFactories.remove(f);
- allFactoriesArray = null;
+ synchronized(allLibraries) {
+ allLibraries.remove(f);
+ allLibrariesArray = null;
}
}
- factoriesBySource.remove(path);
+ librariesBySource.remove(path);
return fs;
}
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-20 15:01:44 UTC (rev 15365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbXMLStoreConstants.java 2009-05-20 15:48:31 UTC (rev 15366)
@@ -19,6 +19,7 @@
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 CLS_TLD_LIBRARY = "tld"; //$NON-NLS-1$
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ClassPathMonitor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ClassPathMonitor.java 2009-05-20 15:01:44 UTC (rev 15365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ClassPathMonitor.java 2009-05-20 15:48:31 UTC (rev 15366)
@@ -40,7 +40,7 @@
import org.jboss.tools.jst.web.model.helpers.InnerModelHelper;
/**
- * Monitors class path of project and loads seam components of it.
+ * Monitors class path of project and loads kb components of it.
*
* @author Viacheslav Kabanovich
*/
@@ -54,7 +54,7 @@
Set<String> processedPaths = new HashSet<String>();
/**
- * Creates instance of class path for seam project
+ * Creates instance of class path for kb project
* @param project
*/
public ClassPathMonitor(KbProject project) {
@@ -62,7 +62,7 @@
}
/**
- * Returns seam project
+ * Returns kb project
* @return
*/
public KbProject getProject() {
@@ -158,7 +158,7 @@
}
/**
- * Loads seam components from items recently added to class path.
+ * Loads kb components from items recently added to class path.
*/
public void process() {
Iterator<String> it = processedPaths.iterator();
@@ -204,21 +204,21 @@
List<KbProject> ps = null;
try {
- ps = getSeamProjects(project.getProject());
+ ps = getKbProjects(project.getProject());
} catch (CoreException e) {
WebModelPlugin.getPluginLog().logError(e);
}
if(ps != null) {
- Set<KbProject> set = project.getSeamProjects();
+ Set<KbProject> set = project.getKbProjects();
Set<KbProject> removable = new HashSet<KbProject>();
removable.addAll(set);
removable.removeAll(ps);
ps.removeAll(set);
for (KbProject p : ps) {
- project.addSeamProject(p);
+ project.addKbProject(p);
}
for (KbProject p : removable) {
- project.removeSeamProject(p);
+ project.removeKbProject(p);
}
}
}
@@ -227,12 +227,12 @@
List<KbProject> ps = null;
try {
- ps = getSeamProjects(project.getProject());
+ ps = getKbProjects(project.getProject());
} catch (CoreException e) {
WebModelPlugin.getPluginLog().logError(e);
}
if(ps != null) {
- Set<KbProject> set = project.getSeamProjects();
+ Set<KbProject> set = project.getKbProjects();
Set<KbProject> removable = new HashSet<KbProject>();
removable.addAll(set);
removable.removeAll(ps);
@@ -252,7 +252,7 @@
project.registerComponents(c, path);
}
- List<KbProject> getSeamProjects(IProject project) throws CoreException {
+ List<KbProject> getKbProjects(IProject project) throws CoreException {
List<KbProject> list = new ArrayList<KbProject>();
IJavaProject javaProject = JavaCore.create(project);
IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
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-20 15:01:44 UTC (rev 15365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java 2009-05-20 15:48:31 UTC (rev 15366)
@@ -29,12 +29,17 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.impl.FolderImpl;
import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.project.ext.store.XMLStoreConstants;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.NamespaceMapping;
import org.jboss.tools.jst.web.kb.IKbProject;
+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.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.model.helpers.InnerModelHelper;
import org.jboss.tools.jst.web.model.project.ext.store.XMLValueInfo;
@@ -124,48 +129,51 @@
private void parseTLD(XModelObject o, IPath source, IKbProject sp, LoadedDeclarations ds) {
TLDLibrary library = new TLDLibrary();
- library.setURI(new XMLValueInfo(o, "uri"));
- library.setDisplayName(new XMLValueInfo(o, "display-name"));
+ library.setId(o);
+ library.setURI(new XMLValueInfo(o, AbstractTagLib.URI));
+ library.setDisplayName(new XMLValueInfo(o, TLDLibrary.DISPLAY_NAME));
library.setShortName(new XMLValueInfo(o, "shortname"));
- String version = o.getAttributeValue("version");
+ String version = o.getAttributeValue(TLDLibrary.VERSION);
if(version == null) {
if("FileTLD_1_2".equals(o.getModelEntity().getName())) {
version = "1.2";
} else {
version = "1.1";
}
+ library.setVersion(version);
+ } else {
+ library.setVersion(new XMLValueInfo(o, TLDLibrary.VERSION));
}
- library.setVersion(version);
ds.getLibraries().add(library);
XModelObject[] ts = o.getChildren();
for (XModelObject t: ts) {
if(t.getModelEntity().getName().startsWith("TLDTag")) {
- AbstractComponent tag = new AbstractComponent() {}; //TODO
+ AbstractComponent tag = new TLDTag();
+ tag.setId(t);
- String name = t.getAttributeValue("name");
- tag.setName(name);
-
- String description = t.getAttributeValue("description");
- if(description != null) {
- //in version 1.1 this attribute is not available
- tag.setDescription(description);
- }
-
- String cls = t.getAttributeValue("tagclass");
- tag.setComponentClass(cls);
-
- String bodycontent = t.getAttributeValue("bodycontent");
- boolean canHaveBody = !"empty".equals(bodycontent);
- tag.setCanHaveBody(canHaveBody);
-
+ tag.setName(new XMLValueInfo(t, XMLStoreConstants.ATTR_NAME));
+ tag.setDescription(new XMLValueInfo(t, AbstractComponent.DESCRIPTION));
+ tag.setComponentClass(new XMLValueInfo(t, "tagclass"));
+ tag.setCanHaveBody(new XMLValueInfo(t, "bodycontent"));
//TODO
+// tag.setComponentType(componentType);
XModelObject[] as = t.getChildren();
for(XModelObject a: as) {
- //TODO
+ if(a.getModelEntity().getName().startsWith("TLDAttribute")) {
+ AbstractAttribute attr = new TLDAttribute();
+ attr.setId(a);
+ attr.setName(new XMLValueInfo(a, XMLStoreConstants.ATTR_NAME));
+ attr.setDescription(new XMLValueInfo(a, AbstractComponent.DESCRIPTION));
+ attr.setRequired(new XMLValueInfo(a, AbstractAttribute.REQUIRED));
+
+ tag.addAttribute(attr);
+ }
}
+
+ library.addComponent(tag);
}
}
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-20 15:01:44 UTC (rev 15365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java 2009-05-20 15:48:31 UTC (rev 15366)
@@ -12,22 +12,29 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Properties;
import org.jboss.tools.common.el.core.resolver.ELResolver;
+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.common.text.TextProposal;
import org.jboss.tools.jst.web.kb.IPageContext;
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.IAttribute;
+import org.w3c.dom.Element;
/**
* Abstract implementation of IAttribute
* @author Alexey Kazakov
*/
-public abstract class AbstractAttribute implements IAttribute {
+public abstract class AbstractAttribute extends KbObject implements IAttribute {
+ public static final String REQUIRED = "required";
protected String description;
protected String name;
- protected boolean preferable;
protected boolean required;
/* (non-Javadoc)
@@ -44,6 +51,11 @@
this.description = description;
}
+ public void setDescription(IValueInfo s) {
+ description = s == null ? null : s.getValue();
+ attributesInfo.put(AbstractComponent.DESCRIPTION, s);
+ }
+
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.taglib.IAttribute#getName()
*/
@@ -58,20 +70,18 @@
this.name = name;
}
+ public void setName(IValueInfo s) {
+ name = s == null ? null : s.getValue();
+ attributesInfo.put(XMLStoreConstants.ATTR_NAME, s);
+ }
+
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.taglib.IAttribute#isPreferable()
*/
public boolean isPreferable() {
- return preferable;
+ return isRequired();
}
- /**
- * @param preferable the preferable to set
- */
- public void setPreferable(boolean preferable) {
- this.preferable = preferable;
- }
-
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.taglib.IAttribute#isRequired()
*/
@@ -86,6 +96,11 @@
this.required = required;
}
+ public void setRequired(IValueInfo s) {
+ required = s != null && "true".equals(s.getValue());
+ attributesInfo.put(REQUIRED, s);
+ }
+
/* (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)
*/
@@ -97,4 +112,52 @@
}
return proposals.toArray(new TextProposal[proposals.size()]);
}
+
+ public List<Change> merge(KbObject s) {
+ List<Change> changes = super.merge(s);
+
+ AbstractAttribute a = (AbstractAttribute)s;
+ if(!stringsEqual(name, a.name)) {
+ changes = Change.addChange(changes, new Change(this, XMLStoreConstants.ATTR_NAME, name, a.name));
+ name = a.name;
+ }
+ if(!stringsEqual(description, a.description)) {
+ changes = Change.addChange(changes, new Change(this, AbstractComponent.DESCRIPTION, description, a.description));
+ description = a.description;
+ }
+ if(required != a.required) {
+ changes = Change.addChange(changes, new Change(this, REQUIRED, "" + required, "" + a.required));
+ required = a.required;
+ }
+
+ return changes;
+ }
+
+ public String getXMLName() {
+ return KbXMLStoreConstants.TAG_ATTRIBUTE;
+ }
+
+ 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);
+
+ 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
+ }
+
}
\ No newline at end of file
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-20 15:01:44 UTC (rev 15365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java 2009-05-20 15:48:31 UTC (rev 15366)
@@ -16,11 +16,14 @@
import java.util.Map;
import java.util.Properties;
+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.common.text.TextProposal;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.jst.web.kb.IPageContext;
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.IAttribute;
import org.jboss.tools.jst.web.kb.taglib.IComponent;
@@ -31,7 +34,11 @@
* Abstract implementation of IComponent
* @author Alexey Kazakov
*/
-public abstract class AbstractComponent implements IComponent {
+public abstract class AbstractComponent extends KbObject implements IComponent {
+ public static final String DESCRIPTION = "description";
+ public static final String COMPONENT_CLASS = "component-class";
+ public static final String COMPONENT_TYPE = "component-type";
+ public static final String BODY_CONTENT = "bodycontent";
protected boolean canHaveBody;
protected String componentClass;
@@ -56,6 +63,11 @@
this.canHaveBody = canHaveBody;
}
+ public void setCanHaveBody(IValueInfo s) {
+ canHaveBody = s == null || "empty".equals(s.getValue());
+ attributesInfo.put(BODY_CONTENT, s);
+ }
+
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.taglib.IComponent#getAttribute(java.lang.String)
*/
@@ -121,6 +133,11 @@
this.componentClass = componentClass;
}
+ public void setComponentClass(IValueInfo s) {
+ componentClass = s == null ? null : s.getValue();
+ attributesInfo.put(COMPONENT_CLASS, s);
+ }
+
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.taglib.IComponent#getComponentType()
*/
@@ -149,6 +166,11 @@
this.description = description;
}
+ public void setDescription(IValueInfo s) {
+ description = s == null ? null : s.getValue();
+ attributesInfo.put(DESCRIPTION, s);
+ }
+
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.taglib.IComponent#getName()
*/
@@ -163,6 +185,11 @@
this.name = name;
}
+ public void setName(IValueInfo s) {
+ name = s == null ? null : s.getValue();
+ attributesInfo.put(XMLStoreConstants.ATTR_NAME, s);
+ }
+
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.taglib.IComponent#getPreferableAttributes()
*/
@@ -211,6 +238,7 @@
* @param attribute
*/
public void addAttribute(IAttribute attribute) {
+ adopt((KbObject)attribute);
attributes.put(attribute.getName(), attribute);
if(attribute.isPreferable()) {
preferableAttributes.put(attribute.getName(), attribute);
@@ -230,21 +258,105 @@
requiredAttributes.remove(attribute.getName());
}
- public String getXMLClass() {
- return null;
+ public List<Change> merge(KbObject s) {
+ List<Change> changes = super.merge(s);
+
+ AbstractComponent c = (AbstractComponent)s;
+ if(!stringsEqual(name, c.name)) {
+ changes = Change.addChange(changes, new Change(this, XMLStoreConstants.ATTR_NAME, name, c.name));
+ name = c.name;
+ }
+ if(!stringsEqual(description, c.description)) {
+ changes = Change.addChange(changes, new Change(this, DESCRIPTION, description, c.description));
+ description = c.description;
+ }
+ if(!stringsEqual(componentClass, c.componentClass)) {
+ changes = Change.addChange(changes, new Change(this, COMPONENT_CLASS, componentClass, c.componentClass));
+ componentClass = c.componentClass;
+ }
+ if(!stringsEqual(componentType, c.componentType)) {
+ changes = Change.addChange(changes, new Change(this, COMPONENT_CLASS, componentType, c.componentType));
+ componentType = c.componentType;
+ }
+ if(canHaveBody != c.canHaveBody) {
+ changes = Change.addChange(changes, new Change(this, BODY_CONTENT, "" + canHaveBody, "" + c.canHaveBody));
+ canHaveBody = c.canHaveBody;
+ }
+
+ Change children = new Change(this, null, null, null);
+ mergeAttributes(c, children);
+ changes = Change.addChange(changes, children);
+
+ return changes;
}
+
+ 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()) {
+ AbstractAttribute loaded = (AbstractAttribute)a;
+ AbstractAttribute current = attributeMap.get(loaded.getId());
+ if(current == null) {
+ addAttribute(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 (IAttribute a: attributeMap.values()) {
+ AbstractAttribute removed = (AbstractAttribute)a;
+ if(attributes.get(removed.getName()) == removed) {
+ attributes.remove(removed.getName());
+ Change change = new Change(this, null, removed, null);
+ children.addChildren(Change.addChange(null, change));
+ }
+ }
+ }
+
+ public String getXMLName() {
+ return KbXMLStoreConstants.TAG_COMPONENT;
+ }
public Element toXML(Element parent, Properties context) {
- Element element = XMLUtilities.createElement(parent, KbXMLStoreConstants.TAG_COMPONENT);
- if(getXMLClass() != null) {
- element.setAttribute(XMLStoreConstants.ATTR_CLASS, getXMLClass());
+ Element element = super.toXML(parent, context);
+
+ if(attributesInfo.get(XMLStoreConstants.ATTR_NAME) == null && name != null) {
+ element.setAttribute(XMLStoreConstants.ATTR_NAME, name);
}
-
+
+ for (IAttribute c: attributes.values()) {
+ ((KbObject)c).toXML(parent, context);
+ }
+
return element;
}
public void loadXML(Element element, Properties context) {
+ super.loadXML(element, context);
+
+ setName(attributesInfo.get(XMLStoreConstants.ATTR_NAME));
+ if(name == null && element.hasAttribute(XMLStoreConstants.ATTR_NAME)) {
+ name = element.getAttribute(XMLStoreConstants.ATTR_NAME);
+ }
+ //TODO
+ //componentType?
+ Element[] cs = XMLUtilities.getChildren(element, KbXMLStoreConstants.TAG_ATTRIBUTE);
+ for (Element e: cs) {
+ String cls = e.getAttribute(XMLStoreConstants.ATTR_CLASS);
+ AbstractAttribute c = null;
+ if(KbXMLStoreConstants.CLS_TLD_LIBRARY.equals(cls)) {
+ c = new TLDAttribute();
+ } else {
+ //consider other cases;
+ }
+ if(c != null) {
+ c.loadXML(e, context);
+ addAttribute(c);
+ }
+ }
}
}
\ No newline at end of file
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-20 15:01:44 UTC (rev 15365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-05-20 15:48:31 UTC (rev 15366)
@@ -20,7 +20,6 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
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;
@@ -28,31 +27,25 @@
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.jst.web.kb.IPageContext;
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.IAttribute;
import org.jboss.tools.jst.web.kb.taglib.IComponent;
import org.jboss.tools.jst.web.kb.taglib.INameSpace;
import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
-import org.jboss.tools.jst.web.model.project.ext.store.XMLStoreHelper;
import org.w3c.dom.Element;
/**
* Abstract implementation of ITagLibrary
* @author Alexey Kazakov
*/
-public abstract class AbstractTagLib implements ITagLibrary {
+public abstract class AbstractTagLib extends KbObject implements ITagLibrary {
+ public static String URI = "uri";
- Object id;
-
protected INameSpace nameSpace;
protected String uri;
- protected IPath source;
- protected IFile resource;
protected Map<String, IComponent> components = new HashMap<String, IComponent>();
- //locations of xml attributes
- protected Map<String,IValueInfo> attributes = new HashMap<String, IValueInfo>();
-
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.taglib.TagLibrary#getAllComponents()
*/
@@ -109,6 +102,7 @@
* @param component
*/
public void addComponent(IComponent component) {
+ adopt((KbObject)component);
components.put(component.getName(), component);
}
@@ -175,7 +169,7 @@
public void setURI(IValueInfo s) {
uri = s == null ? null : s.getValue();
- attributes.put("uri", s);
+ attributesInfo.put(URI, s);
}
@@ -228,18 +222,6 @@
return proposals.toArray(new TextProposal[proposals.size()]);
}
- public void setID(Object id) {
- this.id = id;
- }
-
- public Object getID() {
- return id;
- }
-
- public String getXMLClass() {
- return null;
- }
-
public AbstractTagLib clone() throws CloneNotSupportedException {
AbstractTagLib t = (AbstractTagLib)super.clone();
t.components = new HashMap<String, IComponent>();
@@ -247,64 +229,55 @@
return t;
}
+ public String getXMLName() {
+ return KbXMLStoreConstants.TAG_LIBRARY;
+ }
+
public Element toXML(Element parent, Properties context) {
- Element element = XMLUtilities.createElement(parent, KbXMLStoreConstants.TAG_LIBRARY);
- if(getXMLClass() != null) {
- element.setAttribute(XMLStoreConstants.ATTR_CLASS, getXMLClass());
- }
- IPath source = getSourcePath();
- if(source != null && !source.equals(context.get(XMLStoreConstants.ATTR_PATH))) {
- element.setAttribute(XMLStoreConstants.ATTR_PATH, source.toString());
- }
- if(id != null) {
- if(id instanceof XModelObject) {
- XModelObject o = (XModelObject)id;
- XMLStoreHelper.saveModelObject(element, o, XMLStoreConstants.TAG_ID, context);
- } else {
- //TODO consider other kinds of id
- }
- }
+ Element element = super.toXML(parent, context);
+ XModelObject old = pushModelObject(context);
+
saveAttributeValues(element);
for (IComponent c: components.values()) {
- //TODO save component
+ ((KbObject)c).toXML(parent, context);
}
+ popModelObject(context, old);
return element;
}
protected void saveAttributeValues(Element element) {
- if(uri != null) element.setAttribute(KbXMLStoreConstants.ATTR_URI, uri);
}
public void loadXML(Element element, Properties context) {
- String s = element.getAttribute(XMLStoreConstants.ATTR_PATH);
- if(s != null && s.length() > 0) {
- source = new Path(s);
- } else {
- source = (IPath)context.get(XMLStoreConstants.ATTR_PATH);
- }
- Element e_id = XMLUtilities.getUniqueChild(element, XMLStoreConstants.TAG_ID);
- if(e_id != null) {
- String cls = e_id.getAttribute(XMLStoreConstants.ATTR_CLASS);
- if(XMLStoreConstants.CLS_MODEL_OBJECT.equals(cls)) {
- id = XMLStoreHelper.loadModelObject(e_id, context);
+ super.loadXML(element, context);
+
+ XModelObject old = pushModelObject(context);
+
+ loadAttributeValues(element);
+
+ Element[] cs = XMLUtilities.getChildren(element, KbXMLStoreConstants.TAG_COMPONENT);
+ for (Element e: cs) {
+ String cls = e.getAttribute(XMLStoreConstants.ATTR_CLASS);
+ AbstractComponent c = null;
+ if(KbXMLStoreConstants.CLS_TLD_LIBRARY.equals(cls)) {
+ c = new TLDTag();
} else {
- //TODO consider other kinds of id
+ //consider other cases;
}
+ if(c != null) {
+ c.loadXML(e, context);
+ addComponent(c);
+ }
}
- loadAttributeValues(element);
-
- //TODO load components
-
+ popModelObject(context, old);
}
protected void loadAttributeValues(Element element) {
- if(element.hasAttribute(KbXMLStoreConstants.ATTR_URI)) {
- uri = element.getAttribute(KbXMLStoreConstants.ATTR_URI);
- }
+ setURI(attributesInfo.get(URI));
}
}
\ No newline at end of file
Added: 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 (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDAttribute.java 2009-05-20 15:48:31 UTC (rev 15366)
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.taglib;
+
+import org.jboss.tools.jst.web.kb.internal.KbXMLStoreConstants;
+
+public class TLDAttribute extends AbstractAttribute {
+
+ public String getXMLClass() {
+ return KbXMLStoreConstants.CLS_TLD_LIBRARY;
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDAttribute.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/TLDLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDLibrary.java 2009-05-20 15:01:44 UTC (rev 15365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDLibrary.java 2009-05-20 15:48:31 UTC (rev 15366)
@@ -19,6 +19,10 @@
* @author Viacheslav Kabanovich
*/
public class TLDLibrary extends AbstractTagLib implements ITLDLibrary {
+ public static final String DISPLAY_NAME = "display-name";
+ public static final String SHORT_NAME = "short-name";
+ public static final String VERSION = "version";
+
String displayName = null;
String shortName = null;
String version = null;
@@ -37,18 +41,23 @@
public void setDisplayName(IValueInfo s) {
displayName = s == null ? null : s.getValue();
- attributes.put("display-name", s);
+ attributesInfo.put(DISPLAY_NAME, s);
}
public void setShortName(IValueInfo s) {
shortName = s == null ? null : s.getValue();
- attributes.put("short-name", s);
+ attributesInfo.put(SHORT_NAME, s);
}
public void setVersion(String version) {
this.version = version;
}
+ public void setVersion(IValueInfo s) {
+ version = s == null ? null : s.getValue();
+ attributesInfo.put(VERSION, s);
+ }
+
public void createDefaultNameSpace() {
}
@@ -59,14 +68,18 @@
protected void saveAttributeValues(Element element) {
super.saveAttributeValues(element);
- if(shortName != null) element.setAttribute(KbXMLStoreConstants.ATTR_SHORT_NAME, shortName);
- //TODO
+ if(attributesInfo.get(VERSION) == null && version != null) {
+ element.setAttribute(VERSION, version);
+ }
}
protected void loadAttributeValues(Element element) {
super.loadAttributeValues(element);
- if(element.hasAttribute(KbXMLStoreConstants.ATTR_SHORT_NAME)) {
- shortName = element.getAttribute(KbXMLStoreConstants.ATTR_SHORT_NAME);
+ setShortName(attributesInfo.get(SHORT_NAME));
+ setDisplayName(attributesInfo.get(DISPLAY_NAME));
+ setVersion(attributesInfo.get(VERSION));
+ if(version == null && element.hasAttribute(VERSION)) {
+ version = element.getAttribute(VERSION);
}
//TODO
}
Added: 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 (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDTag.java 2009-05-20 15:48:31 UTC (rev 15366)
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.taglib;
+
+import org.jboss.tools.jst.web.kb.internal.KbXMLStoreConstants;
+
+public class TLDTag extends AbstractComponent {
+
+ public String getXMLClass() {
+ return KbXMLStoreConstants.CLS_TLD_LIBRARY;
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/TLDTag.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 5 months
JBoss Tools SVN: r15365 - trunk/vpe/tests/org.jboss.tools.vpe.test/scheme.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2009-05-20 11:01:44 -0400 (Wed, 20 May 2009)
New Revision: 15365
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.test/scheme/scheme.xsd
Log:
Fixing errors in junit test, for green build
Modified: trunk/vpe/tests/org.jboss.tools.vpe.test/scheme/scheme.xsd
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.test/scheme/scheme.xsd 2009-05-20 14:26:50 UTC (rev 15364)
+++ trunk/vpe/tests/org.jboss.tools.vpe.test/scheme/scheme.xsd 2009-05-20 15:01:44 UTC (rev 15365)
@@ -557,9 +557,15 @@
<!-- -->
<xsd:complexType name="HTML_PRE"/>
<!-- -->
- <xsd:complexType name="HTML_LI"/>
+ <xsd:complexType name="HTML_UL">
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="li" minOccurs="0" type="vpe:HTML_LI" form="unqualified"/>
+ </xsd:choice>
+ <xsd:attribute name="class" type="xsd:string" use="optional"/>
+ <xsd:attribute name="style" type="xsd:string" use="optional"/>
+ </xsd:complexType>
<!-- -->
- <xsd:complexType name="HTML_UL"/>
+ <xsd:complexType name="HTML_LI" mixed="true" />
<!-- -->
<xsd:complexType name="HTML_P"/>
<!-- -->
15 years, 5 months
JBoss Tools SVN: r15364 - trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-05-20 10:26:50 -0400 (Wed, 20 May 2009)
New Revision: 15364
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1813Test.java
Log:
JBIDE-4341: JstJspAllTests/testJsfJspJbide1813Test failing with missing applicationScope in completions
The EL-proposals are removed from the list of proposals to test.
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1813Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1813Test.java 2009-05-20 13:47:10 UTC (rev 15363)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1813Test.java 2009-05-20 14:26:50 UTC (rev 15364)
@@ -20,20 +20,13 @@
}
public void testJsfJspJbide1813Test(){
+
+ // JBIDE-4341: the EL proposals are not to be returned (and tested) here anymore.
+ // The EL-proposals are removed from the test-list.
+ //
String[] proposals={
"ltr",
"rtl",
- "#{applicationScope}",
- "#{cookie}",
- "#{facesContext}",
- "#{header}",
- "#{headerValues}",
- "#{initParam}",
- "#{param}",
- "#{paramValues}",
- "#{requestScope}",
- "#{sessionScope}",
- "#{view}"
};
checkProposals(PAGE_NAME, "dir=\"\"", 5, proposals, true);
15 years, 5 months
JBoss Tools SVN: r15363 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-20 09:47:10 -0400 (Wed, 20 May 2009)
New Revision: 15363
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4343
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java 2009-05-20 12:06:11 UTC (rev 15362)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java 2009-05-20 13:47:10 UTC (rev 15363)
@@ -169,7 +169,8 @@
Set<String> onlyInWar = new HashSet<String>();
Set<String> onlyInEar = new HashSet<String>();
Set<String> onlyInEjbSrc = new HashSet<String>();
-
+
+ onlyInEar.add("commons-beanutils.jar");
onlyInEar.add("jboss-seam.jar");
onlyInEar.add("antlr-runtime.jar");
onlyInEar.add("drools-compiler.jar");
@@ -180,7 +181,6 @@
onlyInEar.add("jbpm-jpdl.jar");
onlyInEar.add("META-INF");
- onlyInWar.add("commons-beanutils.jar");
onlyInWar.add("commons-digester.jar");
onlyInWar.add("jboss-seam-debug.jar");
onlyInWar.add("jboss-seam-ioc.jar");
15 years, 5 months
JBoss Tools SVN: r15362 - trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-20 08:06:11 -0400 (Wed, 20 May 2009)
New Revision: 15362
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/facelet-taglib.meta
Log:
https://jira.jboss.org/jira/browse/JBIDE-4340
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/facelet-taglib.meta
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/facelet-taglib.meta 2009-05-20 11:45:58 UTC (rev 15361)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/facelet-taglib.meta 2009-05-20 12:06:11 UTC (rev 15362)
@@ -317,14 +317,16 @@
<XActionItem kind="list">
<XActionItem ICON="action.empty" displayName="New" group="1"
kind="list" name="CreateActions">
- <XActionItem HandlerClassName="%DefaultReplaceUnique%" ICON="empty"
+ <XActionItem HandlerClassName="%DefaultReplaceUnique%"
+ ICON="action.empty"
PROPERTIES="significanceMessageClass=%Replace%;child=declaration"
WizardClassName="%Default%" displayName="Handler..." kind="action" name="AddHandler">
<EntityData EntityName="FaceletTaglibHandler">
<AttributeData AttributeName="handler-class"/>
</EntityData>
</XActionItem>
- <XActionItem HandlerClassName="%DefaultReplaceUnique%" ICON="empty"
+ <XActionItem HandlerClassName="%DefaultReplaceUnique%"
+ ICON="action.empty"
PROPERTIES="significanceMessageClass=%Replace%;child=declaration"
WizardClassName="%Default%" displayName="Component..."
kind="action" name="AddComponent">
@@ -334,7 +336,8 @@
<AttributeData AttributeName="handler-class" Mandatory="no"/>
</EntityData>
</XActionItem>
- <XActionItem HandlerClassName="%DefaultReplaceUnique%" ICON="empty"
+ <XActionItem HandlerClassName="%DefaultReplaceUnique%"
+ ICON="action.empty"
PROPERTIES="significanceMessageClass=%Replace%;child=declaration"
WizardClassName="%Default%" displayName="Converter..."
kind="action" name="AddConverter">
@@ -343,7 +346,8 @@
<AttributeData AttributeName="handler-class" Mandatory="no"/>
</EntityData>
</XActionItem>
- <XActionItem HandlerClassName="%DefaultReplaceUnique%" ICON="empty"
+ <XActionItem HandlerClassName="%DefaultReplaceUnique%"
+ ICON="action.empty"
PROPERTIES="significanceMessageClass=%Replace%;child=declaration"
WizardClassName="%Default%" displayName="Validator..."
kind="action" name="AddValidator">
@@ -352,7 +356,8 @@
<AttributeData AttributeName="handler-class" Mandatory="no"/>
</EntityData>
</XActionItem>
- <XActionItem HandlerClassName="%DefaultReplaceUnique%" ICON="empty"
+ <XActionItem HandlerClassName="%DefaultReplaceUnique%"
+ ICON="action.empty"
PROPERTIES="significanceMessageClass=%Replace%;child=declaration"
WizardClassName="%Default%" displayName="Source..." kind="action" name="AddSource">
<EntityData EntityName="FaceletTaglibSource">
15 years, 5 months
JBoss Tools SVN: r15361 - trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-20 07:45:58 -0400 (Wed, 20 May 2009)
New Revision: 15361
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/HttpUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4338 Fixed
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/HttpUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/HttpUtil.java 2009-05-20 10:57:43 UTC (rev 15360)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/HttpUtil.java 2009-05-20 11:45:58 UTC (rev 15361)
@@ -165,7 +165,13 @@
IProxyData proxy = proxyData[i];
if(IProxyData.HTTP_PROXY_TYPE.equals(proxy.getType())) {
String proxyHostName = proxy.getHost();
+ if(proxyHostName==null) {
+ break;
+ }
int portNumber = proxy.getPort();
+ if(portNumber==-1) {
+ portNumber = 80;
+ }
httpClient.getHostConfiguration().setProxy(proxyHostName, portNumber);
if(proxy.isRequiresAuthentication()) {
String userName = proxy.getUserId();
15 years, 5 months
JBoss Tools SVN: r15360 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-05-20 06:57:43 -0400 (Wed, 20 May 2009)
New Revision: 15360
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataDefinitionList.xhtml.xml
Log:
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataDefinitionList.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataDefinitionList.xhtml.xml 2009-05-20 09:41:53 UTC (rev 15359)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataDefinitionList.xhtml.xml 2009-05-20 10:57:43 UTC (rev 15360)
@@ -112,7 +112,7 @@
<test id="dataDefinitionList1">
<DIV CLASS="dr-pnl rich-panel">
<DIV CLASS="dr-pnl-h rich-panel-header"
- STYLE="background-image: url(file:///D:/Java/WorkSpace/trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif);">
+ STYLE="/background-image: url\(.*resources/common/background.gif\);/">
<SPAN CLASS="vpe-text">
Data Defenition list
</SPAN>
15 years, 5 months
JBoss Tools SVN: r15359 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors: uitls and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-05-20 05:41:53 -0400 (Wed, 20 May 2009)
New Revision: 15359
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectoreSelectionDialog.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
Log:
JBIDE-4232
active the node which is new creation
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectoreSelectionDialog.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectoreSelectionDialog.java 2009-05-20 09:10:40 UTC (rev 15358)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectoreSelectionDialog.java 2009-05-20 09:41:53 UTC (rev 15359)
@@ -112,7 +112,8 @@
viewer = new TreeViewer(composite, SWT.BORDER);
viewer.setContentProvider(new CompoundStructuredDataContentProvider());
viewer.setLabelProvider(new CompoundStructuredDataLabelProvider());
- viewer.setInput(generateInputData());
+ List<Object> inputList = generateInputData();
+ viewer.setInput(inputList);
viewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
okPressed();
@@ -153,6 +154,9 @@
handleButtons();
getShell().setText("Selector generate dialog");
+
+ SmooksUIUtils.expandSelectorViewer(inputList, viewer);
+
return composite;
}
@@ -172,7 +176,7 @@
});
}
- protected List<?> generateInputData() {
+ protected List<Object> generateInputData() {
List<Object> list = new ArrayList<Object>();
if (this.graphicsExt != null) {
IJavaProject project = SmooksUIUtils.getJavaProject(graphicsExt);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationFormPage.java 2009-05-20 09:10:40 UTC (rev 15358)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationFormPage.java 2009-05-20 09:41:53 UTC (rev 15359)
@@ -283,6 +283,7 @@
}
}
};
+
runnable.run();
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java 2009-05-20 09:10:40 UTC (rev 15358)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java 2009-05-20 09:41:53 UTC (rev 15359)
@@ -29,6 +29,7 @@
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.viewers.DecoratingLabelProvider;
+import org.eclipse.jface.viewers.IElementComparer;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
@@ -55,15 +56,13 @@
import org.eclipse.ui.forms.widgets.Section;
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
import org.jboss.tools.smooks.model.common.AbstractAnyType;
-import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
/**
* @author Dart Peng (dpeng(a)redhat.com)
* <p>
* Date Apr 1, 2009
*/
-public class SmooksMasterDetailBlock extends MasterDetailsBlock implements IMenuListener,
- ISelectionChangedListener {
+public class SmooksMasterDetailBlock extends MasterDetailsBlock implements IMenuListener, ISelectionChangedListener {
private Section configurationSection;
private SectionPart sectionPart;
@@ -95,8 +94,6 @@
createSmooksTreeViewer(tool, managedForm, parent);
}
-
-
@Override
public void createContent(IManagedForm managedForm) {
super.createContent(managedForm);
@@ -131,18 +128,16 @@
// provider.registePage(ResourceType.class, new
// SmooksStuffPropertyDetailPage());
detailsPart.registerPage(EObject.class, new SmooksStuffPropertyDetailPage(
- (SmooksMultiFormEditor) this.formEditor));
+ (SmooksMultiFormEditor) this.formEditor));
}
-
- protected void refreshSmooksTreeViewer(){
+
+ protected void refreshSmooksTreeViewer() {
smooksTreeViewer.refresh();
}
- protected void createSmooksTreeViewer(FormToolkit tool, final IManagedForm managedForm,
- Composite rootMainControl) {
+ protected void createSmooksTreeViewer(FormToolkit tool, final IManagedForm managedForm, Composite rootMainControl) {
configurationSection = tool.createSection(rootMainControl, Section.TITLE_BAR);
- configurationSection
- .setDescription("Define Smooks elements for configuration file in the following section.");
+ configurationSection.setDescription("Define Smooks elements for configuration file in the following section.");
configurationSection.setText("Message Filtering Resources");
sectionPart = new SectionPart(configurationSection);
managedForm.addPart(sectionPart);
@@ -162,12 +157,9 @@
tableComposite.setLayout(fillLayout);
smooksTreeViewer = new TreeViewer(tableComposite, SWT.NONE);
smooksTreeViewer.addSelectionChangedListener(this);
-
-
-
- smooksTreeViewer.setContentProvider(new AdapterFactoryContentProvider(editingDomain
- .getAdapterFactory()));
-
+
+ smooksTreeViewer.setContentProvider(new AdapterFactoryContentProvider(editingDomain.getAdapterFactory()));
+
smooksTreeViewer.setLabelProvider(new DecoratingLabelProvider(new AdapterFactoryLabelProvider(editingDomain
.getAdapterFactory()) {
@@ -188,6 +180,38 @@
}
}, SmooksConfigurationActivator.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
+ if(true)
+ {
+ smooksTreeViewer.setComparer(new IElementComparer() {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.IElementComparer#equals(java.lang
+ * .Object, java.lang.Object)
+ */
+ public boolean equals(Object a, Object b) {
+ Object elementA = AdapterFactoryEditingDomain.unwrap(a);
+ Object elementB = AdapterFactoryEditingDomain.unwrap(b);
+ if (elementA == elementB) {
+ return true;
+ }
+ return elementA == null ? elementB == null : elementA.equals(elementB);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.IElementComparer#hashCode(java.
+ * lang.Object)
+ */
+ public int hashCode(Object element) {
+ return element.hashCode();
+ }
+
+ });
+ }
+
smooksTreeViewer.setFilters(new ViewerFilter[] { new TextEObjectModelFilter() });
Object smooksModel = ((SmooksMultiFormEditor) this.formEditor).getSmooksModel();
if (smooksModel != null) {
@@ -197,12 +221,12 @@
formEditor.getSite().setSelectionProvider(smooksTreeViewer);
if (formEditor.getEditorSite().getActionBarContributor() instanceof ISelectionChangedListener) {
- smooksTreeViewer.addSelectionChangedListener((ISelectionChangedListener) formEditor
- .getEditorSite().getActionBarContributor());
+ smooksTreeViewer.addSelectionChangedListener((ISelectionChangedListener) formEditor.getEditorSite()
+ .getActionBarContributor());
}
smooksTreeViewer.addSelectionChangedListener(this);
- tableComposite.setBackground(new Color(null,128,128,128));
-
+ tableComposite.setBackground(new Color(null, 128, 128, 128));
+
gd = new GridData(GridData.FILL_BOTH);
tableComposite.setLayoutData(gd);
tool.paintBordersFor(tableComposite);
@@ -233,20 +257,20 @@
gd.widthHint = 0;
buttonComposite.setLayoutData(gd);
buttonComposite.setVisible(false);
-
+
hookButtons();
}
protected List<?> getViewerSelections() {
IStructuredSelection selections = (IStructuredSelection) smooksTreeViewer.getSelection();
return selections.toList();
-// List<Object> nl = new ArrayList<Object>();
-// for (Iterator<?> iterator = l.iterator(); iterator.hasNext();) {
-// Object object = (Object) iterator.next();
-// // object = AdapterFactoryEditingDomain.unwrap(object);
-// nl.add(object);
-// }
-// return l;
+ // List<Object> nl = new ArrayList<Object>();
+ // for (Iterator<?> iterator = l.iterator(); iterator.hasNext();) {
+ // Object object = (Object) iterator.next();
+ // // object = AdapterFactoryEditingDomain.unwrap(object);
+ // nl.add(object);
+ // }
+ // return l;
}
private void hookButtons() {
@@ -269,7 +293,7 @@
downButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
List<?> list = getViewerSelections();
- if(list.size() == 1){
+ if (list.size() == 1) {
Object obj = list.get(0);
EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
EObject parent = v.eContainer();
@@ -289,14 +313,14 @@
private void createMenuForViewer(TreeViewer smooksTreeViewer2) {
MenuManager contextMenu = new MenuManager();
-// contextMenu.add(new Separator("additions"));
+ // contextMenu.add(new Separator("additions"));
contextMenu.setRemoveAllWhenShown(true);
contextMenu.addMenuListener(this);
Menu menu = contextMenu.createContextMenu(smooksTreeViewer2.getControl());
smooksTreeViewer2.getControl().setMenu(menu);
-// formEditor.getSite().registerContextMenu(contextMenu,
-// new UnwrappingSelectionProvider(smooksTreeViewer2));
+ // formEditor.getSite().registerContextMenu(contextMenu,
+ // new UnwrappingSelectionProvider(smooksTreeViewer2));
}
public TreeViewer getSmooksTreeViewer() {
@@ -308,8 +332,7 @@
}
public void menuAboutToShow(IMenuManager menuManager) {
- ((IMenuListener) formEditor.getEditorSite().getActionBarContributor())
- .menuAboutToShow(menuManager);
+ ((IMenuListener) formEditor.getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
}
private class TextEObjectModelFilter extends ViewerFilter {
@@ -320,11 +343,11 @@
if (obj instanceof BasicFeatureMapEntry) {
EStructuralFeature sf = ((BasicFeatureMapEntry) obj).getEStructuralFeature();
if (sf.equals(XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__TEXT)
- || sf.equals(XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__CDATA)) {
+ || sf.equals(XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__CDATA)) {
return false;
}
- }else{
- if(obj.getClass() == String.class){
+ } else {
+ if (obj.getClass() == String.class) {
return false;
}
}
@@ -345,39 +368,42 @@
* @param selections
*/
protected void updateButtons(List<?> selections) {
- removeButton.setEnabled(true);
- upButton.setEnabled(true);
- downButton.setEnabled(true);
- if (selections.size() >= 1) {
- for (Iterator<?> iterator = selections.iterator(); iterator.hasNext();) {
- Object object = (Object) iterator.next();
- object = AdapterFactoryEditingDomain.unwrap(object);
- if (object instanceof SmooksResourceListType
- || object instanceof org.jboss.tools.smooks10.model.smooks.SmooksResourceListType) {
- removeButton.setEnabled(false);
- break;
- }
- }
- }
- if (selections.size() == 1) {
- Object selection = selections.get(0);
- if (selection instanceof SmooksResourceListType
- || selection instanceof org.jboss.tools.smooks10.model.smooks.SmooksResourceListType) {
- upButton.setEnabled(false);
- downButton.setEnabled(false);
- } else {
- if (selection instanceof EObject) {
- EObject parent = ((EObject) selection).eContainer();
- int index = parent.eContents().indexOf(selection);
- if (index <= 0) {
- upButton.setEnabled(false);
- }
- if (index >= parent.eContents().size() - 1) {
- downButton.setEnabled(false);
- }
- }
- }
- }
+ // removeButton.setEnabled(true);
+ // upButton.setEnabled(true);
+ // downButton.setEnabled(true);
+ // if (selections.size() >= 1) {
+ // for (Iterator<?> iterator = selections.iterator();
+ // iterator.hasNext();) {
+ // Object object = (Object) iterator.next();
+ // object = AdapterFactoryEditingDomain.unwrap(object);
+ // if (object instanceof SmooksResourceListType
+ // || object instanceof
+ // org.jboss.tools.smooks10.model.smooks.SmooksResourceListType) {
+ // removeButton.setEnabled(false);
+ // break;
+ // }
+ // }
+ // }
+ // if (selections.size() == 1) {
+ // Object selection = selections.get(0);
+ // if (selection instanceof SmooksResourceListType
+ // || selection instanceof
+ // org.jboss.tools.smooks10.model.smooks.SmooksResourceListType) {
+ // upButton.setEnabled(false);
+ // downButton.setEnabled(false);
+ // } else {
+ // if (selection instanceof EObject) {
+ // EObject parent = ((EObject) selection).eContainer();
+ // int index = parent.eContents().indexOf(selection);
+ // if (index <= 0) {
+ // upButton.setEnabled(false);
+ // }
+ // if (index >= parent.eContents().size() - 1) {
+ // downButton.setEnabled(false);
+ // }
+ // }
+ // }
+ // }
}
/*
@@ -397,11 +423,10 @@
objList.add(obj);
}
if (objList.isEmpty()) {
- sectionPart.getManagedForm()
- .fireSelectionChanged(sectionPart, event.getSelection());
+ sectionPart.getManagedForm().fireSelectionChanged(sectionPart, event.getSelection());
} else {
sectionPart.getManagedForm().fireSelectionChanged(sectionPart,
- new StructuredSelection(objList.toArray()));
+ new StructuredSelection(objList.toArray()));
}
updateButtons(objList);
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java 2009-05-20 09:10:40 UTC (rev 15358)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java 2009-05-20 09:41:53 UTC (rev 15359)
@@ -33,17 +33,19 @@
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.common.command.CommandStackListener;
+import org.eclipse.emf.common.command.CommandWrapper;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.DeleteCommand;
+import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.domain.IEditingDomainProvider;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.IWrapperItemProvider;
import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
import org.eclipse.jface.text.DocumentEvent;
@@ -56,7 +58,6 @@
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.views.properties.PropertySheetPage;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
import org.jboss.tools.smooks.configuration.SmooksConstants;
@@ -100,7 +101,7 @@
protected EditingDomain editingDomain = null;
- private PropertySheetPage propertySheetPage = null;
+// private PropertySheetPage propertySheetPage = null;
private SmooksGraphicsExtType smooksGraphicsExt = null;
@@ -126,13 +127,26 @@
handleEMFModelChange();
// Try to select the affected objects.
//
- Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand();
- if (mostRecentCommand != null && (mostRecentCommand instanceof AddCommand)) {
- setSelectionToViewer(mostRecentCommand.getAffectedObjects());
- }
- if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) {
- propertySheetPage.refresh();
- }
+ final Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand();
+ getContainer().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ if (mostRecentCommand != null) {
+ Command rawCommand = mostRecentCommand;
+ while (rawCommand instanceof CommandWrapper) {
+ rawCommand = ((CommandWrapper) rawCommand).getCommand();
+ }
+ if (rawCommand instanceof SetCommand || rawCommand instanceof AddCommand || rawCommand instanceof DeleteCommand) {
+ setSelectionToViewer(mostRecentCommand.getAffectedObjects());
+ }
+ }
+ }
+ });
+
+//
+// if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) {
+// propertySheetPage.refresh();
+// }
}
});
}
@@ -221,9 +235,10 @@
List<Object> newList = new ArrayList<Object>();
for (Iterator<?> iterator = theSelection.iterator(); iterator.hasNext();) {
Object object = (Object) iterator.next();
- if (object instanceof IWrapperItemProvider) {
- newList.add(((IWrapperItemProvider) object).getValue());
- }
+ // if (object instanceof IWrapperItemProvider) {
+ // newList.add(((IWrapperItemProvider) object).getValue());
+ // }
+ newList.add(object);
}
configurationPage.setSelectionToViewer(newList);
}
@@ -475,7 +490,7 @@
*/
public void setDiagnosticList(List<Diagnostic> d) {
this.diagnosticList = d;
-
+
if (markerHelper != null) {
Resource resource = editingDomain.getResourceSet().getResources().get(0);
if (resource != null) {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-05-20 09:10:40 UTC (rev 15358)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-05-20 09:41:53 UTC (rev 15359)
@@ -45,6 +45,7 @@
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
@@ -121,6 +122,8 @@
public static int VALUE_TYPE_CDATA = 0;
+ public static final int SELECTOR_EXPAND_MAX_LEVEL = 5;
+
public static void createMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain,
FormToolkit toolkit, Composite parent, Object model, boolean linkLabel, IHyperlinkListener listener) {
createMixedTextFieldEditor(label, editingdomain, toolkit, parent, model, false, 0, linkLabel, false, listener,
@@ -331,10 +334,10 @@
return createStringFieldEditor(label, parent, editingdomain, toolkit, itemPropertyDescriptor, model, false,
true, true, 0, listener, valueType, action);
}
-
- public static boolean isLinuxOS(){
+
+ public static boolean isLinuxOS() {
Object osName = System.getProperties().get("os.name");
- if(osName != null && "linux".equalsIgnoreCase(osName.toString())){
+ if (osName != null && "linux".equalsIgnoreCase(osName.toString())) {
return true;
}
return false;
@@ -438,9 +441,9 @@
}
gd = new GridData(GridData.FILL_HORIZONTAL);
-
+
int textType = SWT.FLAT;
- if(isLinuxOS()){
+ if (isLinuxOS()) {
textType = SWT.BORDER;
}
if (multiText) {
@@ -1134,7 +1137,32 @@
}
}
}
+
+ private static void expandSelectorViewer(IXMLStructuredObject model,TreeViewer viewer , List<String> expandedModel , int level){
+ if(level >= SELECTOR_EXPAND_MAX_LEVEL) return;
+ level++;
+ if(expandedModel.contains(model.getNodeName())){
+ return;
+ }else{
+ expandedModel.add(model.getNodeName());
+ viewer.expandToLevel(model, 0);
+ List<IXMLStructuredObject> children = model.getChildren();
+ for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
+ IXMLStructuredObject structuredObject = (IXMLStructuredObject) iterator.next();
+ expandSelectorViewer(structuredObject, viewer,expandedModel,level);
+ }
+ }
+ }
+ public static void expandSelectorViewer(List<Object> models, TreeViewer viewer) {
+ for (Iterator<?> iterator = models.iterator(); iterator.hasNext();) {
+ Object model = (Object) iterator.next();
+ if (model instanceof IXMLStructuredObject) {
+ expandSelectorViewer((IXMLStructuredObject)model,viewer,new ArrayList<String>(),0);
+ }
+ }
+ }
+
public static void showErrorDialog(Shell shell, Status status) {
ErrorDialog.openError(shell, "Error", "error", status); //$NON-NLS-1$ //$NON-NLS-2$
}
15 years, 5 months
JBoss Tools SVN: r15358 - trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/util/test.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2009-05-20 05:10:40 -0400 (Wed, 20 May 2009)
New Revision: 15358
Modified:
trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/util/test/HttpUtilTest.java
Log:
Removed fail handling which were hiding the exception to in junittests runs.
https://jira.jboss.org/jira/browse/JBIDE-4338
Modified: trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/util/test/HttpUtilTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/util/test/HttpUtilTest.java 2009-05-20 08:29:10 UTC (rev 15357)
+++ trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/util/test/HttpUtilTest.java 2009-05-20 09:10:40 UTC (rev 15358)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.common.util.test;
+import java.io.IOException;
+
import org.apache.commons.httpclient.HttpClient;
import org.jboss.tools.common.util.HttpUtil;
@@ -17,12 +19,8 @@
public class HttpUtilTest extends TestCase {
- public void testCreateHttpClient() {
- try {
- HttpClient client = HttpUtil.createHttpClient("http://www.jboss.com");
- assertNotNull("HTTP Client object wasn't created", client);
- } catch (Exception e) {
- fail("Error occurs when creating HTTP Client object");
- }
+ public void testCreateHttpClient() throws IOException {
+ HttpClient client = HttpUtil.createHttpClient("http://www.jboss.com");
+ assertNotNull("HTTP Client object wasn't created", client);
}
}
15 years, 5 months