JBoss Tools SVN: r10389 - trunk/smooks/features/org.jboss.tools.smooks.feature.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-09-22 06:48:56 -0400 (Mon, 22 Sep 2008)
New Revision: 10389
Modified:
trunk/smooks/features/org.jboss.tools.smooks.feature/feature.xml
Log:
add a new plugin : "org.jboss.tools.smooks.java2xml"
Modified: trunk/smooks/features/org.jboss.tools.smooks.feature/feature.xml
===================================================================
--- trunk/smooks/features/org.jboss.tools.smooks.feature/feature.xml 2008-09-22 10:47:14 UTC (rev 10388)
+++ trunk/smooks/features/org.jboss.tools.smooks.feature/feature.xml 2008-09-22 10:48:56 UTC (rev 10389)
@@ -1,25 +1,25 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.jboss.tools.smooks.feature"
- label="Smooks Tools"
- version="1.0.0"
- provider-name="JBoss, a division of Red Hat">
-
- <description url="http://www.example.com/description">
- Smooks Tools
- </description>
-
- <copyright url="http://www.example.com/copyright">
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.smooks.feature"
+ label="Smooks Tools"
+ version="1.0.0"
+ provider-name="JBoss, a division of Red Hat">
+
+ <description url="http://www.example.com/description">
+ Smooks Tools
+ </description>
+
+ <copyright url="http://www.example.com/copyright">
Copyright (c) 2008 Red Hat, Inc.
Distributed under license by Red Hat, Inc. All rights reserved.
This program is made available under the terms of the
Eclipse Public License v1.0 which accompanies this distribution,
and is available at http://www.eclipse.org/legal/epl-v10.html
Contributors:
-Red Hat, Inc. - initial API and implementation
- </copyright>
-
- <license url="http://www.example.com/license">
+Red Hat, Inc. - initial API and implementation
+ </copyright>
+
+ <license url="http://www.example.com/license">
Eclipse Public License - v 1.0
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS
ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
@@ -215,56 +215,63 @@
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.
- </license>
-
- <plugin
- id="org.jboss.tools.smooks.graphicalInfo"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.javabean"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.model"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.model.edit"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.xml"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.xml2java"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
+litigation.
+ </license>
+
+ <plugin
+ id="org.jboss.tools.smooks.graphicalInfo"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.smooks.javabean"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.smooks.model"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.smooks.model.edit"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.smooks.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.smooks.xml"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.smooks.xml2java"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.smooks.java2xml"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
15 years, 9 months
JBoss Tools SVN: r10388 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks: ui/gef/model and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-09-22 06:47:14 -0400 (Mon, 22 Sep 2008)
New Revision: 10388
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/AnalyzerFactory.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/AbstractStructuredDataModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/GraphRootModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/UIUtils.java
Log:
change the extension points information store way
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/AnalyzerFactory.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/AnalyzerFactory.java 2008-09-22 10:42:07 UTC (rev 10387)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/AnalyzerFactory.java 2008-09-22 10:47:14 UTC (rev 10388)
@@ -44,7 +44,8 @@
DataTypeID ti = new DataTypeID();
ti.setId(id);
ModelAnalyzer analyzer = ((ModelAnalyzer) map.get(id));
- if(analyzer == null) continue;
+ if (analyzer == null)
+ continue;
ti.setName(analyzer.getName());
list.add(ti);
}
@@ -79,13 +80,15 @@
if (map == null)
return;
IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint ep = registry.getExtensionPoint(SmooksExtensionPointConstants.EXTENTION_POINT_ANALYZER);
+ IExtensionPoint ep = registry
+ .getExtensionPoint(SmooksExtensionPointConstants.EXTENTION_POINT_ANALYZER);
if (ep == null)
return;
IConfigurationElement[] elements = ep.getConfigurationElements();
for (int i = 0; i < elements.length; i++) {
IConfigurationElement element = elements[i];
- if(!element.getName().equals(elementName)) continue;
+ if (!element.getName().equals(elementName))
+ continue;
String aname = element
.getAttribute(SmooksExtensionPointConstants.EXTENTION_POINT_ATTRIBUTE_NAME);
String clazz = element
@@ -127,9 +130,13 @@
return;
IConfigurationElement[] elements = ep.getConfigurationElements();
for (int i = 0; i < elements.length; i++) {
-
+
IConfigurationElement element = elements[i];
- if(!element.getName().equals(SmooksExtensionPointConstants.EXTENTION_POINT_ELEMENT_MAPPINGANALYZER)) continue;
+ if (!element
+ .getName()
+ .equals(
+ SmooksExtensionPointConstants.EXTENTION_POINT_ELEMENT_MAPPINGANALYZER))
+ continue;
String aname = element
.getAttribute(SmooksExtensionPointConstants.EXTENTION_POINT_ATTRIBUTE_NAME);
String clazz = element
@@ -141,10 +148,10 @@
if (clazz == null || "".equals(clazz))
continue;
- MappingAnalyzerMapper mapper = new MappingAnalyzerMapper();
- mapper.setElement(element);
- mapper.setAnalyzerName(aname);
- mapper.setSourceDataTypeID(typeID);
+ // MappingAnalyzerMapper mapper = mappingAnalyzerMap.get
+ // mapper.setElement(element);
+ // mapper.setAnalyzerName(aname);
+ // mapper.setSourceDataTypeID(typeID);
IConfigurationElement[] childrenElements = element.getChildren();
for (int j = 0; j < childrenElements.length; j++) {
@@ -157,10 +164,14 @@
.getAttribute(SmooksExtensionPointConstants.EXTENTION_POINT_ATTRIBUTE_ID);
if (tid == null || "".equals(tid))
continue;
+ MappingAnalyzerMapper mapper = new MappingAnalyzerMapper();
+ mapper.setElement(element);
+ mapper.setAnalyzerName(aname);
+ mapper.setSourceDataTypeID(typeID);
+ mappingAnalyzerMap.put(typeID + ":" + tid, mapper);
mapper.addTargetDataTypeID(tid);
}
}
- mappingAnalyzerMap.put(typeID, mapper);
}
}
@@ -178,7 +189,7 @@
String targetDataTypeID) throws CoreException {
if (this.mappingAnalyzerMap != null) {
MappingAnalyzerMapper mapper = (MappingAnalyzerMapper) this.mappingAnalyzerMap
- .get(sourceDataTypeID);
+ .get(sourceDataTypeID + ":" + targetDataTypeID);
if (mapper == null)
return null;
if (mapper.canTransformToTheTarget(targetDataTypeID)) {
@@ -193,7 +204,8 @@
if (this.sourceModelAnalyzer != null) {
ModelAnalyzer mapper = (ModelAnalyzer) this.sourceModelAnalyzer
.get(datatypeID);
- if(mapper == null) return null;
+ if (mapper == null)
+ return null;
return (ISourceModelAnalyzer) createModelAnalyzer(mapper);
}
return null;
@@ -204,7 +216,8 @@
if (this.targetModelAnalyzer != null) {
ModelAnalyzer mapper = (ModelAnalyzer) this.targetModelAnalyzer
.get(datatypeID);
- if(mapper == null) return null;
+ if (mapper == null)
+ return null;
return (ITargetModelAnalyzer) createModelAnalyzer(mapper);
}
return null;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/AbstractStructuredDataModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/AbstractStructuredDataModel.java 2008-09-22 10:42:07 UTC (rev 10387)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/AbstractStructuredDataModel.java 2008-09-22 10:47:14 UTC (rev 10388)
@@ -144,7 +144,7 @@
/**
* ����Ԫ�ض����Ӵ�
*/
- private List children = new ArrayList();
+ protected List children = new ArrayList();
private AbstractStructuredDataModel parent = null;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/GraphRootModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/GraphRootModel.java 2008-09-22 10:42:07 UTC (rev 10387)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/GraphRootModel.java 2008-09-22 10:47:14 UTC (rev 10388)
@@ -10,10 +10,40 @@
******************************************************************************/
package org.jboss.tools.smooks.ui.gef.model;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
/**
* @author Dart Peng
* @Date Jul 30, 2008
*/
public class GraphRootModel extends AbstractStructuredDataModel {
+ private List<SourceModel> sourceModelList = new ArrayList<SourceModel>();
+ private List<TargetModel> targetModelList = new ArrayList<TargetModel>();
+
+ public List<SourceModel> loadSourceModelList() {
+ sourceModelList.clear();
+ for (Iterator iterator = children.iterator(); iterator.hasNext();) {
+ Object obj = (Object) iterator.next();
+ if(obj.getClass() == SourceModel.class){
+ sourceModelList.add((SourceModel)obj);
+ }
+ }
+ return sourceModelList;
+ }
+
+
+ public List<TargetModel> loadTargetModelList() {
+ targetModelList.clear();
+ for (Iterator iterator = children.iterator(); iterator.hasNext();) {
+ Object obj = (Object) iterator.next();
+ if(obj.getClass() == TargetModel.class){
+ targetModelList.add((TargetModel)obj);
+ }
+ }
+ return targetModelList;
+ }
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/UIUtils.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/UIUtils.java 2008-09-22 10:42:07 UTC (rev 10387)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/UIUtils.java 2008-09-22 10:47:14 UTC (rev 10388)
@@ -79,6 +79,7 @@
public static LineConnectionModel getFirstSourceModelViaConnection(
AbstractStructuredDataModel target) {
+ if(target == null) return null;
if (target instanceof IConnectableModel) {
List list = ((IConnectableModel) target)
.getModelSourceConnections();
@@ -91,9 +92,10 @@
}
public static LineConnectionModel getFirstTargetModelViaConnection(
- AbstractStructuredDataModel target) {
- if (target instanceof IConnectableModel) {
- List list = ((IConnectableModel) target)
+ AbstractStructuredDataModel source) {
+ if(source == null) return null;
+ if (source instanceof IConnectableModel) {
+ List list = ((IConnectableModel) source)
.getModelTargetConnections();
if (list.isEmpty())
return null;
15 years, 9 months
JBoss Tools SVN: r10387 - in trunk/smooks/plugins/org.jboss.tools.smooks.java2xml: META-INF and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-09-22 06:42:07 -0400 (Mon, 22 Sep 2008)
New Revision: 10387
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/.classpath
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/.project
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/META-INF/
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/META-INF/MANIFEST.MF
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/build.properties
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/libs/
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/libs/dom4j-1.6.1.jar
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/plugin.xml
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/Java2XMLActivator.java
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
Log:
init the projects
Added: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/.classpath
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/.classpath (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/.classpath 2008-09-22 10:42:07 UTC (rev 10387)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="lib" path="libs/dom4j-1.6.1.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/.project
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/.project (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/.project 2008-09-22 10:42:07 UTC (rev 10387)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.smooks.java2xml</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/META-INF/MANIFEST.MF
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/META-INF/MANIFEST.MF (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/META-INF/MANIFEST.MF 2008-09-22 10:42:07 UTC (rev 10387)
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Java2xml Plug-in
+Bundle-SymbolicName: org.jboss.tools.smooks.java2xml;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.jboss.tools.smooks.java2xml.Java2XMLActivator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.smooks.javabean,
+ org.jboss.tools.smooks.model,
+ org.jboss.tools.smooks.model.edit,
+ org.jboss.tools.smooks.xml,
+ org.jboss.tools.smooks.xml2java,
+ org.jboss.tools.smooks.ui,
+ org.eclipse.ui.views
+Eclipse-LazyStart: true
+Bundle-ClassPath: libs/dom4j-1.6.1.jar,
+ .
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/build.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/build.properties (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/build.properties 2008-09-22 10:42:07 UTC (rev 10387)
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ libs/dom4j-1.6.1.jar
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/libs/dom4j-1.6.1.jar
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/libs/dom4j-1.6.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/plugin.xml
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/plugin.xml (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/plugin.xml 2008-09-22 10:42:07 UTC (rev 10387)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.jboss.tools.smooks.ui.analyzer">
+ <mappingAnalyzer
+ class="org.jboss.tools.smooks.java2xml.analyzer.Java2XMLAnalyzer"
+ name="Java Bean"
+ typeID="org.jboss.tools.smooks.ui.viewerInitor.javabean">
+ <targetSourceType
+ id="org.jboss.tools.smooks.xml.viewerInitor.xml"
+ name="XML">
+ </targetSourceType>
+ </mappingAnalyzer>
+ </extension>
+
+</plugin>
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/plugin.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/Java2XMLActivator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/Java2XMLActivator.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/Java2XMLActivator.java 2008-09-22 10:42:07 UTC (rev 10387)
@@ -0,0 +1,50 @@
+package org.jboss.tools.smooks.java2xml;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Java2XMLActivator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.smooks.java2xml";
+
+ // The shared instance
+ private static Java2XMLActivator plugin;
+
+ /**
+ * The constructor
+ */
+ public Java2XMLActivator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Java2XMLActivator getDefault() {
+ return plugin;
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/Java2XMLActivator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java 2008-09-22 10:42:07 UTC (rev 10387)
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.java2xml.analyzer;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.jboss.tools.smooks.analyzer.AbstractAnalyzer;
+import org.jboss.tools.smooks.analyzer.MappingResourceConfigList;
+import org.jboss.tools.smooks.analyzer.SmooksAnalyzerException;
+import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
+import org.jboss.tools.smooks.model.ParamType;
+import org.jboss.tools.smooks.model.ResourceConfigType;
+import org.jboss.tools.smooks.model.SmooksFactory;
+import org.jboss.tools.smooks.model.SmooksResourceListType;
+import org.jboss.tools.smooks.model.util.SmooksModelUtils;
+import org.jboss.tools.smooks.ui.gef.model.AbstractStructuredDataModel;
+import org.jboss.tools.smooks.ui.gef.model.GraphRootModel;
+import org.jboss.tools.smooks.ui.gef.model.LineConnectionModel;
+import org.jboss.tools.smooks.ui.gef.model.SourceModel;
+import org.jboss.tools.smooks.ui.gef.model.TargetModel;
+import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
+import org.jboss.tools.smooks.utils.UIUtils;
+import org.jboss.tools.smooks.xml.model.AbstractXMLObject;
+import org.jboss.tools.smooks.xml.model.DocumentObject;
+import org.jboss.tools.smooks.xml.model.TagObject;
+import org.jboss.tools.smooks.xml.model.TagPropertyObject;
+
+/**
+ *
+ * @author <a href="mailto:dpeng@redhat.com">Dart Peng</a>
+ * @Date 2008-9-22
+ */
+public class Java2XMLAnalyzer extends AbstractAnalyzer {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.smooks.analyzer.IMappingAnalyzer#analyzeMappingGraphModel(org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext)
+ */
+ public void analyzeMappingGraphModel(
+ SmooksConfigurationFileGenerateContext context)
+ throws SmooksAnalyzerException {
+ GraphRootModel rootModel = context.getDataMappingRootModel();
+ List<SourceModel> sourceModelList = rootModel.loadSourceModelList();
+ List<TargetModel> targetModelList = rootModel.loadTargetModelList();
+
+ // Element rootElement = DocumentHelper.createElement(name);
+ TagObject root = null;
+ for (Iterator iterator = targetModelList.iterator(); iterator.hasNext();) {
+ TargetModel targetModel = (TargetModel) iterator.next();
+ AbstractXMLObject tag = (AbstractXMLObject) targetModel
+ .getReferenceEntityModel();
+ root = findTheRootTagObject(tag);
+ break;
+ }
+
+ if (root == null)
+ throw new SmooksAnalyzerException("can't find the root element");
+ Document document = DocumentHelper.createDocument();
+ Element rootElement = generateXMLContents(rootModel, root);
+ document.setRootElement(rootElement);
+
+ String string = document.asXML();
+
+ ResourceConfigType resource = SmooksFactory.eINSTANCE
+ .createResourceConfigType();
+ ParamType param = SmooksFactory.eINSTANCE.createParamType();
+ resource.getParam().add(param);
+ SmooksModelUtils.appendTextToSmooksType(param, string);
+ context.getGeneratorResourceList().add(resource);
+ System.out.println(string);
+ }
+
+ protected Element generateXMLContents(GraphRootModel graph, TagObject tag) {
+ Element element = DocumentHelper.createElement(tag.getName());
+ AbstractStructuredDataModel dataModel = UIUtils.findGraphModel(graph,
+ tag);
+ generateElementAttribute(graph, element, tag.getProperties());
+ List children = tag.getChildren();
+ for (Iterator iterator = children.iterator(); iterator.hasNext();) {
+ TagObject child = (TagObject) iterator.next();
+ element.add(generateXMLContents(graph, child));
+ }
+
+ if (dataModel != null) {
+ LineConnectionModel connection = UIUtils
+ .getFirstTargetModelViaConnection(dataModel);
+ if (connection != null) {
+ SourceModel source = (SourceModel) connection.getSource();
+ element
+ .add(DocumentHelper
+ .createCDATA(getTheJavaBeanString((JavaBeanModel) source
+ .getReferenceEntityModel())));
+ }
+ }
+
+ return element;
+ }
+
+ protected void generateElementAttribute(GraphRootModel graph,
+ Element element, List<TagPropertyObject> properties) {
+ for (Iterator iterator = properties.iterator(); iterator.hasNext();) {
+ TagPropertyObject tagPropertyObject = (TagPropertyObject) iterator
+ .next();
+
+ AbstractStructuredDataModel dataModel = UIUtils.findGraphModel(
+ graph, tagPropertyObject);
+ LineConnectionModel connect = UIUtils
+ .getFirstTargetModelViaConnection(dataModel);
+ if (connect == null)
+ continue;
+
+ SourceModel source = (SourceModel) connect.getSource();
+
+ element.addAttribute(tagPropertyObject.getName(),
+ getTheJavaBeanString((JavaBeanModel) source
+ .getReferenceEntityModel()));
+ }
+ }
+
+ protected TagObject findTheRootTagObject(AbstractXMLObject obj) {
+ AbstractXMLObject parent = obj.getParent();
+ if (parent instanceof DocumentObject && obj instanceof TagObject)
+ return (TagObject) obj;
+ return (TagObject) findTheRootTagObject(parent);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.smooks.analyzer.IMappingAnalyzer#analyzeMappingSmooksModel(org.jboss.tools.smooks.model.SmooksResourceListType,
+ * java.lang.Object, java.lang.Object)
+ */
+ public MappingResourceConfigList analyzeMappingSmooksModel(
+ SmooksResourceListType listType, Object sourceObject,
+ Object targetObject) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ protected String getTheJavaBeanString(JavaBeanModel currentModel) {
+ String name = currentModel.getName();
+ JavaBeanModel parent = currentModel.getParent();
+ while (parent != null ) {
+ String pn = parent.getName();
+ if (pn != null) {
+ name = parent.getName() + "." + name;
+ }
+ parent = parent.getParent();
+ }
+ return "${" + name + "}";
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 9 months
JBoss Tools SVN: r10386 - trunk/smooks/plugins.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-09-22 06:39:03 -0400 (Mon, 22 Sep 2008)
New Revision: 10386
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/
Log:
add new plugins for generate/parse Java-XML smooks configuration file
15 years, 9 months
JBoss Tools SVN: r10385 - trunk/seam/plugins/org.jboss.tools.seam.core/templates/test.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-09-19 17:41:05 -0400 (Fri, 19 Sep 2008)
New Revision: 10385
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.project
Log:
JBIDE-2796 - this test project should not have the archives nature / builder.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.project 2008-09-19 20:55:21 UTC (rev 10384)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.project 2008-09-19 21:41:05 UTC (rev 10385)
@@ -10,11 +10,6 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand>
- <name>org.jboss.ide.eclipse.archives.core.archivesBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
<buildCommand>
<name>org.jboss.tools.seam.core.seambuilder</name>
<arguments>
@@ -22,7 +17,6 @@
</buildCommand>
</buildSpec>
<natures>
- <nature>org.jboss.ide.eclipse.archives.core.archivesNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.jboss.tools.seam.core.seamnature</nature>
</natures>
15 years, 9 months
JBoss Tools SVN: r10384 - in trunk/archives: plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-09-19 16:55:21 -0400 (Fri, 19 Sep 2008)
New Revision: 10384
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/project/ArchivesBuilder.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ModelChangeListener.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/ModelTruezipBridge.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/BuildAction.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ProjectArchivesCommonView.java
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelTruezipBridgeTest.java
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE1406Test.java
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2099Test.java
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2311Test.java
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2315Test.java
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2439Test.java
Log:
JBIDE-475 - archives progress monitors added
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/project/ArchivesBuilder.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/project/ArchivesBuilder.java 2008-09-19 19:48:39 UTC (rev 10383)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/project/ArchivesBuilder.java 2008-09-19 20:55:21 UTC (rev 10384)
@@ -50,25 +50,25 @@
/**
* This builder is responsible for building the archives
- * It delegates to a delegate.
+ * It delegates to a delegate.
* @author Rob Stryker (rob.stryker(a)redhat.com)
*
*/
public class ArchivesBuilder extends IncrementalProjectBuilder {
public static final String BUILDER_ID = "org.jboss.ide.eclipse.archives.core.archivesBuilder";
-
+
/**
- * Build.
+ * Build.
* @see IncrementalProjectBuilder#build(int, Map, IProgressMonitor)
- * @see IProject#build(int, String, Map, IProgressMonitor)
+ * @see IProject#build(int, String, Map, IProgressMonitor)
*/
protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
-
+
// if we're not to build, get out of here
- if( !ArchivesCore.getInstance().getPreferenceManager().isBuilderEnabled(getProject().getLocation()))
+ if( !ArchivesCore.getInstance().getPreferenceManager().isBuilderEnabled(getProject().getLocation()))
return new IProject[]{};
-
+
IProject[] interestingProjects = getInterestingProjectsInternal();
final TreeSet<IPath> addedChanged = createPathTreeSet();
@@ -77,20 +77,19 @@
ArchiveBuildDelegate delegate = new ArchiveBuildDelegate();
if (kind == IncrementalProjectBuilder.INCREMENTAL_BUILD || kind == IncrementalProjectBuilder.AUTO_BUILD) {
fillDeltas(interestingProjects, addedChanged, removed);
- delegate.incrementalBuild(null,addedChanged, removed,true);
-
+ delegate.incrementalBuild(null,addedChanged, removed,true, monitor);
} else if (kind == IncrementalProjectBuilder.FULL_BUILD){
// build each package fully
IProject p = getProject();
- delegate.fullProjectBuild(p.getLocation());
+ delegate.fullProjectBuild(p.getLocation(), monitor);
}
-
+
return interestingProjects;
}
-
+
/**
* Delete all archives that were created or represented by this
- * project's archive model.
+ * project's archive model.
*/
protected void clean(IProgressMonitor monitor) throws CoreException {
IPath p = getProject().getLocation();
@@ -106,7 +105,7 @@
/**
* Browse through the deltas and fill the treesets with
- * affected resources.
+ * affected resources.
* @param projects The interesting projects
* @param addedChanged A collection of resources that have been added or changed
* @param removed A collection of resources that have been removed.
@@ -117,20 +116,20 @@
IResourceDelta delta = getDelta(proj);
if( delta == null ) continue;
try {
- delta.accept(new IResourceDeltaVisitor () {
+ delta.accept(new IResourceDeltaVisitor () {
public boolean visit(IResourceDelta delta) throws CoreException {
if (delta.getResource().getType() == IResource.FILE) {
- if( (delta.getKind() & IResourceDelta.ADDED) > 0
+ if( (delta.getKind() & IResourceDelta.ADDED) > 0
|| (delta.getKind() & IResourceDelta.CHANGED) > 0) {
-
- // ignore the packages project. that will it's own build call,
+
+ // ignore the packages project. that will it's own build call,
// or will handle the change in some other way
- if( !delta.getResource().equals(proj.findMember(IArchiveModel.DEFAULT_PACKAGES_FILE)))
+ if( !delta.getResource().equals(proj.findMember(IArchiveModel.DEFAULT_PACKAGES_FILE)))
addedChanged.add(delta.getResource().getFullPath());
} else if( (delta.getKind() & IResourceDelta.REMOVED ) > 0 ) {
removed.add(delta.getResource().getFullPath());
}
- }
+ }
return true;
}
});
@@ -138,17 +137,17 @@
}
}
}
-
+
/**
- * Get any projects that the current project may depend on
- * (regarding it's archive model, if any filesets match files in
+ * Get any projects that the current project may depend on
+ * (regarding it's archive model, if any filesets match files in
* another project).
* @return The list of projects that matter
*/
protected IProject[] getInterestingProjectsInternal() {
final TreeSet<IProject> set = createProjectTreeSet();
set.add(getProject());
-
+
final IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
IArchiveModelRootNode root = ArchivesModel.instance().getRoot(getProject().getLocation());
@@ -160,7 +159,7 @@
IPath p = PathUtils.getGlobalLocation(fileset);
if( p != null ) {
IContainer[] containers = workspaceRoot.findContainersForLocation(p);
- for( int i = 0; i < containers.length; i++ ) {
+ for( int i = 0; i < containers.length; i++ ) {
set.add(containers[i].getProject());
}
}
@@ -173,8 +172,8 @@
return new IProject[0];
}
}
-
- /**
+
+ /**
* Default treeset with default comparator
* @return
*/
@@ -184,15 +183,15 @@
if (o1.equals(o2)) return 0;
else return -1;
}
- });
+ });
}
-
+
protected TreeSet<IPath> createPathTreeSet() {
return new TreeSet<IPath>(new Comparator<IPath> () {
public int compare(IPath o1, IPath o2) {
if (o1.equals(o2)) return 0;
else return -1;
}
- });
+ });
}
}
\ No newline at end of file
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java 2008-09-19 19:48:39 UTC (rev 10383)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java 2008-09-19 20:55:21 UTC (rev 10384)
@@ -33,7 +33,6 @@
import org.jboss.ide.eclipse.archives.core.ArchivesCore;
import org.jboss.ide.eclipse.archives.core.build.ArchiveBuildDelegate;
import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
-import org.jboss.ide.eclipse.archives.core.model.IArchivesLogger;
/**
* @author rob.stryker <rob.stryker(a)redhat.com>
@@ -72,7 +71,7 @@
Thread.currentThread().setContextClassLoader(myCL);
if( ArchivesModel.instance().canReregister(projectPath)) {
ArchivesModel.instance().registerProject(projectPath, monitor);
- new ArchiveBuildDelegate().fullProjectBuild(projectPath);
+ new ArchiveBuildDelegate().fullProjectBuild(projectPath, new NullProgressMonitor());
} else {
getCore().getLogger().log(IStatus.ERROR, "Project \"" + projectPath + "\" does not exist or has no .packages file. Skipping.", null);
}
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java 2008-09-19 19:48:39 UTC (rev 10383)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java 2008-09-19 20:55:21 UTC (rev 10384)
@@ -27,13 +27,15 @@
import java.util.Set;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
import org.jboss.ide.eclipse.archives.core.ArchivesCore;
import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
import org.jboss.ide.eclipse.archives.core.model.EventManager;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveAction;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
import org.jboss.ide.eclipse.archives.core.model.IArchiveModelRootNode;
@@ -64,7 +66,7 @@
* A full project build has been requested.
* @param project The project containing the archive model
*/
- public void fullProjectBuild(IPath project) {
+ public void fullProjectBuild(IPath project, IProgressMonitor monitor) {
EventManager.cleanProjectBuild(project);
EventManager.startedBuild(project);
@@ -72,15 +74,21 @@
if( root == null ) {
IStatus s = new Status(IStatus.ERROR, ArchivesCore.PLUGIN_ID, "An error occurred locating the root node for " + project.toOSString(), null);
EventManager.error(null, new IStatus[]{s});
+ monitor.done();
} else {
IArchiveNode[] nodes = root.getChildren(IArchiveNode.TYPE_ARCHIVE);
ArrayList<IStatus> errors = new ArrayList<IStatus>();
+
+ monitor.beginTask("Building project " + ArchivesCore.getInstance().getVFS().getProjectName(project), nodes.length * 1000);
+
for( int i = 0; i < nodes.length; i++ ) {
- errors.addAll(Arrays.asList(fullArchiveBuild(((IArchive)nodes[i]), false)));
+ errors.addAll(Arrays.asList(fullArchiveBuild(((IArchive)nodes[i]),
+ new SubProgressMonitor(monitor, 1000), false)));
}
EventManager.finishedBuild(project);
EventManager.error(null, errors.toArray(new IStatus[errors.size()]));
+ monitor.done();
}
}
@@ -88,17 +96,18 @@
* Builds an archive entirely, overwriting whatever was in the output destination.
* @param pkg The archive to build
*/
- public IStatus[] fullArchiveBuild(IArchive pkg) {
- return fullArchiveBuild(pkg, true);
+ public IStatus[] fullArchiveBuild(IArchive pkg, IProgressMonitor monitor) {
+ return fullArchiveBuild(pkg, monitor, true);
}
- protected IStatus[] fullArchiveBuild(IArchive pkg, boolean log) {
+ protected IStatus[] fullArchiveBuild(IArchive pkg, IProgressMonitor monitor, boolean log) {
if( !pkg.canBuild() ) {
IStatus s = new Status(IStatus.ERROR, ArchivesCore.PLUGIN_ID,
"Cannot Build archive \"" + pkg.getName() +
"\" due to a problem in the archive's configuration.", null);
if( log )
EventManager.error(pkg, new IStatus[]{s});
- return new IStatus[]{};
+ monitor.done();
+ return new IStatus[]{s};
}
EventManager.cleanArchiveBuild(pkg);
@@ -114,52 +123,70 @@
" is not writeable", null);
if( log )
EventManager.error(pkg, new IStatus[]{s});
- return new IStatus[]{};
+ monitor.done();
+ return new IStatus[]{s};
}
}
ArrayList<IStatus> errors = new ArrayList<IStatus>();
+ /* 3 steps:
+ * create file: 200
+ * create folders: 800
+ * build filesets: 7000
+ */
+ monitor.beginTask("Building Archive " + pkg.toString(), 8000);
+
// Run the pre actions
- IArchiveAction[] actions = pkg.getActions();
- for( int i = 0; i < actions.length; i++ ) {
- if( actions[i].getTime().equals(IArchiveAction.PRE_BUILD)) {
- actions[i].execute();
- }
- }
+// IArchiveAction[] actions = pkg.getActions();
+// for( int i = 0; i < actions.length; i++ ) {
+// if( actions[i].getTime().equals(IArchiveAction.PRE_BUILD)) {
+// actions[i].execute();
+// }
+// }
+
if( !ModelTruezipBridge.createFile(pkg) ) {
IStatus e = new Status(IStatus.ERROR, ArchivesCore.PLUGIN_ID, "Error creating output file for node " + pkg.toString());
errors.add(e);
}
+ monitor.worked(200);
// force create all folders
IArchiveFolder[] folders = ModelUtil.findAllDescendentFolders(pkg);
+ IProgressMonitor folderMonitor = new SubProgressMonitor(monitor, 800);
+ folderMonitor.beginTask("Creating folders", folders.length * 100);
for( int i = 0; i < folders.length; i++ ) {
if( !ModelTruezipBridge.createFile(folders[i])) {
IStatus e = new Status(IStatus.ERROR, ArchivesCore.PLUGIN_ID, "Error creating output file for node " + folders[i].toString());
errors.add(e);
}
+ folderMonitor.worked(100);
}
+ folderMonitor.done();
// build the filesets
IArchiveFileSet[] filesets = ModelUtil.findAllDescendentFilesets(pkg);
+ IProgressMonitor filesetMonitor = new SubProgressMonitor(monitor, 7000);
+ filesetMonitor.beginTask("Building filesets", filesets.length * 1000);
for( int i = 0; i < filesets.length; i++ ) {
- IStatus[] errors2 = fullFilesetBuild(filesets[i], pkg);
+ IStatus[] errors2 = fullFilesetBuild(filesets[i], new SubProgressMonitor(filesetMonitor, 1000), pkg);
errors.addAll(Arrays.asList(errors2));
}
+ filesetMonitor.done();
- // Run the post actions
- for( int i = 0; i < actions.length; i++ ) {
- if( actions[i].getTime().equals(IArchiveAction.POST_BUILD)) {
- actions[i].execute();
- }
- }
+// // Run the post actions
+// for( int i = 0; i < actions.length; i++ ) {
+// if( actions[i].getTime().equals(IArchiveAction.POST_BUILD)) {
+// actions[i].execute();
+// }
+// }
EventManager.finishedBuildingArchive(pkg);
IStatus[] errors2 = errors.toArray(new IStatus[errors.size()]);
if( log )
EventManager.error(pkg, errors2 );
+ monitor.done();
return errors2;
}
@@ -168,14 +195,14 @@
* @param fileset The fileset to match
* @param topLevel The top level archive that the fileset belongs to
*/
- protected IStatus[] fullFilesetBuild(IArchiveFileSet fileset, IArchive topLevel) {
+ protected IStatus[] fullFilesetBuild(IArchiveFileSet fileset, IProgressMonitor monitor, IArchive topLevel) {
EventManager.startedCollectingFileSet(fileset);
// reset the scanner. It *is* a full build afterall
fileset.resetScanner();
FileWrapper[] paths = fileset.findMatchingPaths();
- FileWrapperStatusPair result = ModelTruezipBridge.fullFilesetBuild(fileset, true);
+ FileWrapperStatusPair result = ModelTruezipBridge.fullFilesetBuild(fileset, monitor, true);
EventManager.filesUpdated(topLevel, fileset, paths);
EventManager.finishedCollectingFileSet(fileset);
@@ -191,9 +218,13 @@
* @param removed A list of removed resource paths
*/
public void incrementalBuild(IArchive archive, Set<IPath> addedChanged,
- Set<IPath> removed, boolean workspaceRelative) {
+ Set<IPath> removed, boolean workspaceRelative, IProgressMonitor monitor) {
ArrayList<IStatus> errors = new ArrayList<IStatus>();
+ // removed get more work because all filesets are being rescanned before handling the removed
+ int totalWork = (addedChanged.size()*100) + (removed.size()*200) + 50;
+ monitor.beginTask("Project Archives Incremental Build", totalWork);
+
// find any and all filesets that match each file
Iterator<IPath> i;
IPath path, globalPath;
@@ -212,13 +243,16 @@
matchingFilesets = ModelUtil.getMatchingFilesets(archive, path, workspaceRelative);
localFireAffectedTopLevelPackages(topPackagesChanged, matchingFilesets);
for( int j = 0; j < matchingFilesets.length; j++ ) {
- IStatus[] errors2 = ModelTruezipBridge.deleteFiles(matchingFilesets[j], matchingFilesets[j].getMatches(globalPath), true);
+ IStatus[] errors2 = ModelTruezipBridge.deleteFiles(
+ matchingFilesets[j], matchingFilesets[j].getMatches(globalPath),
+ new NullProgressMonitor(), true);
errors.addAll(Arrays.asList(errors2));
if( !seen.contains(matchingFilesets[j])) {
seen.add(matchingFilesets[j]);
}
}
EventManager.fileRemoved(path, matchingFilesets);
+ monitor.worked(100);
}
// reset all of the filesets that have already matched
@@ -238,15 +272,17 @@
seen.add(matchingFilesets[j]);
matchingFilesets[j].resetScanner();
}
- IStatus[] errors2 = ModelTruezipBridge.copyFiles(matchingFilesets[j], matchingFilesets[j].getMatches(globalPath), true);
+ IStatus[] errors2 = ModelTruezipBridge.copyFiles(matchingFilesets[j],
+ matchingFilesets[j].getMatches(globalPath),
+ new NullProgressMonitor(), true);
errors.addAll(Arrays.asList(errors2));
}
EventManager.fileUpdated(path, matchingFilesets);
+ monitor.worked(200);
}
TrueZipUtil.sync();
-
Iterator<IArchive> i2 = topPackagesChanged.iterator();
while(i2.hasNext()) {
EventManager.finishedBuildingArchive(i2.next());
@@ -254,6 +290,9 @@
if( errors.size() > 0 )
EventManager.error(null, errors.toArray(new IStatus[errors.size()]));
+
+ monitor.worked(50);
+ monitor.done();
}
private void localFireAffectedTopLevelPackages(ArrayList<IArchive> affected, IArchiveFileSet[] filesets) {
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ModelChangeListener.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ModelChangeListener.java 2008-09-19 19:48:39 UTC (rev 10383)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ModelChangeListener.java 2008-09-19 20:55:21 UTC (rev 10384)
@@ -21,8 +21,13 @@
*/
package org.jboss.ide.eclipse.archives.core.build;
+import java.util.ArrayList;
+import java.util.Arrays;
+
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
import org.jboss.ide.eclipse.archives.core.ArchivesCore;
import org.jboss.ide.eclipse.archives.core.model.EventManager;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
@@ -32,7 +37,6 @@
import org.jboss.ide.eclipse.archives.core.model.IArchiveModelRootNode;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNodeDelta;
-import org.jboss.ide.eclipse.archives.core.model.IArchivesLogger;
import org.jboss.ide.eclipse.archives.core.model.DirectoryScannerFactory.DirectoryScannerExtension.FileWrapper;
import org.jboss.ide.eclipse.archives.core.util.ModelUtil;
import org.jboss.ide.eclipse.archives.core.util.internal.ModelTruezipBridge;
@@ -61,11 +65,15 @@
if( !ArchivesCore.getInstance().getPreferenceManager().isBuilderEnabled(delta.getPostNode().getProjectPath()))
return;
+ IStatus[] errors;
try {
- handle(delta);
+ errors = handle(delta);
} catch( Exception e ) {
- ArchivesCore.getInstance().getLogger().log(IStatus.ERROR, "Error updating model changes", e);
+ IStatus er = new Status(IStatus.ERROR, ArchivesCore.PLUGIN_ID, "Error updating model changes", e);
+ errors = new IStatus[] { er };
}
+ IArchiveNode node = delta.getPreNode() == null ? delta.getPostNode() : delta.getPreNode();
+ EventManager.error(node, errors);
}
/**
@@ -80,36 +88,37 @@
*
* @param delta
*/
- private void handle(IArchiveNodeDelta delta) {
+ private IStatus[] handle(IArchiveNodeDelta delta) {
+ ArrayList<IStatus> errors = new ArrayList<IStatus>();
if( isTopLevelArchive(delta.getPostNode())) {
EventManager.startedBuildingArchive((IArchive)delta.getPostNode());
}
if( (delta.getKind() & (IArchiveNodeDelta.NODE_REGISTERED | IArchiveNodeDelta.UNKNOWN_CHANGE)) != 0 ) {
- nodeRemoved(delta.getPreNode());
- nodeAdded(delta.getPostNode());
+ errors.addAll(Arrays.asList(nodeRemoved(delta.getPreNode())));
+ errors.addAll(Arrays.asList(nodeAdded(delta.getPostNode())));
} if( (delta.getKind() & IArchiveNodeDelta.REMOVED) != 0 ) {
- nodeRemoved(delta.getPreNode());
+ errors.addAll(Arrays.asList(nodeRemoved(delta.getPreNode())));
} else if( (delta.getKind() & IArchiveNodeDelta.ADDED) != 0 ) {
- nodeAdded(delta.getPostNode());
+ errors.addAll(Arrays.asList(nodeAdded(delta.getPostNode())));
} else if( (delta.getKind() & IArchiveNodeDelta.ATTRIBUTE_CHANGED) != 0) {
boolean shouldHandleChildren = handleAttributeChange(delta);
if( shouldHandleChildren ) {
IArchiveNodeDelta[] children = delta.getAllAffectedChildren();
for( int i = 0; i < children.length; i++ ) {
- handle(children[i]);
+ errors.addAll(Arrays.asList(handle(children[i])));
}
}
} else if( descendentChanged(delta.getKind()) ) {
IArchiveNodeDelta[] children = delta.getAllAffectedChildren();
for( int i = 0; i < children.length; i++ ) {
- handle(children[i]);
+ errors.addAll(Arrays.asList(handle(children[i])));
}
}
if( isTopLevelArchive(delta.getPostNode()))
EventManager.finishedBuildingArchive((IArchive)delta.getPostNode());
-
+ return errors.toArray(new IStatus[errors.size()]);
}
protected boolean descendentChanged(int kind) {
return (kind & IArchiveNodeDelta.DESCENDENT_CHANGED) != 0 ||
@@ -163,19 +172,20 @@
- private void nodeAdded(IArchiveNode added) {
- if( added == null ) return;
+ private IStatus[] nodeAdded(IArchiveNode added) {
+ ArrayList<IStatus> errors = new ArrayList<IStatus>();
+ if( added == null )
+ return new IStatus[]{};
if( added.getNodeType() == IArchiveNode.TYPE_MODEL_ROOT) {
IArchiveNode[] archives = ((IArchiveModelRootNode)added).getChildren(IArchiveNode.TYPE_ARCHIVE);
for( int i = 0; i < archives.length; i++ ) {
- nodeAdded(archives[i]);
+ errors.addAll(Arrays.asList(nodeAdded(archives[i])));
}
} else if( added.getNodeType() == IArchiveNode.TYPE_ARCHIVE) {
// create the package
if( ((IArchive)added).isTopLevel() && !added.canBuild() ) {
- logCannotBuildError((IArchive)added);
- return;
+ return new IStatus[] { logCannotBuildError((IArchive)added)};
}
ModelTruezipBridge.createFile(added);
} else if( added.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FOLDER ) {
@@ -184,51 +194,55 @@
}
IArchiveFileSet[] filesets = ModelUtil.findAllDescendentFilesets(added);
for( int i = 0; i < filesets.length; i++ ) {
- FileWrapperStatusPair result = ModelTruezipBridge.fullFilesetBuild(filesets[i], true);
+ FileWrapperStatusPair result = ModelTruezipBridge.fullFilesetBuild(filesets[i], new NullProgressMonitor(), true);
+ errors.addAll(Arrays.asList(result.s));
FileWrapper[] files = filesets[i].findMatchingPaths();
- EventManager.error(filesets[i], result.s);
EventManager.filesUpdated(filesets[i].getRootArchive(), filesets[i], files);
}
postChange(added);
+ return errors.toArray(new IStatus[errors.size()]);
}
- private void nodeRemoved(IArchiveNode removed) {
- if( removed == null ) return;
+ private IStatus[] nodeRemoved(IArchiveNode removed) {
+ ArrayList<IStatus> errors = new ArrayList<IStatus>();
+ if( removed == null )
+ return new IStatus[] {};
if( removed.getNodeType() == IArchiveNode.TYPE_MODEL_ROOT ) {
// remove all top level items
IArchiveNode[] kids = removed.getChildren(IArchiveNode.TYPE_ARCHIVE);
for( int i = 0; i < kids.length; i++ ) {
- nodeRemoved(kids[i]);
+ errors.addAll(Arrays.asList(nodeRemoved(kids[i])));
}
postChange(removed);
- return;
+ return errors.toArray(new IStatus[errors.size()]);
} else if( removed.getNodeType() == IArchiveNode.TYPE_ARCHIVE) {
if( ((IArchive)removed).isTopLevel() && !removed.canBuild() ) {
- logCannotBuildError((IArchive)removed);
- return;
+ return new IStatus[] {logCannotBuildError((IArchive)removed)};
}
ModelTruezipBridge.deleteArchive((IArchive)removed);
postChange(removed);
- return;
+ return new IStatus[] {};
} else if( removed.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FOLDER ){
IArchiveFileSet[] filesets = ModelUtil.findAllDescendentFilesets(((IArchiveFolder)removed));
for( int i = 0; i < filesets.length; i++ ) {
- // TODO report IO Errors
- FileWrapperStatusPair result = ModelTruezipBridge.fullFilesetRemove(filesets[i], false);
+ FileWrapperStatusPair result = ModelTruezipBridge.fullFilesetRemove(filesets[i], new NullProgressMonitor(), false);
+ errors.addAll(Arrays.asList(result.s));
EventManager.filesRemoved(convertToPath(result.f), ((IArchiveFileSet)filesets[i]));
}
postChange(removed);
- return;
+ return errors.toArray(new IStatus[errors.size()]);
}
IArchiveFileSet[] filesets = ModelUtil.findAllDescendentFilesets(removed);
for( int i = 0; i < filesets.length; i++ ) {
FileWrapperStatusPair result = ModelTruezipBridge.fullFilesetRemove(
- ((IArchiveFileSet)removed), false);
+ ((IArchiveFileSet)removed), new NullProgressMonitor(), false);
EventManager.filesRemoved(convertToPath(result.f), ((IArchiveFileSet)removed));
+ errors.addAll(Arrays.asList(result.s));
}
postChange(removed);
+ return errors.toArray(new IStatus[errors.size()]);
}
protected IPath[] convertToPath(FileWrapper[] wrappers) {
@@ -241,10 +255,10 @@
protected void postChange(IArchiveNode node) {
}
- protected void logCannotBuildError(IArchive archive) {
- ArchivesCore.getInstance().getLogger().log(IStatus.WARNING,
+ protected IStatus logCannotBuildError(IArchive archive) {
+ IStatus s = new Status(IStatus.WARNING, ArchivesCore.PLUGIN_ID,
"Cannot Build archive \"" + archive.getName() +
"\" due to a problem in the archive's configuration.", null);
- return;
+ return s;
}
}
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/ModelTruezipBridge.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/ModelTruezipBridge.java 2008-09-19 19:48:39 UTC (rev 10383)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/ModelTruezipBridge.java 2008-09-19 20:55:21 UTC (rev 10384)
@@ -25,9 +25,12 @@
import java.util.Arrays;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
import org.jboss.ide.eclipse.archives.core.ArchivesCore;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
@@ -64,9 +67,9 @@
this.s = statuses;
}
}
- public static FileWrapperStatusPair fullFilesetBuild(final IArchiveFileSet fileset, boolean sync) {
+ public static FileWrapperStatusPair fullFilesetBuild(final IArchiveFileSet fileset, IProgressMonitor monitor, boolean sync) {
FileWrapper[] files = fileset.findMatchingPaths();
- IStatus[] s = copyFiles(fileset, files, false);
+ IStatus[] s = copyFiles(fileset, files, monitor, false);
if( sync )
TrueZipUtil.sync();
return new FileWrapperStatusPair( files, s );
@@ -79,19 +82,24 @@
* IStatus[] errors
* }
*/
- public static FileWrapperStatusPair fullFilesetRemove(final IArchiveFileSet fileset, boolean sync) {
+ public static FileWrapperStatusPair fullFilesetRemove(final IArchiveFileSet fileset, IProgressMonitor monitor, boolean sync) {
+ monitor.beginTask("Removing fileset: " + fileset.toString(), 2500);
FileWrapper[] files = fileset.findMatchingPaths();
final ArrayList<IStatus> errors = new ArrayList<IStatus>();
final ArrayList<FileWrapper> list = new ArrayList<FileWrapper>();
list.addAll(Arrays.asList(files));
+ IProgressMonitor filesMonitor = new SubProgressMonitor(monitor, 2000);
+ filesMonitor.beginTask("Removing " + files.length + " files", files.length * 100);
for( int i = 0; i < files.length; i++ ) {
if( !ModelUtil.otherFilesetMatchesPathAndOutputLocation(fileset, files[i])) {
// remove
- errors.addAll(Arrays.asList(deleteFiles(fileset, new FileWrapper[] {files[i]}, false)));
+ errors.addAll(Arrays.asList(deleteFiles(fileset, new FileWrapper[] {files[i]}, new NullProgressMonitor(), false)));
} else {
list.remove(files[i]);
}
+ filesMonitor.worked(100);
}
+ filesMonitor.done();
// kinda ugly here. delete all empty folders beneath
File folder = getFile(fileset);
@@ -99,6 +107,7 @@
IStatus e = new Status(IStatus.ERROR, ArchivesCore.PLUGIN_ID, "Error emptying folder " + folder.toString());
errors.add(e);
}
+ monitor.worked(250);
// now ensure all mandatory child folders are still there
fileset.getParent().accept(new IArchiveNodeVisitor() {
@@ -119,45 +128,16 @@
if( sync )
TrueZipUtil.sync();
+ monitor.worked(250);
+ monitor.done();
+
IStatus[] errorsArr = errors.toArray(new IStatus[errors.size()]);
FileWrapper[] files2 = list.toArray(new FileWrapper[list.size()]);
return new FileWrapperStatusPair( files2, errorsArr);
}
- public static boolean deleteArchive(IArchive archive) {
- final File file = getFile(archive);
- boolean b = file.deleteAll();
- TrueZipUtil.sync();
- return b;
- }
-
- public static boolean cleanFolder(IArchiveFolder folder) {
- return cleanFolder(getFile(folder), true);
- }
-
- public static boolean cleanFolder(java.io.File folder, boolean sync) {
- boolean b = TrueZipUtil.deleteEmptyChildren(folder);
- if( sync )
- TrueZipUtil.sync();
- return b;
- }
-
-
- public static IStatus[] copyFiles(IArchiveFileSet[] filesets, FileWrapper[] files) {
- return copyFiles(filesets, files, true);
- }
-
- public static IStatus[] copyFiles(final IArchiveFileSet[] filesets, final FileWrapper[] files, boolean sync) {
- ArrayList<IStatus> list = new ArrayList<IStatus>();
- for( int i = 0; i < filesets.length; i++ ) {
- list.addAll(Arrays.asList(copyFiles(filesets[i], files, false)));
- }
- if( sync )
- TrueZipUtil.sync();
- return list.toArray(new IStatus[list.size()]);
- }
-
- public static IStatus[] copyFiles(IArchiveFileSet fileset, final FileWrapper[] files, boolean sync) {
+ public static IStatus[] copyFiles(IArchiveFileSet fileset, final FileWrapper[] files, IProgressMonitor monitor, boolean sync) {
+ monitor.beginTask("Copying " + files.length + " files", files.length * 100);
boolean b = true;
ArrayList<IStatus> list = new ArrayList<IStatus>();
final File[] destFiles = getFiles(files, fileset);
@@ -166,21 +146,19 @@
if( b == false ) {
list.add(new Status(IStatus.ERROR, ArchivesCore.PLUGIN_ID, "File copy failed. Source=" + files[i].getAbsolutePath() + ", dest=" + destFiles[i]));
}
+ monitor.worked(100);
}
if( sync )
TrueZipUtil.sync();
+ monitor.done();
return list.toArray(new IStatus[list.size()]);
}
-
/*
* Deleting files
*/
-
- public static IStatus[] deleteFiles(IArchiveFileSet fileset, final FileWrapper[] paths ) {
- return deleteFiles(fileset, paths, true);
- }
- public static IStatus[] deleteFiles(IArchiveFileSet fileset, final FileWrapper[] files, boolean sync ) {
+ public static IStatus[] deleteFiles(IArchiveFileSet fileset, final FileWrapper[] files, IProgressMonitor monitor, boolean sync ) {
+ monitor.beginTask("Deleting " + files.length + " files", files.length * 100);
final File[] destFiles = getFiles(files, fileset);
ArrayList<IStatus> list = new ArrayList<IStatus>();
for( int i = 0; i < files.length; i++ ) {
@@ -188,13 +166,33 @@
IStatus e = new Status(IStatus.ERROR, ArchivesCore.PLUGIN_ID, "Error deleting file " + destFiles[i].toString());
list.add(e);
}
+ monitor.worked(100);
}
if( sync )
TrueZipUtil.sync();
+ monitor.done();
return list.toArray(new IStatus[list.size()]);
}
+ public static boolean deleteArchive(IArchive archive) {
+ final File file = getFile(archive);
+ boolean b = file.deleteAll();
+ TrueZipUtil.sync();
+ return b;
+ }
+
+ public static boolean cleanFolder(IArchiveFolder folder) {
+ return cleanFolder(getFile(folder), true);
+ }
+
+ public static boolean cleanFolder(java.io.File folder, boolean sync) {
+ boolean b = TrueZipUtil.deleteEmptyChildren(folder);
+ if( sync )
+ TrueZipUtil.sync();
+ return b;
+ }
+
/**
* Creates the file, folder, or archive represented by the node.
* Does nothing for filesets
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/BuildAction.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/BuildAction.java 2008-09-19 19:48:39 UTC (rev 10383)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/BuildAction.java 2008-09-19 20:55:21 UTC (rev 10384)
@@ -25,7 +25,7 @@
}
public void run(IAction action) {
- if( selectedProject != null )
+ if( selectedProject != null )
buildSelectedNode(selectedProject);
}
@@ -39,25 +39,26 @@
if( o instanceof IAdaptable ) {
IResource res = (IResource) ((IAdaptable)o).getAdapter(IResource.class);
if( res != null ) {
- selectedProject = res.getProject();
+ selectedProject = res.getProject();
return;
}
}
}
selectedProject = null;
}
-
+
private void buildSelectedNode(final Object selected) {
new Job("Build Archive Node") {
+ // TODO actually get the status object
protected IStatus run(IProgressMonitor monitor) {
if( selected == null ) return Status.OK_STATUS;
- if (selected instanceof IArchiveNode &&
+ if (selected instanceof IArchiveNode &&
((IArchiveNode)selected).getNodeType() == IArchiveNode.TYPE_ARCHIVE) {
- new ArchiveBuildDelegate().fullArchiveBuild((IArchive)selected);
+ new ArchiveBuildDelegate().fullArchiveBuild((IArchive)selected, monitor);
} else if( selected != null && selected instanceof IProject ){
- new ArchiveBuildDelegate().fullProjectBuild(((IProject)selected).getProject().getLocation());
+ new ArchiveBuildDelegate().fullProjectBuild(((IProject)selected).getProject().getLocation(), monitor);
} else {
- new ArchiveBuildDelegate().fullArchiveBuild(((IArchiveNode)selected).getRootArchive());
+ new ArchiveBuildDelegate().fullArchiveBuild(((IArchiveNode)selected).getRootArchive(), monitor);
}
return Status.OK_STATUS;
}
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ProjectArchivesCommonView.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ProjectArchivesCommonView.java 2008-09-19 19:48:39 UTC (rev 10383)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ProjectArchivesCommonView.java 2008-09-19 20:55:21 UTC (rev 10384)
@@ -4,10 +4,6 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -22,12 +18,11 @@
import org.eclipse.ui.navigator.CommonNavigator;
import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.ui.views.properties.PropertySheetPage;
-import org.jboss.ide.eclipse.archives.core.build.ArchiveBuildDelegate;
-import org.jboss.ide.eclipse.archives.core.model.IArchive;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
import org.jboss.ide.eclipse.archives.ui.PrefsInitializer;
import org.jboss.ide.eclipse.archives.ui.PrefsInitializer.IArchivesPreferenceListener;
+import org.jboss.ide.eclipse.archives.ui.actions.BuildAction;
import org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProviderDelegate.WrappedProject;
public class ProjectArchivesCommonView extends CommonNavigator implements IArchivesPreferenceListener {
@@ -44,18 +39,18 @@
currentProject = null;
return ResourcesPlugin.getWorkspace().getRoot();
}
-
+
public void createPartControl(Composite aParent) {
super.createPartControl(aParent);
addBuildActionToSite();
PrefsInitializer.addListener(this);
}
-
+
public void init(IViewSite site) throws PartInitException {
super.init(site);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().addPostSelectionListener(selectionListener);
}
-
+
public void dispose() {
super.dispose();
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().removePostSelectionListener(selectionListener);
@@ -65,11 +60,11 @@
protected ISelectionListener createSelectionListener() {
return new INullSelectionListener() {
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if( part == instance )
+ if( part == instance )
return;
if (!(selection instanceof IStructuredSelection))
return;
-
+
Object element = ((IStructuredSelection)selection).getFirstElement();
IProject project = getProject(element);
if( project != null && project != currentProject ) {
@@ -77,18 +72,18 @@
jiggleViewerInput();
}
}
-
+
public IProject getProject (Object element) {
if( element instanceof IStructuredSelection)
element = ((IStructuredSelection)element).getFirstElement();
-
+
if (element instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable)element;
IResource resource = (IResource) adaptable.getAdapter(IResource.class);
if( resource != null )
return resource.getProject();
}
- if( element instanceof WrappedProject )
+ if( element instanceof WrappedProject )
return ((WrappedProject)element).getElement();
if( element instanceof IArchiveNode ) {
String projName = ((IArchiveNode)element).getProjectName();
@@ -99,14 +94,14 @@
};
}
-
- public IProject getCurrentProject() {
+
+ public IProject getCurrentProject() {
return currentProject;
}
-
+
protected void jiggleViewerInput() {
if( showProjectRoot()) {
- // if we're showing all projects, then the view is already set.
+ // if we're showing all projects, then the view is already set.
if( !showAllProjects() || !getCommonViewer().getInput().equals(ResourcesPlugin.getWorkspace().getRoot()))
getCommonViewer().setInput(ResourcesPlugin.getWorkspace().getRoot());
} else {
@@ -131,24 +126,9 @@
IActionBars bars = ((IViewSite)getSite()).getActionBars();
bars.getToolBarManager().add(buildAction);
}
-
+
private void buildSelection(final Object selected) {
- new Job("Build Archive Node") {
- protected IStatus run(IProgressMonitor monitor) {
- if( selected == null ) return Status.OK_STATUS;
- if( selected instanceof IProject ) {
- new ArchiveBuildDelegate().fullProjectBuild(((IProject)selected).getLocation());
- } else if (selected instanceof IArchiveNode &&
- ((IArchiveNode)selected).getNodeType() == IArchiveNode.TYPE_ARCHIVE) {
- new ArchiveBuildDelegate().fullArchiveBuild((IArchive)selected);
- } else if( selected != null && selected instanceof IProject ){
- new ArchiveBuildDelegate().fullProjectBuild(((IProject)selected).getProject().getLocation());
- } else {
- new ArchiveBuildDelegate().fullArchiveBuild(((IArchiveNode)selected).getRootArchive());
- }
- return Status.OK_STATUS;
- }
- }.schedule();
+ new BuildAction().run(selected);
}
private Object getSelectedObject() {
@@ -157,7 +137,7 @@
return selection.getFirstElement();
return null;
}
-
+
public Object getAdapter(Class adapter) {
if( adapter == IPropertySheetPage.class )
return new PropertySheetPage();
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelTruezipBridgeTest.java
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelTruezipBridgeTest.java 2008-09-19 19:48:39 UTC (rev 10383)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelTruezipBridgeTest.java 2008-09-19 20:55:21 UTC (rev 10384)
@@ -227,7 +227,7 @@
IArchiveFileSet fs = createFileSet("**/*.gif", new Path(proj.getName()).makeAbsolute().toString());
fs.setInWorkspace(true);
zipped.addChild(fs);
- ModelTruezipBridge.fullFilesetBuild(fs, true);
+ ModelTruezipBridge.fullFilesetBuild(fs, new NullProgressMonitor(), true);
assertEquals(19, countEntries(zippedF));
}
@@ -244,7 +244,7 @@
fs.setInWorkspace(true);
fs.setFlattened(true);
zipped.addChild(fs);
- ModelTruezipBridge.fullFilesetBuild(fs, true);
+ ModelTruezipBridge.fullFilesetBuild(fs, new NullProgressMonitor(), true);
// should be two less files and 3 less folders created
assertEquals(14, countEntries(zippedF));
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE1406Test.java
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE1406Test.java 2008-09-19 19:48:39 UTC (rev 10383)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE1406Test.java 2008-09-19 20:55:21 UTC (rev 10384)
@@ -15,12 +15,12 @@
import org.jboss.tools.common.test.util.TestProjectProvider;
/**
- * This class tests first and foremost
+ * This class tests first and foremost
* the presence of a ${archives_current_project}
- * extension to allow the currently building
+ * extension to allow the currently building
* project to be agnostic
- *
- * During this JIRA, workspace paths became conscious of
+ *
+ * During this JIRA, workspace paths became conscious of
* their absolute / relative status and are now interpreted
* differently according to their status.
* @author rob
@@ -32,15 +32,15 @@
private IPath outputDir;
private IPath propsFile;
protected void setUp() throws Exception {
- provider = new TestProjectProvider(ArchivesTest.PLUGIN_ID,
+ provider = new TestProjectProvider(ArchivesTest.PLUGIN_ID,
"inputs" + Path.SEPARATOR + "projects" + Path.SEPARATOR + "JBIDE1406",
- null, true);
+ null, true);
project = provider.getProject();
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
outputDir = project.getLocation().append("output").append("JBIDE1406.jar");
propsFile = outputDir.append("src").append("in.properties");
}
-
+
protected void tearDown() throws Exception {
provider.dispose();
}
@@ -48,7 +48,7 @@
public void testJBIDE1406() {
ArchiveBuildDelegate delegate = new ArchiveBuildDelegate();
try {
- delegate.fullProjectBuild(project.getLocation());
+ delegate.fullProjectBuild(project.getLocation(), new NullProgressMonitor());
assertTrue(outputDir.toFile().isDirectory());
assertTrue(propsFile.toFile().exists());
assertTrue(propsFile.toFile().isFile());
@@ -58,14 +58,14 @@
fail(re.getMessage());
}
}
-
+
/*
* Time to test that this commit has not ruined other things.
- * Specifically, with an older archives descriptor
+ * Specifically, with an older archives descriptor
* all workspace paths should still be interpreted as
* absolute paths even if they're not visibly absolute.
*/
-
+
public void testJBIDE1406_descriptor_path_utils() {
// These 3 should work regardless of version.
// they are "", ".", and anything absolute "/proj/out"
@@ -75,7 +75,7 @@
PathUtils.getAbsoluteLocation(".", "JBIDE1406", true, 1.0));
assertEquals(new Path("JBIDE1406").append("output").makeAbsolute().toString(),
PathUtils.getAbsoluteLocation("/JBIDE1406/output", "JBIDE1406", true, 1.0));
-
+
// Test 1.2
assertEquals(new Path("JBIDE1406").makeAbsolute().toString(),
PathUtils.getAbsoluteLocation("", "JBIDE1406", true, 1.2));
@@ -84,15 +84,15 @@
assertEquals(new Path("JBIDE1406").append("output").makeAbsolute().toString(),
PathUtils.getAbsoluteLocation("/JBIDE1406/output", "JBIDE1406", true, 1.2));
-
+
// in 1.0, a leading slash does not matter
assertEquals(new Path("JBIDE1406").append("output").makeAbsolute().toString(),
PathUtils.getAbsoluteLocation("JBIDE1406/output", "JBIDE1406", true, 1.0));
-
+
assertEquals(
PathUtils.getAbsoluteLocation("JBIDE1406/output", "JBIDE1406", true, 1.0),
PathUtils.getAbsoluteLocation("/JBIDE1406/output", "JBIDE1406", true, 1.0));
-
+
// In 1.2 the leading slash matters
assertEquals(new Path("JBIDE1406").append("output").makeAbsolute().toString(),
PathUtils.getAbsoluteLocation("output", "JBIDE1406", true, 1.2));
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2099Test.java
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2099Test.java 2008-09-19 19:48:39 UTC (rev 10383)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2099Test.java 2008-09-19 20:55:21 UTC (rev 10384)
@@ -17,15 +17,15 @@
private IProject project;
private IPath outputWar;
protected void setUp() throws Exception {
- provider = new TestProjectProvider(ArchivesTest.PLUGIN_ID,
+ provider = new TestProjectProvider(ArchivesTest.PLUGIN_ID,
"inputs" + Path.SEPARATOR + "projects" + Path.SEPARATOR + "JBIDE2099",
- null, true);
+ null, true);
project = provider.getProject();
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
outputWar = project.getLocation().append("output").append("dist")
.append("unified-http-invoker.sar").append("unified-invoker.war");
}
-
+
protected void tearDown() throws Exception {
provider.dispose();
}
@@ -33,7 +33,7 @@
public void testJBIDE2099() {
ArchiveBuildDelegate delegate = new ArchiveBuildDelegate();
try {
- delegate.fullProjectBuild(project.getLocation());
+ delegate.fullProjectBuild(project.getLocation(), new NullProgressMonitor());
assertTrue(outputWar.toFile().isDirectory());
} catch( AssertionFailedError afe) {
throw afe;
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2311Test.java
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2311Test.java 2008-09-19 19:48:39 UTC (rev 10383)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2311Test.java 2008-09-19 20:55:21 UTC (rev 10384)
@@ -16,13 +16,13 @@
private IProject project;
protected void setUp() throws Exception {
- provider = new TestProjectProvider(ArchivesTest.PLUGIN_ID,
+ provider = new TestProjectProvider(ArchivesTest.PLUGIN_ID,
"inputs" + Path.SEPARATOR + "projects" + Path.SEPARATOR + "JBIDE2311",
- null, true);
+ null, true);
project = provider.getProject();
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
}
-
+
protected void tearDown() throws Exception {
provider.dispose();
}
@@ -30,7 +30,7 @@
public void testJBIDE2311() {
ArchiveBuildDelegate delegate = new ArchiveBuildDelegate();
try {
- delegate.fullProjectBuild(project.getLocation());
+ delegate.fullProjectBuild(project.getLocation(), new NullProgressMonitor());
} catch( AssertionFailedError afe ) {
throw afe;
} catch( RuntimeException re ) {
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2315Test.java
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2315Test.java 2008-09-19 19:48:39 UTC (rev 10383)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2315Test.java 2008-09-19 20:55:21 UTC (rev 10384)
@@ -16,13 +16,13 @@
private IProject project;
protected void setUp() throws Exception {
- provider = new TestProjectProvider(ArchivesTest.PLUGIN_ID,
+ provider = new TestProjectProvider(ArchivesTest.PLUGIN_ID,
"inputs" + Path.SEPARATOR + "projects" + Path.SEPARATOR + "JBIDE2315",
- null, true);
+ null, true);
project = provider.getProject();
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
}
-
+
protected void tearDown() throws Exception {
provider.dispose();
}
@@ -30,7 +30,7 @@
public void testJBIDE2311() {
ArchiveBuildDelegate delegate = new ArchiveBuildDelegate();
try {
- delegate.fullProjectBuild(project.getLocation());
+ delegate.fullProjectBuild(project.getLocation(), new NullProgressMonitor());
} catch( AssertionFailedError afe ) {
throw afe;
} catch( RuntimeException re ) {
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2439Test.java
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2439Test.java 2008-09-19 19:48:39 UTC (rev 10383)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/JBIDE2439Test.java 2008-09-19 20:55:21 UTC (rev 10384)
@@ -22,19 +22,19 @@
private IProject aProject, bProject;
protected void setUp() throws Exception {
- aProjectProvider = new TestProjectProvider(ArchivesTest.PLUGIN_ID,
+ aProjectProvider = new TestProjectProvider(ArchivesTest.PLUGIN_ID,
"inputs" + Path.SEPARATOR + "projects" + Path.SEPARATOR + "JBIDE2439a",
- null, true);
+ null, true);
aProject = aProjectProvider.getProject();
aProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
-
-
- bProjectProvider = new TestProjectProvider(ArchivesTest.PLUGIN_ID,
+
+
+ bProjectProvider = new TestProjectProvider(ArchivesTest.PLUGIN_ID,
"inputs" + Path.SEPARATOR + "projects" + Path.SEPARATOR + "JBIDE2439b",
- null, true);
+ null, true);
bProject = bProjectProvider.getProject();
bProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
-
+
IResource folder = bProject.findMember("linked");
if( folder != null ) {
String linkedLocation = folder.getLocation().toString();
@@ -43,8 +43,8 @@
aProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
}
}
-
-
+
+
protected void tearDown() throws Exception {
aProjectProvider.dispose();
bProjectProvider.dispose();
@@ -53,19 +53,19 @@
public void testJBIDE2439() {
ArchiveBuildDelegate delegate = new ArchiveBuildDelegate();
try {
- delegate.fullProjectBuild(aProject.getLocation());
+ delegate.fullProjectBuild(aProject.getLocation(), new NullProgressMonitor());
aProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
IResource outs = aProject.getFolder("outputs");
final ArrayList<IResource> list = new ArrayList<IResource>();
outs.accept(new IResourceVisitor() {
-
+
public boolean visit(IResource resource) throws CoreException {
if( resource instanceof IFile ) {
if( !resource.getFullPath().toString().contains(".svn"))
list.add(resource);
}
return true;
- }
+ }
});
assertEquals(5, list.size());
} catch( AssertionFailedError afe ) {
15 years, 9 months
JBoss Tools SVN: r10383 - in trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common: command and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-09-19 15:48:39 -0400 (Fri, 19 Sep 2008)
New Revision: 10383
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteElementCommand.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ElementConnectionCreateCommand.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ReconnectElementConnectionSourceCommand.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ReconnectElementConnectionTargetCommand.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ConnectionWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultFlowWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/NodeWrapper.java
Log:
replace the use of class AbstractConnectionWrapper with the use of interface ConnectionWrapper
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java 2008-09-19 16:42:21 UTC (rev 10382)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java 2008-09-19 19:48:39 UTC (rev 10383)
@@ -30,8 +30,8 @@
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.resource.ImageDescriptor;
import org.jboss.tools.flow.common.Activator;
-import org.jboss.tools.flow.common.wrapper.AbstractConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.AbstractFlowWrapper;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.NodeWrapper;
/**
@@ -91,7 +91,7 @@
mapping.put(elementWrapper.getId(), node);
}
for (NodeWrapper elementWrapper: processWrapper.getElements()) {
- for (AbstractConnectionWrapper connection: elementWrapper.getIncomingConnections()) {
+ for (ConnectionWrapper connection: elementWrapper.getIncomingConnections()) {
Node source = mapping.get(connection.getSource().getId());
Node target = mapping.get(connection.getTarget().getId());
graph.edges.add(new Edge(source, target));
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteElementCommand.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteElementCommand.java 2008-09-19 16:42:21 UTC (rev 10382)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteElementCommand.java 2008-09-19 19:48:39 UTC (rev 10383)
@@ -20,7 +20,7 @@
import java.util.List;
import org.eclipse.gef.commands.Command;
-import org.jboss.tools.flow.common.wrapper.AbstractConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
import org.jboss.tools.flow.common.wrapper.NodeWrapper;
@@ -36,23 +36,23 @@
private List<NodeWrapper> incomingElementWrappers = new ArrayList<NodeWrapper>();
private List<NodeWrapper> outgoingElementWrappers = new ArrayList<NodeWrapper>();
- private List<AbstractConnectionWrapper> incomingConnections = new ArrayList<AbstractConnectionWrapper>();
- private List<AbstractConnectionWrapper> outgoingConnections = new ArrayList<AbstractConnectionWrapper>();
+ private List<ConnectionWrapper> incomingConnections = new ArrayList<ConnectionWrapper>();
+ private List<ConnectionWrapper> outgoingConnections = new ArrayList<ConnectionWrapper>();
private void deleteConnections(NodeWrapper element) {
- for (AbstractConnectionWrapper connection: element.getIncomingConnections()) {
+ for (ConnectionWrapper connection: element.getIncomingConnections()) {
incomingElementWrappers.add(connection.getSource());
incomingConnections.add(connection);
}
- for (AbstractConnectionWrapper connection: element.getOutgoingConnections()) {
+ for (ConnectionWrapper connection: element.getOutgoingConnections()) {
outgoingElementWrappers.add(connection.getTarget());
outgoingConnections.add(connection);
}
- for (AbstractConnectionWrapper connection: incomingConnections) {
+ for (ConnectionWrapper connection: incomingConnections) {
connection.disconnect();
}
- for (AbstractConnectionWrapper connection: outgoingConnections) {
+ for (ConnectionWrapper connection: outgoingConnections) {
connection.disconnect();
}
}
@@ -64,12 +64,12 @@
private void restoreConnections() {
int i = 0;
- for (AbstractConnectionWrapper connection: incomingConnections) {
+ for (ConnectionWrapper connection: incomingConnections) {
connection.connect((NodeWrapper) incomingElementWrappers.get(i), child);
i++;
}
i = 0;
- for (AbstractConnectionWrapper connection: outgoingConnections) {
+ for (ConnectionWrapper connection: outgoingConnections) {
connection.connect(child, (NodeWrapper) outgoingElementWrappers.get(i));
i++;
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ElementConnectionCreateCommand.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ElementConnectionCreateCommand.java 2008-09-19 16:42:21 UTC (rev 10382)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ElementConnectionCreateCommand.java 2008-09-19 19:48:39 UTC (rev 10383)
@@ -18,6 +18,7 @@
import org.eclipse.gef.commands.Command;
import org.jboss.tools.flow.common.wrapper.AbstractConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.NodeWrapper;
/**
@@ -36,7 +37,7 @@
return false;
}
// Check for existence of connection already
- for (AbstractConnectionWrapper connection: source.getOutgoingConnections()) {
+ for (ConnectionWrapper connection: source.getOutgoingConnections()) {
if (connection.getTarget().equals(target)) {
return false;
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ReconnectElementConnectionSourceCommand.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ReconnectElementConnectionSourceCommand.java 2008-09-19 16:42:21 UTC (rev 10382)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ReconnectElementConnectionSourceCommand.java 2008-09-19 19:48:39 UTC (rev 10383)
@@ -18,6 +18,7 @@
import org.eclipse.gef.commands.Command;
import org.jboss.tools.flow.common.wrapper.AbstractConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.NodeWrapper;
/**
@@ -36,7 +37,7 @@
if (connection.getTarget().equals(newSource)) {
return false;
}
- for (AbstractConnectionWrapper connection: newSource.getOutgoingConnections()) {
+ for (ConnectionWrapper connection: newSource.getOutgoingConnections()) {
if (connection.getTarget().equals(target) && !connection.getSource().equals(oldSource)) {
return false;
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ReconnectElementConnectionTargetCommand.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ReconnectElementConnectionTargetCommand.java 2008-09-19 16:42:21 UTC (rev 10382)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ReconnectElementConnectionTargetCommand.java 2008-09-19 19:48:39 UTC (rev 10383)
@@ -18,6 +18,7 @@
import org.eclipse.gef.commands.Command;
import org.jboss.tools.flow.common.wrapper.AbstractConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.NodeWrapper;
/**
@@ -37,7 +38,7 @@
if (connection.getSource().equals(newTarget)) {
return false;
}
- for (AbstractConnectionWrapper connection: newTarget.getIncomingConnections()) {
+ for (ConnectionWrapper connection: newTarget.getIncomingConnections()) {
if (connection.getSource().equals(source) && !connection.getTarget().equals(oldTarget)) {
return false;
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java 2008-09-19 16:42:21 UTC (rev 10382)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java 2008-09-19 19:48:39 UTC (rev 10383)
@@ -33,7 +33,7 @@
import org.jboss.tools.flow.common.policy.ElementDirectEditPolicy;
import org.jboss.tools.flow.common.policy.ElementEditPolicy;
import org.jboss.tools.flow.common.policy.ElementNodeEditPolicy;
-import org.jboss.tools.flow.common.wrapper.AbstractConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.ModelEvent;
import org.jboss.tools.flow.common.wrapper.ModelListener;
import org.jboss.tools.flow.common.wrapper.NodeWrapper;
@@ -61,11 +61,11 @@
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new ElementDirectEditPolicy());
}
- protected List<AbstractConnectionWrapper> getModelSourceConnections() {
+ protected List<ConnectionWrapper> getModelSourceConnections() {
return getElementWrapper().getOutgoingConnections();
}
- protected List<AbstractConnectionWrapper> getModelTargetConnections() {
+ protected List<ConnectionWrapper> getModelTargetConnections() {
return getElementWrapper().getIncomingConnections();
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java 2008-09-19 16:42:21 UTC (rev 10382)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java 2008-09-19 19:48:39 UTC (rev 10383)
@@ -42,8 +42,8 @@
private ContainerWrapper parent;
private transient Rectangle constraint;
- private List<AbstractConnectionWrapper> incomingConnections = new ArrayList<AbstractConnectionWrapper>();
- private List<AbstractConnectionWrapper> outgoingConnections = new ArrayList<AbstractConnectionWrapper>();
+ private List<ConnectionWrapper> incomingConnections = new ArrayList<ConnectionWrapper>();
+ private List<ConnectionWrapper> outgoingConnections = new ArrayList<ConnectionWrapper>();
private transient List<ModelListener> listeners = new ArrayList<ModelListener>();
public void setConstraint(Rectangle constraint) {
@@ -71,11 +71,11 @@
return parent;
}
- public List<AbstractConnectionWrapper> getOutgoingConnections() {
+ public List<ConnectionWrapper> getOutgoingConnections() {
return Collections.unmodifiableList(outgoingConnections);
}
- public List<AbstractConnectionWrapper> getIncomingConnections() {
+ public List<ConnectionWrapper> getIncomingConnections() {
return Collections.unmodifiableList(incomingConnections);
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ConnectionWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ConnectionWrapper.java 2008-09-19 16:42:21 UTC (rev 10382)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ConnectionWrapper.java 2008-09-19 19:48:39 UTC (rev 10383)
@@ -2,4 +2,9 @@
public interface ConnectionWrapper extends Wrapper {
+ NodeWrapper getSource();
+ NodeWrapper getTarget();
+ void disconnect();
+ void connect(NodeWrapper source, NodeWrapper target);
+
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultFlowWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultFlowWrapper.java 2008-09-19 16:42:21 UTC (rev 10382)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultFlowWrapper.java 2008-09-19 19:48:39 UTC (rev 10383)
@@ -3,8 +3,6 @@
import org.jboss.tools.flow.common.model.Flow;
import org.jboss.tools.flow.common.model.Node;
import org.jboss.tools.flow.common.strategy.AcceptsElementStrategy;
-import org.jboss.tools.flow.common.wrapper.AbstractFlowWrapper;
-import org.jboss.tools.flow.common.wrapper.NodeWrapper;
public class DefaultFlowWrapper extends AbstractFlowWrapper {
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/NodeWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/NodeWrapper.java 2008-09-19 16:42:21 UTC (rev 10382)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/NodeWrapper.java 2008-09-19 19:48:39 UTC (rev 10383)
@@ -41,8 +41,8 @@
void setParent(ContainerWrapper parent);
ContainerWrapper getParent();
- List<AbstractConnectionWrapper> getOutgoingConnections();
- List<AbstractConnectionWrapper> getIncomingConnections();
+ List<ConnectionWrapper> getOutgoingConnections();
+ List<ConnectionWrapper> getIncomingConnections();
void addIncomingConnection(AbstractConnectionWrapper connection);
void localAddIncomingConnection(AbstractConnectionWrapper connection);
void removeIncomingConnection(AbstractConnectionWrapper connection);
15 years, 9 months
JBoss Tools SVN: r10382 - in trunk/jsf: plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-09-19 12:42:21 -0400 (Fri, 19 Sep 2008)
New Revision: 10382
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/Copy of selectOneMenu.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputLabel.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputText.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGrid.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGroup.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectBooleanCheckbox.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyCheckbox.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyListbox.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyMenu.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneListbox.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneMenu.jsp.xml
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyCheckbox.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyListbox.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectOneListbox.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectOneMenuTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/JSF.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputFormat.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputFormat.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputLabel.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputText.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGrid.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGroup.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectBooleanCheckbox.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyCheckbox.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyListbox.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyMenu.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneListbox.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneMenu.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2781
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyCheckbox.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyCheckbox.java 2008-09-19 13:16:24 UTC (rev 10381)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyCheckbox.java 2008-09-19 16:42:21 UTC (rev 10382)
@@ -1,18 +1,19 @@
/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.jsf.vpe.jsf.template;
import java.util.ArrayList;
import java.util.List;
+import org.jboss.tools.jsf.vpe.jsf.template.util.JSF;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
@@ -26,35 +27,31 @@
/**
* @author dmaliarevich
- *
+ *
*/
public class JsfSelectManyCheckbox extends VpeAbstractTemplate {
- private static final String PAGE_DIRECTION = "pageDirection";
- private static final String LINE_DIRECTION = "lineDirection";
-
- /*h:SelectManyCheckbox attributes*/
- private static final String STYLE = "style";
- private static final String STYLE_CLASS = "styleClass";
- private static final String BORDER = "border";
- private static final String LAYOUT = "layout";
- private static final String CLASS = "class";
-
+ private static final String PAGE_DIRECTION = "pageDirection"; //$NON-NLS-1$
+ private static final String LINE_DIRECTION = "lineDirection"; //$NON-NLS-1$
+
+ /* h:SelectManyCheckbox attributes */
+ private static final String BORDER = "border"; //$NON-NLS-1$
+
private String style;
private String styleClass;
private String border;
private String layout;
-
+
/**
* list of visible children
*/
private static List<String> CHILDREN_LIST = new ArrayList<String>();
static {
- CHILDREN_LIST.add("selectItem"); //$NON-NLS-1$
- CHILDREN_LIST.add("selectItems"); //$NON-NLS-1$
+ CHILDREN_LIST.add(JSF.TAG_SELECT_ITEM);
+ CHILDREN_LIST.add(JSF.TAG_SELECT_ITEMS);
}
-
+
/**
*
*/
@@ -64,8 +61,10 @@
/*
* (non-Javadoc)
*
- * @see org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools.vpe.editor.context.VpePageContext,
- * org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMDocument)
+ * @see
+ * org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools
+ * .vpe.editor.context.VpePageContext, org.w3c.dom.Node,
+ * org.mozilla.interfaces.nsIDOMDocument)
*/
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
@@ -78,10 +77,10 @@
nsIDOMElement td = null;
if (attrPresents(style)) {
- table.setAttribute(STYLE, style);
+ table.setAttribute(HTML.ATTR_STYLE, style);
}
if (attrPresents(styleClass)) {
- table.setAttribute(CLASS, styleClass);
+ table.setAttribute(HTML.ATTR_CLASS, styleClass);
}
if (attrPresents(border)) {
table.setAttribute(BORDER, border);
@@ -123,7 +122,7 @@
return creationData;
}
-
+
/**
* Read attributes from the source element.
*
@@ -132,21 +131,22 @@
*/
private void readAttributes(Node sourceNode) {
Element source = (Element) sourceNode;
- style = source.getAttribute(STYLE);
- styleClass = source.getAttribute(STYLE_CLASS);
+ style = source.getAttribute(JSF.ATTR_STYLE);
+ styleClass = source.getAttribute(JSF.ATTR_STYLE_CLASS);
border = source.getAttribute(BORDER);
- layout = source.getAttribute(LAYOUT);
+ layout = source.getAttribute(JSF.ATTR_LAYOUT);
}
- /**
- * Checks is attribute presents.
- *
- * @param attr the attribute
- *
- * @return true, if successful
- */
- private boolean attrPresents(String attr) {
- return ((null != attr) && (!"".equals(attr)));
+ /**
+ * Checks is attribute presents.
+ *
+ * @param attr
+ * the attribute
+ *
+ * @return true, if successful
+ */
+ private boolean attrPresents(String attr) {
+ return ((null != attr) && (attr.length() != 0));
}
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyListbox.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyListbox.java 2008-09-19 13:16:24 UTC (rev 10381)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyListbox.java 2008-09-19 16:42:21 UTC (rev 10382)
@@ -1,18 +1,19 @@
/*******************************************************************************
-* 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
-******************************************************************************/
+ * 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.jsf.vpe.jsf.template;
import java.util.ArrayList;
import java.util.List;
+import org.jboss.tools.jsf.vpe.jsf.template.util.JSF;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
@@ -27,24 +28,11 @@
/**
* @author Sergey Dzmitrovich
*
- * template for selectOneListbox select item
+ * template for selectOneListbox select item
*
*/
public class JsfSelectManyListbox extends VpeAbstractTemplate {
- /**
- * "size" attribute
- */
- private static final String ATTR_SIZE = "size"; //$NON-NLS-1$
-
- /**
- * "dir" attribute
- */
- private static final String ATTR_DIR = "dir";
-
- /**
- * "size" attribute
- */
private static final String ATTR_MULTIPLE_VALUE = "multiple"; //$NON-NLS-1$
/**
* list of visible children
@@ -52,8 +40,8 @@
private static List<String> CHILDREN_LIST = new ArrayList<String>();
static {
- CHILDREN_LIST.add("selectItem"); //$NON-NLS-1$
- CHILDREN_LIST.add("selectItems"); //$NON-NLS-1$
+ CHILDREN_LIST.add(JSF.TAG_SELECT_ITEM);
+ CHILDREN_LIST.add(JSF.TAG_SELECT_ITEMS);
}
/**
@@ -77,8 +65,10 @@
/*
* (non-Javadoc)
*
- * @see org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools.vpe.editor.context.VpePageContext,
- * org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMDocument)
+ * @see
+ * org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools
+ * .vpe.editor.context.VpePageContext, org.w3c.dom.Node,
+ * org.mozilla.interfaces.nsIDOMDocument)
*/
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
@@ -104,15 +94,15 @@
select.setAttribute(HTML.ATTR_MULTIPLE, ATTR_MULTIPLE_VALUE);
// get "size" attribute
- String size = element.getAttribute(ATTR_SIZE);
+ String size = element.getAttribute(JSF.ATTR_SIZE);
// get "dir" attribute
- String dir = element.getAttribute(ATTR_DIR);
-
+ String dir = element.getAttribute(JSF.ATTR_DIR);
+
if (null != dir) {
select.setAttribute(HTML.ATTR_DIR, dir);
}
-
+
// add "size" attribute to "select"
if (size != null)
// if source has "size" attribute import it
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectOneListbox.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectOneListbox.java 2008-09-19 13:16:24 UTC (rev 10381)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectOneListbox.java 2008-09-19 16:42:21 UTC (rev 10382)
@@ -17,6 +17,7 @@
import java.util.Set;
import org.jboss.tools.jsf.vpe.jsf.template.util.ComponentUtil;
+import org.jboss.tools.jsf.vpe.jsf.template.util.JSF;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
@@ -33,27 +34,19 @@
/**
* @author Sergey Dzmitrovich
*
- * template for selectOneListbox select item
+ * template for selectOneListbox select item
*
*/
public class JsfSelectOneListbox extends VpeAbstractTemplate {
/**
- * "size" attribute
- */
- private static final String ATTR_SIZE = "size"; //$NON-NLS-1$
-
- private static final String ATTR_DISABLED_CLASS = "disabledClass";
- private static final String ATTR_ENABLED_CLASS = "enabledClass";
-
- /**
* list of visible children
*/
private static List<String> CHILDREN_LIST = new ArrayList<String>();
static {
- CHILDREN_LIST.add("selectItem"); //$NON-NLS-1$
- CHILDREN_LIST.add("selectItems"); //$NON-NLS-1$
+ CHILDREN_LIST.add(JSF.TAG_SELECT_ITEM);
+ CHILDREN_LIST.add(JSF.TAG_SELECT_ITEMS);
}
/**
@@ -62,10 +55,10 @@
private static Map<String, String> ATTR_LIST_COPY = new HashMap<String, String>();
static {
- ATTR_LIST_COPY.put("style", "style"); //$NON-NLS-1$
- ATTR_LIST_COPY.put("styleClass", "class"); //$NON-NLS-1$
- ATTR_LIST_COPY.put("disabled", "disabled"); //$NON-NLS-1$
- ATTR_LIST_COPY.put("dir", "dir"); //$NON-NLS-1$
+ ATTR_LIST_COPY.put(JSF.ATTR_STYLE, HTML.ATTR_STYLE);
+ ATTR_LIST_COPY.put(JSF.ATTR_STYLE_CLASS, HTML.ATTR_CLASS);
+ ATTR_LIST_COPY.put(JSF.ATTR_DISABLED, HTML.ATTR_DISABLED);
+ ATTR_LIST_COPY.put(JSF.ATTR_DIR, HTML.ATTR_DIR);
}
/**
@@ -79,8 +72,10 @@
/*
* (non-Javadoc)
*
- * @see org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools.vpe.editor.context.VpePageContext,
- * org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMDocument)
+ * @see
+ * org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools
+ * .vpe.editor.context.VpePageContext, org.w3c.dom.Node,
+ * org.mozilla.interfaces.nsIDOMDocument)
*/
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
@@ -114,7 +109,7 @@
}
// get "size" attribute
- String size = element.getAttribute(ATTR_SIZE);
+ String size = element.getAttribute(JSF.ATTR_SIZE);
// add "size" attribute to "select"
if (size != null)
@@ -190,21 +185,22 @@
element
.setAttribute(HTML.ATTR_DISABLED,
HTML.ATTR_DISABLED);
- element.setAttribute(HTML.ATTR_STYLE, sourceElement.getAttribute(HTML.ATTR_STYLE));
+ element.setAttribute(HTML.ATTR_STYLE, sourceElement
+ .getAttribute(HTML.ATTR_STYLE));
}
- element
- .setAttribute(
- HTML.ATTR_CLASS,
- (disabled || ComponentUtil
- .string2boolean(ComponentUtil
- .getAttribute(element,
- HTML.ATTR_DISABLED))) ? ComponentUtil
- .getAttribute(sourceElement,
- ATTR_DISABLED_CLASS)
- : ComponentUtil.getAttribute(
- sourceElement,
- ATTR_ENABLED_CLASS));
-
+ element
+ .setAttribute(
+ HTML.ATTR_CLASS,
+ (disabled || ComponentUtil
+ .string2boolean(ComponentUtil
+ .getAttribute(element,
+ HTML.ATTR_DISABLED))) ? ComponentUtil
+ .getAttribute(sourceElement,
+ JSF.ATTR_DISABLED_CLASS)
+ : ComponentUtil.getAttribute(
+ sourceElement,
+ JSF.ATTR_ENABLED_CLASS));
+
}
for (int i = 0; i < list.getLength(); i++) {
applyChildAttributes(sourceElement, list.item(i));
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectOneMenuTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectOneMenuTemplate.java 2008-09-19 13:16:24 UTC (rev 10381)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectOneMenuTemplate.java 2008-09-19 16:42:21 UTC (rev 10382)
@@ -17,9 +17,11 @@
import java.util.Set;
import org.jboss.tools.jsf.vpe.jsf.template.util.ComponentUtil;
+import org.jboss.tools.jsf.vpe.jsf.template.util.JSF;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
@@ -38,20 +40,13 @@
public class JsfSelectOneMenuTemplate extends VpeAbstractTemplate {
/**
- * "size" attribute
- */
-
- private static final String ATTR_DISABLED_CLASS = "disabledClass";
- private static final String ATTR_ENABLED_CLASS = "enabledClass";
-
- /**
* list of visible children
*/
private static List<String> CHILDREN_LIST = new ArrayList<String>();
static {
- CHILDREN_LIST.add("selectItem"); //$NON-NLS-1$
- CHILDREN_LIST.add("selectItems"); //$NON-NLS-1$
+ CHILDREN_LIST.add(JSF.TAG_SELECT_ITEM);
+ CHILDREN_LIST.add(JSF.TAG_SELECT_ITEMS);
}
/**
@@ -60,11 +55,10 @@
private static Map<String, String> ATTR_LIST_COPY = new HashMap<String, String>();
static {
- ATTR_LIST_COPY.put("style", "style"); //$NON-NLS-1$
- ATTR_LIST_COPY.put("styleClass", "class"); //$NON-NLS-1$
- ATTR_LIST_COPY.put("disabled", "disabled"); //$NON-NLS-1$
- ATTR_LIST_COPY.put("dir", "dir"); //$NON-NLS-1$
-
+ ATTR_LIST_COPY.put(JSF.ATTR_STYLE, HTML.ATTR_STYLE);
+ ATTR_LIST_COPY.put(JSF.ATTR_STYLE_CLASS, HTML.ATTR_CLASS);
+ ATTR_LIST_COPY.put(JSF.ATTR_DISABLED, HTML.ATTR_DISABLED);
+ ATTR_LIST_COPY.put(JSF.ATTR_DIR, HTML.ATTR_DIR);
}
/**
@@ -86,7 +80,7 @@
// create select element
nsIDOMElement select = visualDocument.createElement(HTML.TAG_SELECT);
- select.setAttribute(HTML.ATTR_SIZE, "1");
+ select.setAttribute(HTML.ATTR_SIZE, "1"); //$NON-NLS-1$
Element element = (Element) sourceNode;
// import attributes from source
@@ -100,9 +94,9 @@
// add attribute to "select"
if (attr != null) {
if (attributeName.equalsIgnoreCase(HTML.ATTR_DISABLED)) {
- if (attr.equalsIgnoreCase("true")) {
+ if (attr.equalsIgnoreCase(Constants.TRUE)) {
select.setAttribute(ATTR_LIST_COPY.get(attributeName),
- "disabled");
+ "disabled"); //$NON-NLS-1$
}
continue;
@@ -148,9 +142,9 @@
sourceElement, HTML.ATTR_DISABLED));
if (node.getNodeName().equalsIgnoreCase(HTML.TAG_OPTION)) {
element.setAttribute(HTML.ATTR_CLASS, disabled ? ComponentUtil
- .getAttribute(sourceElement, ATTR_DISABLED_CLASS)
+ .getAttribute(sourceElement, JSF.ATTR_DISABLED_CLASS)
: ComponentUtil.getAttribute(sourceElement,
- ATTR_ENABLED_CLASS));
+ JSF.ATTR_ENABLED_CLASS));
}
for (int i = 0; i < list.getLength(); i++) {
applyChildAttributes(sourceElement, list.item(i));
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/JSF.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/JSF.java 2008-09-19 13:16:24 UTC (rev 10381)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/JSF.java 2008-09-19 16:42:21 UTC (rev 10382)
@@ -17,6 +17,10 @@
*/
public class JSF {
+ public static final String TAG_SELECT_ITEM = "selectItem"; //$NON-NLS-1$
+
+ public static final String TAG_SELECT_ITEMS = "selectItems"; //$NON-NLS-1$
+
public static final String TAG_PARAM = "param"; //$NON-NLS-1$
public static final String ATTR_VALUE = "value"; //$NON-NLS-1$
@@ -39,12 +43,16 @@
public static final String ATTR_STYLE_CLASS = "styleClass"; //$NON-NLS-1$
+ public static final String ATTR_STYLE = "style"; //$NON-NLS-1$
+
public static final String ATTR_SIZE = "size"; //$NON-NLS-1$
public static final String ATTR_ROWS = "rows"; //$NON-NLS-1$
public static final String ATTR_COLS = "cols"; //$NON-NLS-1$
-
+
public static final String ATTR_ITEM_DISABLED = "itemDisabled"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT = "layout";//$NON-NLS-1$
+
}
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/Copy of selectOneMenu.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/Copy of selectOneMenu.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/Copy of selectOneMenu.jsp.xml 2008-09-19 16:42:21 UTC (rev 10382)
@@ -0,0 +1,9 @@
+<tests>
+ <test id="selectOneListbox">
+ <SELECT SIZE="3">
+ <OPTION> value1</OPTION>
+ <OPTION> value2</OPTION>
+ <OPTION> value3</OPTION>
+ </SELECT>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputFormat.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputFormat.jsp 2008-09-19 13:16:24 UTC (rev 10381)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputFormat.jsp 2008-09-19 16:42:21 UTC (rev 10382)
@@ -9,7 +9,13 @@
<f:view>
<h1><h:outputText value="outputFormat" /></h1>
- <h:outputFormat value="outputFormat" />
+ <h:outputFormat value="outputFormat1" id="outputFormat1" />
+ <h:outputFormat escape="true" value="outputFormat2" id="outputFormat2" />
+ <h:outputFormat escape="false" value="outputFormat3" id="outputFormat3" />
+ <h:outputFormat value="{0}" id="outputFormat4">
+ <f:param value="outputFormat4" />
+ </h:outputFormat>
+
</f:view>
</body>
</html>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputFormat.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputFormat.jsp.xml 2008-09-19 13:16:24 UTC (rev 10381)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputFormat.jsp.xml 2008-09-19 16:42:21 UTC (rev 10382)
@@ -10,7 +10,7 @@
<SPAN> outputFormat3 </SPAN>
</SPAN>
</test>
- <test id="outputFormat3">
+ <test id="outputFormat4">
<SPAN> outputFormat4 </SPAN>
</test>
</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputLabel.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputLabel.jsp 2008-09-19 13:16:24 UTC (rev 10381)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputLabel.jsp 2008-09-19 16:42:21 UTC (rev 10382)
@@ -9,7 +9,10 @@
<f:view>
<h1><h:outputText value="outputLabel" /></h1>
- <h:outputLabel value="outputLabel" />
+ <h:outputLabel value="outputLabel1" id="outputLabel1" />
+ <h:outputLabel escape="true" value="outputLabel2" id="outputLabel2" />
+ <h:outputLabel escape="false" value="outputLabel3" id="outputLabel3" />
+
</f:view>
</body>
</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputLabel.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputLabel.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputLabel.jsp.xml 2008-09-19 16:42:21 UTC (rev 10382)
@@ -0,0 +1,13 @@
+<tests>
+ <test id="outputLabel1">
+ <LABEL> outputLabel1</LABEL>
+ </test>
+ <test id="outputLabel2">
+ <LABEL> outputLabel2</LABEL>
+ </test>
+ <test id="outputLabel3">
+ <LABEL>
+ <SPAN> outputLabel3</SPAN>
+ </LABEL>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputText.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputText.jsp 2008-09-19 13:16:24 UTC (rev 10381)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputText.jsp 2008-09-19 16:42:21 UTC (rev 10382)
@@ -9,7 +9,10 @@
<f:view>
<h1><h:outputText value="outputText" /></h1>
- <h:outputText value="outputText" />
+ <h:outputText value="outputText1" id="outputText1" />
+ <h:outputText value="outputText2" id="outputText2" escape="true" />
+ <h:outputText value="outputText3" id="outputText3" escape="false" />
+
</f:view>
</body>
</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputText.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputText.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/outputText.jsp.xml 2008-09-19 16:42:21 UTC (rev 10382)
@@ -0,0 +1,13 @@
+<tests>
+ <test id="outputText1">
+ <SPAN> outputText1</SPAN>
+ </test>
+ <test id="outputText2">
+ <SPAN> outputText2</SPAN>
+ </test>
+ <test id="outputText3">
+ <SPAN>
+ <SPAN> outputText3</SPAN>
+ </SPAN>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGrid.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGrid.jsp 2008-09-19 13:16:24 UTC (rev 10381)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGrid.jsp 2008-09-19 16:42:21 UTC (rev 10382)
@@ -8,7 +8,7 @@
<f:view>
<h1><h:outputText value="panelGrid" /></h1>
- <h:panelGrid columns="2" rowClasses="oddRows,evenRows">
+ <h:panelGrid columns="2" rowClasses="oddRows,evenRows" id="panelGrid" >
<h:outputText value="column 1" />
<h:outputText value="column 2" />
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGrid.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGrid.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGrid.jsp.xml 2008-09-19 16:42:21 UTC (rev 10382)
@@ -0,0 +1,40 @@
+<tests>
+ <test id="panelGrid">
+ <TABLE>
+ <TR>
+ <TD>
+ <DIV>
+ <TABLE BORDER="0">
+ <TBODY>
+ <TR CLASS="oddRows">
+ <TD>
+ <SPAN> column 1 </SPAN>
+ </TD>
+ <TD>
+ <SPAN> column 2 </SPAN>
+ </TD>
+ </TR>
+ <TR CLASS="evenRows">
+ <TD>
+ <SPAN> 1 </SPAN>
+ </TD>
+ <TD>
+ <SPAN> 2 </SPAN>
+ </TD>
+ </TR>
+ <TR CLASS="oddRows">
+ <TD>
+ <SPAN> 3 </SPAN>
+ </TD>
+ <TD>
+ <SPAN> 4 </SPAN>
+ </TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ </DIV>
+ </TD>
+ </TR>
+ </TABLE>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGroup.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGroup.jsp 2008-09-19 13:16:24 UTC (rev 10381)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGroup.jsp 2008-09-19 16:42:21 UTC (rev 10382)
@@ -13,11 +13,11 @@
<h:outputText value="column 1" />
<h:outputText value="column 2" />
- <h:panelGroup>
+ <h:panelGroup id="panelGroup1">
<h:outputText value="1" />
<h:outputText value="2" />
</h:panelGroup>
- <h:panelGroup>
+ <h:panelGroup id="panelGroup2" layout="block" >
<h:outputText value="3" />
<h:outputText value="4" />
</h:panelGroup>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGroup.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGroup.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/panelGroup.jsp.xml 2008-09-19 16:42:21 UTC (rev 10382)
@@ -0,0 +1,14 @@
+<tests>
+ <test id="panelGroup1">
+ <SPAN>
+ <SPAN> 1</SPAN>
+ <SPAN> 2</SPAN>
+ </SPAN>
+ </test>
+ <test id="panelGroup2">
+ <DIV>
+ <SPAN> 3</SPAN>
+ <SPAN> 4</SPAN>
+ </DIV>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectBooleanCheckbox.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectBooleanCheckbox.jsp 2008-09-19 13:16:24 UTC (rev 10381)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectBooleanCheckbox.jsp 2008-09-19 16:42:21 UTC (rev 10382)
@@ -10,7 +10,7 @@
<h1><h:outputText value="selectBooleanCheckbox" /></h1>
<h:outputText value="selectBooleanCheckbox:" />
- <h:selectBooleanCheckbox value="false" />
+ <h:selectBooleanCheckbox value="false" id="selectBooleanCheckbox"/>
</f:view>
</body>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectBooleanCheckbox.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectBooleanCheckbox.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectBooleanCheckbox.jsp.xml 2008-09-19 16:42:21 UTC (rev 10382)
@@ -0,0 +1,5 @@
+<tests>
+ <test id="selectBooleanCheckbox">
+ <INPUT TYPE="checkbox" />
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyCheckbox.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyCheckbox.jsp 2008-09-19 13:16:24 UTC (rev 10381)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyCheckbox.jsp 2008-09-19 16:42:21 UTC (rev 10382)
@@ -11,12 +11,20 @@
<h:outputText value="selectManyCheckbox:" />
- <h:selectManyCheckbox value="someValue">
+ <h:selectManyCheckbox value="someValue" layout="pageDirection"
+ id="selectManyCheckbox1">
<f:selectItem itemLabel="check1" />
<f:selectItem itemLabel="check2" />
<f:selectItem itemLabel="check3" />
</h:selectManyCheckbox>
+ <h:selectManyCheckbox value="someValue" layout="lineDirection"
+ id="selectManyCheckbox2">
+ <f:selectItem itemLabel="check1" />
+ <f:selectItem itemLabel="check2" />
+ <f:selectItem itemLabel="check3" />
+ </h:selectManyCheckbox>
+
</f:view>
</body>
</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyCheckbox.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyCheckbox.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyCheckbox.jsp.xml 2008-09-19 16:42:21 UTC (rev 10382)
@@ -0,0 +1,66 @@
+<tests>
+ <test id="selectManyCheckbox1">
+ <TABLE>
+ <TR>
+ <TD>
+ <SPAN>
+ <INPUT TYPE="checkbox" />
+ <LABEL>
+ <SPAN> check1</SPAN>
+ </LABEL>
+ </SPAN>
+ </TD>
+ </TR>
+ <TR>
+ <TD>
+ <SPAN>
+ <INPUT TYPE="checkbox" />
+ <LABEL>
+ <SPAN> check2</SPAN>
+ </LABEL>
+ </SPAN>
+ </TD>
+ </TR>
+ <TR>
+ <TD>
+ <SPAN>
+ <INPUT TYPE="checkbox" />
+ <LABEL>
+ <SPAN> check3</SPAN>
+ </LABEL>
+ </SPAN>
+ </TD>
+ </TR>
+ </TABLE>
+ </test>
+ <test id="selectManyCheckbox2">
+ <TABLE>
+ <TR>
+ <TD>
+ <SPAN>
+ <INPUT TYPE="checkbox" />
+ <LABEL>
+ <SPAN> check1</SPAN>
+ </LABEL>
+ </SPAN>
+ </TD>
+ <TD>
+ <SPAN>
+ <INPUT TYPE="checkbox" />
+ <LABEL>
+ <SPAN> check2</SPAN>
+ </LABEL>
+ </SPAN>
+ </TD>
+ <TD>
+ <SPAN>
+ <INPUT TYPE="checkbox" />
+ <LABEL>
+ <SPAN> check3</SPAN>
+ </LABEL>
+ </SPAN>
+ </TD>
+ </TR>
+ </TABLE>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyListbox.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyListbox.jsp 2008-09-19 13:16:24 UTC (rev 10381)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyListbox.jsp 2008-09-19 16:42:21 UTC (rev 10382)
@@ -11,7 +11,7 @@
<h:outputText value="selectManyListbox:" />
- <h:selectManyListbox value="someValue">
+ <h:selectManyListbox value="someValue" id="selectManyListbox">
<f:selectItem itemLabel="value1" itemValue="value1" />
<f:selectItem itemLabel="value2" itemValue="value2" />
</h:selectManyListbox>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyListbox.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyListbox.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyListbox.jsp.xml 2008-09-19 16:42:21 UTC (rev 10382)
@@ -0,0 +1,8 @@
+<tests>
+ <test id="selectManyListbox">
+ <SELECT MULTIPLE="multiple" SIZE="2">
+ <OPTION> value1</OPTION>
+ <OPTION> value2</OPTION>
+ </SELECT>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyMenu.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyMenu.jsp 2008-09-19 13:16:24 UTC (rev 10381)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyMenu.jsp 2008-09-19 16:42:21 UTC (rev 10382)
@@ -11,7 +11,7 @@
<h:outputText value="selectManyMenu:" />
- <h:selectManyMenu value="someValue">
+ <h:selectManyMenu value="someValue" id="selectManyMenu">
<f:selectItem itemLabel="value1" itemValue="value1" />
<f:selectItem itemLabel="value2" itemValue="value2" />
<f:selectItem itemLabel="value3" itemValue="value3" />
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyMenu.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyMenu.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectManyMenu.jsp.xml 2008-09-19 16:42:21 UTC (rev 10382)
@@ -0,0 +1,10 @@
+<tests>
+ <test id="selectManyMenu">
+ <SELECT MULTIPLE="multiple" SIZE="1">
+ <OPTION>value1</OPTION>
+ <OPTION>value2</OPTION>
+ <OPTION>value3</OPTION>
+ <OPTION>value4</OPTION>
+ </SELECT>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneListbox.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneListbox.jsp 2008-09-19 13:16:24 UTC (rev 10381)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneListbox.jsp 2008-09-19 16:42:21 UTC (rev 10382)
@@ -11,7 +11,7 @@
<h:outputText value="selectOneListbox:" />
- <h:selectOneListbox value="someValue" >
+ <h:selectOneListbox value="someValue" id="selectOneListbox" >
<f:selectItem itemLabel="value1" itemValue="value1" />
<f:selectItem itemLabel="value2" itemValue="value2" />
<f:selectItem itemLabel="value3" itemValue="value3" />
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneListbox.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneListbox.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneListbox.jsp.xml 2008-09-19 16:42:21 UTC (rev 10382)
@@ -0,0 +1,9 @@
+<tests>
+ <test id="selectOneListbox">
+ <SELECT SIZE="3">
+ <OPTION> value1</OPTION>
+ <OPTION> value2</OPTION>
+ <OPTION> value3</OPTION>
+ </SELECT>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneMenu.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneMenu.jsp 2008-09-19 13:16:24 UTC (rev 10381)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneMenu.jsp 2008-09-19 16:42:21 UTC (rev 10382)
@@ -11,7 +11,7 @@
<h:outputText value="selectOneMenu:" />
- <h:selectOneMenu value="someValue">
+ <h:selectOneMenu value="someValue" id="selectOneMenu">
<f:selectItem itemLabel="value1" itemValue="value1" />
<f:selectItem itemLabel="value2" itemValue="value2" />
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneMenu.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneMenu.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneMenu.jsp.xml 2008-09-19 16:42:21 UTC (rev 10382)
@@ -0,0 +1,8 @@
+<tests>
+ <test id="selectOneMenu">
+ <SELECT SIZE="1">
+ <OPTION>value1</OPTION>
+ <OPTION>value2</OPTION>
+ </SELECT>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java 2008-09-19 13:16:24 UTC (rev 10381)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java 2008-09-19 16:42:21 UTC (rev 10382)
@@ -71,11 +71,11 @@
}
public void testOutputFormat() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performContentTest("components/outputFormat.jsp"); //$NON-NLS-1$
}
public void testOutputLabel() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performContentTest("components/outputLabel.jsp"); //$NON-NLS-1$
}
public void testOutputLink() throws Throwable {
@@ -83,42 +83,42 @@
}
public void testOutputText() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performContentTest("components/outputText.jsp"); //$NON-NLS-1$
}
public void testPanelGrid() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performContentTest("components/panelGrid.jsp"); //$NON-NLS-1$
}
public void testPanelGroup() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performContentTest("components/panelGroup.jsp"); //$NON-NLS-1$
}
public void testSelectBooleanCheckbox() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performContentTest("components/selectBooleanCheckbox.jsp"); //$NON-NLS-1$
}
public void testSelectManyCheckbox() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performContentTest("components/selectManyCheckbox.jsp"); //$NON-NLS-1$
}
public void testSelectManyListbox() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performContentTest("components/selectManyListbox.jsp"); //$NON-NLS-1$
}
public void testSelectManyMenu() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performContentTest("components/selectManyMenu.jsp"); //$NON-NLS-1$
}
public void testSelectOneListbox() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performContentTest("components/selectOneListbox.jsp"); //$NON-NLS-1$
}
public void testSelectOneMenu() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performContentTest("components/selectOneMenu.jsp"); //$NON-NLS-1$
}
- public void _testSelectOneRadio() throws Throwable {
+ public void testSelectOneRadio() throws Throwable {
assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
15 years, 9 months
JBoss Tools SVN: r10381 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-09-19 09:16:24 -0400 (Fri, 19 Sep 2008)
New Revision: 10381
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java
Log:
JBIDE-2790
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java 2008-09-19 12:28:32 UTC (rev 10380)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java 2008-09-19 13:16:24 UTC (rev 10381)
@@ -13,49 +13,44 @@
import java.util.List;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
-import org.mozilla.interfaces.nsIDOMNode;
-import org.mozilla.interfaces.nsIDOMNodeList;
-import org.mozilla.xpcom.XPCOMException;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
public class RichFacesPanelTemplate extends VpeAbstractTemplate {
-
public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
Element sourceElement = (Element)sourceNode;
- nsIDOMElement div = visualDocument.createElement("div");
+ nsIDOMElement div = visualDocument.createElement("div"); //$NON-NLS-1$
VpeCreationData creationData = new VpeCreationData(div);
- ComponentUtil.setCSSLink(pageContext, "panel/panel.css", "richFacesPanel");
- String styleClass = sourceElement.getAttribute("styleClass");
- div.setAttribute("class", "dr-pnl rich-panel " + (styleClass==null?"":styleClass));
- String style = sourceElement.getAttribute("style");
+ ComponentUtil.setCSSLink(pageContext, "panel/panel.css", "richFacesPanel"); //$NON-NLS-1$ //$NON-NLS-2$
+ String styleClass = sourceElement.getAttribute("styleClass"); //$NON-NLS-1$
+ div.setAttribute("class", "dr-pnl rich-panel " + (styleClass==null?"":styleClass)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ String style = sourceElement.getAttribute("style"); //$NON-NLS-1$
if(style!=null && style.length()>0) {
- div.setAttribute("style", style);
+ div.setAttribute("style", style); //$NON-NLS-1$
}
// Encode Header
- Node header = ComponentUtil.getFacet(sourceElement, "header", true);
+ Node header = ComponentUtil.getFacet(sourceElement, "header", true); //$NON-NLS-1$
if(header!=null) {
- nsIDOMElement headerDiv = visualDocument.createElement("div");
+ nsIDOMElement headerDiv = visualDocument.createElement("div"); //$NON-NLS-1$
div.appendChild(headerDiv);
- String headerClass = sourceElement.getAttribute("headerClass");
- headerDiv.setAttribute("class", "dr-pnl-h rich-panel-header " + (headerClass==null?"":headerClass));
- headerDiv.setAttribute("style", ComponentUtil.getHeaderBackgoundImgStyle());
+ String headerClass = sourceElement.getAttribute("headerClass"); //$NON-NLS-1$
+ headerDiv.setAttribute("class", "dr-pnl-h rich-panel-header " + (headerClass==null?"":headerClass)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ headerDiv.setAttribute("style", ComponentUtil.getHeaderBackgoundImgStyle()); //$NON-NLS-1$
VpeChildrenInfo headerInfo = new VpeChildrenInfo(headerDiv);
headerInfo.addSourceChild(header);
@@ -63,10 +58,10 @@
}
// Encode Body
- nsIDOMElement bodyDiv = visualDocument.createElement("div");
+ nsIDOMElement bodyDiv = visualDocument.createElement("div"); //$NON-NLS-1$
div.appendChild(bodyDiv);
- String bodyClass = sourceElement.getAttribute("bodyClass");
- bodyDiv.setAttribute("class", "dr-pnl-b rich-panel-body " + (bodyClass==null?"":bodyClass));
+ String bodyClass = sourceElement.getAttribute("bodyClass"); //$NON-NLS-1$
+ bodyDiv.setAttribute("class", "dr-pnl-b rich-panel-body " + (bodyClass==null?"":bodyClass)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
List<Node> children = ComponentUtil.getChildren(sourceElement, true);
VpeChildrenInfo bodyInfo = new VpeChildrenInfo(bodyDiv);
@@ -79,35 +74,12 @@
}
/* (non-Javadoc)
- * @see org.jboss.tools.vpe.editor.template.VpeAbstractTemplate#validate(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMDocument, org.jboss.tools.vpe.editor.template.VpeCreationData)
+ * @see org.jboss.tools.vpe.editor.template.VpeAbstractTemplate#isRecreateAtAttrChange(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Element, org.mozilla.interfaces.nsIDOMDocument, org.mozilla.interfaces.nsIDOMElement, java.lang.Object, java.lang.String, java.lang.String)
*/
@Override
- public void validate(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument, VpeCreationData data) {
- // FIX for JBIDE-1213 (Max Areshkau)
- if(data.getNode()!=null) {
- String bodyClass = ((Element)sourceNode).getAttribute("bodyClass");
- //applyStylesToTable(data.getNode(), bodyClass);
- }
+ public boolean isRecreateAtAttrChange(VpePageContext pageContext,
+ Element sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMElement visualNode, Object data, String name, String value) {
+ return true;
}
-
- private void applyStylesToTable(nsIDOMNode node,String sourceClass) {
-
- try {
- nsIDOMNodeList list = node.getChildNodes();
- nsIDOMElement element = (nsIDOMElement) node
- .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
-
- if (node.getNodeName().equalsIgnoreCase(
- HtmlComponentUtil.HTML_TAG_TABLE)){
- element.setAttribute("class", "dr-pnl-b rich-panel-body " + (sourceClass==null?"":sourceClass));
- }
- for (int i = 0; i < list.getLength(); i++) {
- applyStylesToTable(list.item(i),sourceClass);
- }
- } catch (XPCOMException e) {
- //Ignore
- return;
- }
- }
-}
\ No newline at end of file
+}
15 years, 9 months
JBoss Tools SVN: r10380 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor: preferences and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-09-19 08:28:32 -0400 (Fri, 19 Sep 2008)
New Revision: 10380
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesTableProvider.java
Log:
JBIDE-2521
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2008-09-19 10:49:45 UTC (rev 10379)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2008-09-19 12:28:32 UTC (rev 10380)
@@ -145,6 +145,7 @@
* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createPartControl(final Composite parent) {
//Setting Layout for the parent Composite
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesTableProvider.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesTableProvider.java 2008-09-19 10:49:45 UTC (rev 10379)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesTableProvider.java 2008-09-19 12:28:32 UTC (rev 10380)
@@ -18,8 +18,8 @@
import org.jboss.tools.vpe.editor.template.VpeAnyData;
public class TemplatesTableProvider implements XTableProvider, XTableImageProvider {
- static String[] COLUMNS = new String[]{"URI","Tag for Display", "Tag Name", "Display", "Children"};
- static int[] WIDTH = new int[]{200,150, 150, 100, 100};
+ static String[] COLUMNS = new String[]{"URI","Tag for Display", "Tag Name", "Children"};
+ static int[] WIDTH = new int[]{200,150, 150,100};
List dataList;
public TemplatesTableProvider(List dataList){
@@ -27,7 +27,7 @@
}
public int getColumnCount() {
- return 5;
+ return COLUMNS.length;
}
public int getRowCount() {
@@ -48,7 +48,7 @@
return data.getTagForDisplay();
case 2:
return data.getName();
- case 4:
+ case 3:
if(data.isChildren()) return "yes";
else return "no";
}
15 years, 9 months