JBoss Tools SVN: r5908 - trunk/documentation/guides/userguide/GettingStartedGuide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ykryvinchanka
Date: 2008-01-23 07:51:01 -0500 (Wed, 23 Jan 2008)
New Revision: 5908
Modified:
trunk/documentation/guides/userguide/GettingStartedGuide/en/modules/getting_started.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-235 http://jira.jboss.com/jira/browse/JBDS-172 new subchapter added + additional link
Modified: trunk/documentation/guides/userguide/GettingStartedGuide/en/modules/getting_started.xml
===================================================================
--- trunk/documentation/guides/userguide/GettingStartedGuide/en/modules/getting_started.xml 2008-01-23 09:14:06 UTC (rev 5907)
+++ trunk/documentation/guides/userguide/GettingStartedGuide/en/modules/getting_started.xml 2008-01-23 12:51:01 UTC (rev 5908)
@@ -19,6 +19,7 @@
Linux. But, many find these pre-configured tools offer significant time-savings and value, making
them more productive and speeding time to deployment.</para>
</section>
+
<section id="ConfigJavaEnvironment">
<?dbhtml filename="ConfigJavaEnvironment.html"?>
<title>Configuring Your Java Environment</title>
@@ -166,11 +167,13 @@
</section>
</section>
+
<section id="InstallingJBDS">
<?dbhtml filename="InstallingRHDS.html"?>
<title>JBoss Developer Studio Installation</title>
<para>This chapter will provide you with detailed information on how to install JBoss Developer Studio and all the JBoss Tools modules.</para>
- <section id="Instfromdownver">
+
+ <section id="Instfromdownver">
<title>Installing from the downloaded version</title>
<para>Let's start with the JBDS installation.</para>
<para>JBDS comes with a simple installer, bundled with tested/pre-configured versions of Eclipse,
@@ -272,7 +275,35 @@
</figure>
</section>
- <section id="JBossToolsInstall">
+
+ <section id="WhatDifferenceBetweenJBDSAndJBossTools">
+ <title>What is the difference between JBoss Developer Studio and JBoss Tools</title>
+ <para>This release of JBoss Tools is what went into our JBoss Developer Studio which provides an easy-to-install Eclipse
+ based IDE fully configured and ready to run with the bundled JBoss Enterprise Application Platform.</para>
+ <para>In short JBoss Tools are just a set of Eclipse plugins and JBoss Developer Studio adds:</para>
+ <itemizedlist>
+ <listitem>
+ <para>An installer</para>
+ </listitem>
+ <listitem>
+ <para>Eclipse and Web Tools preconfigured</para>
+ </listitem>
+ <listitem>
+ <para>JBoss EAP with JBoss AS and Seam preconfigured</para>
+ </listitem>
+ <listitem>
+ <para>3rd party plugins bundled and configured</para>
+ </listitem>
+ <listitem>
+ <para>Access to RHEL and Red Hat Network</para>
+ </listitem>
+ <listitem>
+ <para>Access to the JBoss/Red Hat supported software</para>
+ </listitem>
+ </itemizedlist>
+ <para> For additional information see <ulink url="http://www.jboss.com/products/devstudio">JBoss.com</ulink></para>
+
+ <section id="JBossToolsInstall">
<title>JBoss Tools Installation</title>
<para>Here, let's consider the installation of the JBoss Tools modules.</para>
<para>JBoss Tools is an umbrella project for the JBoss developed plugins that will make it into
@@ -324,6 +355,8 @@
</emphasis> directory and it will be readily available. It might be necessary to start Eclipse
with eclipse -clean to make sure it starts clean and rereads the new list of plugins.</para>
</section>
+
+ </section>
</section>
<section id="Welcome">
@@ -404,6 +437,7 @@
<title>Upgrading</title>
<para>To upgrade, just uninstall your current version and install the new one.</para>
</section>
+
<section id="Uninstalling">
<?dbhtml filename="Uninstalling.html"?>
<title>Uninstalling</title>
@@ -413,6 +447,7 @@
uninstaller</listitem>
</itemizedlist>
</section>
+
<section id="Support">
<?dbhtml filename="Support.html"?>
<title>Support</title>
@@ -432,6 +467,7 @@
</listitem>
</orderedlist>
</section>
+
<section id="FAQ">
<?dbhtml filename="FAQ.html"?>
<title>FAQ</title>
@@ -567,4 +603,5 @@
Forum</ulink></para>
<para>Download: <ulink url="http://www.jboss.com/products/devstudio">JBDS Download</ulink></para>
</section>
+
</chapter>
18 years, 2 months
JBoss Tools SVN: r5907 - trunk/vpe/plugins/org.jboss.tools.vpe/templates.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-01-23 04:14:06 -0500 (Wed, 23 Jan 2008)
New Revision: 5907
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-jsf.xml
Log:
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-jsf.xml 2008-01-23 09:13:18 UTC (rev 5906)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-jsf.xml 2008-01-23 09:14:06 UTC (rev 5907)
@@ -997,7 +997,7 @@
<vpe:column title="{tagstring()}"/>
</vpe:template>
</vpe:if>
- <vpe:if test="parentname()='rich:columnGroup'|parentname()='rich:dataTable'|parentname()='rich:orderingList'">
+ <vpe:if test="parentname()='rich:columnGroup'|parentname()='rich:dataTable'|parentname()='rich:orderingList'|parentname()='rich:listShuttle'">
<vpe:template children="yes" modify="yes" namespaceIdentifier="org.jboss.tools.jsf.vpe.richfaces" class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesColumnTemplate">
</vpe:template>
</vpe:if>
18 years, 2 months
JBoss Tools SVN: r5906 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces: src/org/jboss/tools/jsf/vpe/richfaces and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-01-23 04:13:18 -0500 (Wed, 23 Jan 2008)
New Revision: 5906
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/shuttle/header.gif
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/shuttle/shuttle.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSliderTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListShuttleTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
Log:
http://jira.jboss.com/jira/browse/JBIDE-1580
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/shuttle/header.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/shuttle/header.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/shuttle/shuttle.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/shuttle/shuttle.css 2008-01-23 06:32:12 UTC (rev 5905)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/shuttle/shuttle.css 2008-01-23 09:13:18 UTC (rev 5906)
@@ -1,31 +1,44 @@
-.rich-shuttle-box {
- background-color: #FFF;
- border-color: #C0C0C0;
- border-width: 1px;
- border-style: solid;
- overflow: auto;
- //display:block;
+.rich-list-shuttle {
+
}
-.rich-shuttle-caption-label {
+.rich-shuttle-source-caption,.rich-shuttle-target-caption {
font-family: Arial, Verdana, sans-serif;
font-size: 11px;
font-weight: bold;
}
-.rich-shuttle-button-content {
- padding: 0 4px 0 1px;
- text-align: left;
+.rich-shuttle-list-header {
+ overflow: hidden;
+}
+
+.rich-shuttle-header-tab-cell,.rich-shuttle-header-tab-cell-last {
+ padding: 2px;
+ border-style: solid;
+ font-weight: normal;
white-space: nowrap;
- font-family: Arial, Verdana, sans-serif;
- font-size: 11px;
+ background-repeat: repeat-x;
+ border-top: 0;
+ border-left: 0;
}
-.rich-shuttle-button-content img {
- margin-right: 2px;
- vertical-align: middle;
+.rich-shuttle-list-content {
+ background-color: #FFF;
+ border-color: #C0C0C0;
+ border-width: 1px;
+ border-style: solid;
+ overflow: auto; //
+ display: block;
}
+.rich-shuttle-source-row,.rich-shuttle-target-row {
+
+}
+
+.rich-shuttle-controls {
+ padding: 0 8px 5px 8px;
+}
+
.rich-shuttle-control {
border: 1px solid;
margin-bottom: 3px;
@@ -42,6 +55,15 @@
font-size: 11px;
}
-.rich-shuttle-controls {
- padding: 0 8px 5px 8px;
+.rich-shuttle-button-content {
+ padding: 0 4px 0 1px;
+ text-align: left;
+ white-space: nowrap;
+ font-family: Arial, Verdana, sans-serif;
+ font-size: 11px;
+}
+
+.rich-shuttle-button-content img {
+ margin-right: 2px;
+ vertical-align: middle;
}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2008-01-23 06:32:12 UTC (rev 5905)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2008-01-23 09:13:18 UTC (rev 5906)
@@ -12,6 +12,7 @@
import java.io.File;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import org.eclipse.core.resources.IFile;
@@ -49,7 +50,8 @@
NodeList children = sourceElement.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node node = children.item(i);
- if (node instanceof Element && node.getNodeName()!=null && node.getNodeName().indexOf(":facet")>0) {
+ if (node instanceof Element && node.getNodeName() != null
+ && node.getNodeName().indexOf(":facet") > 0) {
Element element = (Element) node;
String name = element.getAttribute("name");
if (facetName.equals(name)) {
@@ -249,23 +251,47 @@
NamedNodeMap namedNodeMap = sourceNode.getAttributes();
for (int i = 0; i < namedNodeMap.getLength(); i++) {
Node attribute = namedNodeMap.item(i);
- //added by Max Areshkau fix for JBIDE-1568
+ // added by Max Areshkau fix for JBIDE-1568
try {
- visualElement.setAttribute(attribute.getNodeName(), attribute
- .getNodeValue());
- } catch(XPCOMException ex) {
- //if error-code not equals error for incorrect name throws exception
+ visualElement.setAttribute(attribute.getNodeName(), attribute
+ .getNodeValue());
+ } catch (XPCOMException ex) {
+ // if error-code not equals error for incorrect name throws
+ // exception
// error code is NS_ERROR_DOM_INVALID_CHARACTER_ERR=0x80530005
- if(ex.errorcode!=2152923141L) {
+ if (ex.errorcode != 2152923141L) {
throw ex;
}
- //else we ignore this exception
+ // else we ignore this exception
}
}
}
/**
+ * Copies attributes from source node to visual node.
+ *
+ * @param attributes -
+ * list names of attributes which will copy
+ * @param sourceNode
+ * @param visualNode
+ */
+ public static void copyAttributes(Element sourceElement,
+ List<String> attributes, nsIDOMElement visualElement) {
+
+ if (attributes == null)
+ return;
+
+ for (String attributeName : attributes) {
+
+ String attributeValue = sourceElement.getAttribute(attributeName);
+ if (attributeValue != null)
+ visualElement.setAttribute(attributeName, attributeValue);
+ }
+
+ }
+
+ /**
* Returns true if sourceNode is Facet
*
* @param sourceNode
@@ -303,6 +329,10 @@
+ imgPath.replace('\\', '/') + ");";
return style;
}
+
+// public static createStyleClass(String content){
+//
+// }
/**
* Returns value of attribute.
@@ -456,24 +486,25 @@
} else
visualNode.removeAttribute(attrName);
}
-
+
/**
- * Parses string value retrieved from
- * sourceElement.getAttribure(..) method
+ * Parses string value retrieved from sourceElement.getAttribure(..) method
* to its boolean value.
* <p>
* <code>false</code> is returned only if it specified explicitly,
* otherwise <code>true</code> is returned.
*
- * @param str the string to parse
+ * @param str
+ * the string to parse
* @return boolean value from string
*/
public static boolean string2boolean(String str) {
if ((str == null) || ("".equals(str))) {
return true;
- } else if (("true".equalsIgnoreCase(str)) || ("false".equalsIgnoreCase(str))) {
+ } else if (("true".equalsIgnoreCase(str))
+ || ("false".equalsIgnoreCase(str))) {
return new Boolean(str).booleanValue();
- }
+ }
return true;
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSliderTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSliderTemplate.java 2008-01-23 06:32:12 UTC (rev 5905)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSliderTemplate.java 2008-01-23 09:13:18 UTC (rev 5906)
@@ -7,9 +7,9 @@
*
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jsf.vpe.richfaces.template;
-
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
@@ -18,8 +18,10 @@
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
import org.jboss.tools.jsf.vpe.richfaces.RichFacesTemplatesActivator;
+import org.jboss.tools.vpe.editor.VpeSourceDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.mozilla.interfaces.nsIDOMAttr;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -27,256 +29,286 @@
import org.mozilla.interfaces.nsIDOMText;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-
-/**
- * Template for input number slider control
- * // TODO We should refactor this class. There is a lot of reflection and a lot of direct work with mozzila.
- */
-public class RichFacesInputNumberSliderTemplate extends
- AbstractRichFacesInputNumberTemplate {
-
- private static final String CSS_FILE = "/inputNumberSlider/inputNumberSlider.css";
-
- private static final String MIN_VALUE_STALE_CLASS = "minValueStyle";
-
- private static final String MAX_VALUE_STALE_CLASS = "maxValueStyle";
-
- private static final String TABLE_INPUT_CELL_STYLE = "manualInputFieldTableCellClass";
-
- private static final String CELL_FOR_TABLE_STYLE = "cellForTableStyleClass";
-
- private static final String INNER_TABLE_STYLE = "innerTableStyle";
-
- final static private String HTML_INPUTSIZE_DEFAULT = "3";
-
- final static private String HTML_INPUTTYPE_HIDDEN = "hidden";
-
- final static private String HTML_INPUTTYPE_TEXT = "text";
-
- final static private String HTML_INPUTVALUE_DEFAULT = "50";
-
- final static private String IMAGE_SLIDER = "/inputNumberSlider/pos.gif";
-
- final static private String SLIDER_MAXVALUE_ATTR = "maxValue";
-
- final static private String SLIDER_MAXVALUE_DEFAULT = "100";
-
- final static private String SLIDER_MINVALUE_ATTR = "minValue";
-
- final static private String SLIDER_VALUE_ATTR = "value";
-
- final static private String SLIDER_MINVALUE_DEFAULT = "0";
-
- final static private String SLIDER_SHOWBOUNDARY_ATTR = "showBoundaryValues";
-
- final static private String SLIDER_SHOWINPUT_ATTR = "showInput";
-
- final static private String SLIDER_STEP_ATTR = "step";
-
- /** INPUT_STYLE_CLASS */
- private static final String INPUT_STYLE_CLASS = "inputStyleClass";
-
- /** */
- final private Map<String, Method> mapAttributeToMethod;
-
- final private static Class<?>[] defaultArgsMappedMethods = new Class<?>[2];
-
- static {
- defaultArgsMappedMethods[0] = nsIDOMElement.class;
- defaultArgsMappedMethods[1] = Element.class;
- }
- private boolean rightInputPosition = true;
+/**
+ * Template for input number slider control // TODO We should refactor this
+ * class. There is a lot of reflection and a lot of direct work with mozzila.
+ */
+public class RichFacesInputNumberSliderTemplate extends
+ AbstractRichFacesInputNumberTemplate {
- /**
- * Default constructor
- */
- public RichFacesInputNumberSliderTemplate() {
- mapAttributeToMethod = new HashMap<String, Method>();
-
- addMapAttibuteToMethod("value", "setInputValue");
- addMapAttibuteToMethod("inputSize", "setInputSize");
- addMapAttibuteToMethod("inputClass", "setInputClass");
- addMapAttibuteToMethod("inputStyle", "setInputStyle");
+ private static final String CSS_FILE = "/inputNumberSlider/inputNumberSlider.css";
+
+ private static final String MIN_VALUE_STALE_CLASS = "minValueStyle";
+
+ private static final String MAX_VALUE_STALE_CLASS = "maxValueStyle";
+
+ private static final String TABLE_INPUT_CELL_STYLE = "manualInputFieldTableCellClass";
+
+ private static final String CELL_FOR_TABLE_STYLE = "cellForTableStyleClass";
+
+ private static final String INNER_TABLE_STYLE = "innerTableStyle";
+
+ final static private String HTML_INPUTSIZE_DEFAULT = "3";
+
+ final static private String HTML_INPUTTYPE_HIDDEN = "hidden";
+
+ final static private String HTML_INPUTTYPE_TEXT = "text";
+
+ final static private String HTML_INPUTVALUE_DEFAULT = "50";
+
+ final static private String IMAGE_SLIDER = "/inputNumberSlider/pos.gif";
+
+ final static private String SLIDER_MAXVALUE_ATTR = "maxValue";
+
+ final static private String SLIDER_MAXVALUE_DEFAULT = "100";
+
+ final static private String SLIDER_MINVALUE_ATTR = "minValue";
+
+ final static private String SLIDER_VALUE_ATTR = "value";
+
+ final static private String SLIDER_MINVALUE_DEFAULT = "0";
+
+ final static private String SLIDER_SHOWBOUNDARY_ATTR = "showBoundaryValues";
+
+ final static private String SLIDER_SHOWINPUT_ATTR = "showInput";
+
+ final static private String SLIDER_STEP_ATTR = "step";
+
+ /** INPUT_STYLE_CLASS */
+ private static final String INPUT_STYLE_CLASS = "inputStyleClass";
+
+ /** */
+ final private Map<String, Method> mapAttributeToMethod;
+
+ final private static Class<?>[] defaultArgsMappedMethods = new Class<?>[2];
+
+ static {
+ defaultArgsMappedMethods[0] = nsIDOMElement.class;
+ defaultArgsMappedMethods[1] = Element.class;
+ }
+
+ private boolean rightInputPosition = true;
+
+ /**
+ * Default constructor
+ */
+ public RichFacesInputNumberSliderTemplate() {
+ mapAttributeToMethod = new HashMap<String, Method>();
+
+ addMapAttibuteToMethod("value", "setInputValue");
+ addMapAttibuteToMethod("inputSize", "setInputSize");
+ addMapAttibuteToMethod("inputClass", "setInputClass");
+ addMapAttibuteToMethod("inputStyle", "setInputStyle");
addMapAttibuteToMethod("inputPosition", "setInputPosition");
- addMapAttibuteToMethod("maxlength", "setMaxlength");
- addMapAttibuteToMethod("showInput", "showInput");
- addMapAttibuteToMethod("showBoundaryValues", "showBoundaryValues");
- addMapAttibuteToMethod("maxValue", "setMaxValue");
- addMapAttibuteToMethod("minValue", "setMinValue");
- addMapAttibuteToMethod("width", "setWidth");
- addMapAttibuteToMethod("style", "setStyle");
- addMapAttibuteToMethod("class", "setClass");
- }
-
- /**
- *
- * @param methodName
- * @return
- */
- private Method getMethodByName(String methodName) {
- Class<?> clazz = this.getClass();
- Method m1 = null;
- try {
- m1 = clazz.getMethod(methodName, defaultArgsMappedMethods);
- } catch (SecurityException e) {
- RichFacesTemplatesActivator.getPluginLog().logError("SecurityException: " + e.getMessage() );
- } catch (NoSuchMethodException e) {
- RichFacesTemplatesActivator.getPluginLog().logWarning("NoSuchMethodException: " + methodName + ":" + e.getMessage() );
- }
-
- return m1;
- }
-
- /**
- *
- * @param attributeName
- * @param methodName
- */
- private void addMapAttibuteToMethod(String attributeName, String methodName) {
- Method method = getMethodByName(methodName);
-
- if (method != null) {
- mapAttributeToMethod.put(attributeName, method);
- }
- }
-
- /**
- * Creates a node of the visual tree on the node of the source tree. This
- * visual node should not have the parent node This visual node can have
- * child nodes.
- *
- * @param pageContext
- * Contains the information on edited page.
- * @param sourceNode
- * The current node of the source tree.
- * @param visualDocument
- * The document of the visual tree.
- * @return The information on the created node of the visual tree.
- */
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
- setInputPosition(sourceNode);
+ addMapAttibuteToMethod("maxlength", "setMaxlength");
+ addMapAttibuteToMethod("showInput", "showInput");
+ addMapAttibuteToMethod("showBoundaryValues", "showBoundaryValues");
+ addMapAttibuteToMethod("maxValue", "setMaxValue");
+ addMapAttibuteToMethod("minValue", "setMinValue");
+ addMapAttibuteToMethod("width", "setWidth");
+ addMapAttibuteToMethod("style", "setStyle");
+ addMapAttibuteToMethod("class", "setClass");
+ }
- nsIDOMElement table1 = null;
- nsIDOMElement table1Tr1 = null;
- nsIDOMElement table1Tr1Td1 = null;
- nsIDOMText table1Tr1Td1Text = null;
- nsIDOMElement table1Tr1Td2 = null;
- nsIDOMText table1Tr1Td2Text = null;
- nsIDOMElement table1Tr1Td3 = null;
- nsIDOMElement table1Tr1Td3input = null;
- nsIDOMElement table1Tr2 = null;
- nsIDOMElement table1Tr2Td1 = null;
- nsIDOMElement table1Tr2Td1Table2 = null;
- nsIDOMElement table1Tr2Td1Table2Tr1 = null;
+ /**
+ *
+ * @param methodName
+ * @return
+ */
+ private Method getMethodByName(String methodName) {
+ Class<?> clazz = this.getClass();
+ Method m1 = null;
+ try {
+ m1 = clazz.getMethod(methodName, defaultArgsMappedMethods);
+ } catch (SecurityException e) {
+ RichFacesTemplatesActivator.getPluginLog().logError(
+ "SecurityException: " + e.getMessage());
+ } catch (NoSuchMethodException e) {
+ RichFacesTemplatesActivator.getPluginLog().logWarning(
+ "NoSuchMethodException: " + methodName + ":"
+ + e.getMessage());
+ }
+
+ return m1;
+ }
+
+ /**
+ *
+ * @param attributeName
+ * @param methodName
+ */
+ private void addMapAttibuteToMethod(String attributeName, String methodName) {
+ Method method = getMethodByName(methodName);
+
+ if (method != null) {
+ mapAttributeToMethod.put(attributeName, method);
+ }
+ }
+
+ /**
+ * Creates a node of the visual tree on the node of the source tree. This
+ * visual node should not have the parent node This visual node can have
+ * child nodes.
+ *
+ * @param pageContext
+ * Contains the information on edited page.
+ * @param sourceNode
+ * The current node of the source tree.
+ * @param visualDocument
+ * The document of the visual tree.
+ * @return The information on the created node of the visual tree.
+ */
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ setInputPosition(sourceNode);
+
+ nsIDOMElement table1 = null;
+ nsIDOMElement table1Tr1 = null;
+ nsIDOMElement table1Tr1Td1 = null;
+ nsIDOMText table1Tr1Td1Text = null;
+ nsIDOMElement table1Tr1Td2 = null;
+ nsIDOMText table1Tr1Td2Text = null;
+ nsIDOMElement table1Tr1Td3 = null;
+ nsIDOMElement table1Tr1Td3input = null;
+ nsIDOMElement table1Tr2 = null;
+ nsIDOMElement table1Tr2Td1 = null;
+ nsIDOMElement table1Tr2Td1Table2 = null;
+ nsIDOMElement table1Tr2Td1Table2Tr1 = null;
nsIDOMElement table1Tr2Td1Table2Tr1Td = null;
nsIDOMElement table1Tr2Td1Table2Tr1TdTable = null;
nsIDOMElement table1Tr2Td1Table2Tr1TdTableTr = null;
- nsIDOMElement table1Tr2Td1Table2Tr1TdTableTrTd1 = null;
- nsIDOMElement table1Tr2Td1Table2Tr1TdTableTrTd2 = null;
- nsIDOMElement table1Tr2Td1Table2Tr1TdTableTrTd2Img = null;
+ nsIDOMElement table1Tr2Td1Table2Tr1TdTableTrTd1 = null;
+ nsIDOMElement table1Tr2Td1Table2Tr1TdTableTrTd2 = null;
+ nsIDOMElement table1Tr2Td1Table2Tr1TdTableTrTd2Img = null;
nsIDOMElement table1Tr2Td1Table2Tr1TdTableTrTd3 = null;
-
- // sets css link
- ComponentUtil.setCSSLink(pageContext, CSS_FILE, "inputNumberSlider");
-
- // create table1
- table1 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
- addBasicTableAttributes(table1);
-
- // creates first row in table 1
- table1Tr1 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
- table1Tr1Td1 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- table1Tr1Td1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- MIN_VALUE_STALE_CLASS);
- table1Tr1Td1Text = visualDocument.createTextNode("0");
- table1Tr1Td2 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- table1Tr1Td2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- MAX_VALUE_STALE_CLASS);
- table1Tr1Td2Text = visualDocument.createTextNode("100");
- table1Tr1Td3 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- table1Tr1Td3.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- TABLE_INPUT_CELL_STYLE);
- table1Tr1Td3.setAttribute(HtmlComponentUtil.HTML_ROWSPAN_ATTR, "2");
- table1Tr1Td3input = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_INPUT);
- table1Tr1Td3input.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- INPUT_STYLE_CLASS);
- table1Tr1Td3input.setAttribute(HtmlComponentUtil.HTML_SIZE_ATTR, "3");
- table1Tr1Td3input.setAttribute(HtmlComponentUtil.HTML_VALUE_ATTR, "50");
+
+ // sets css link
+ ComponentUtil.setCSSLink(pageContext, CSS_FILE, "inputNumberSlider");
+
+ // create table1
+ table1 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+ addBasicTableAttributes(table1);
+
+ VpeCreationData creationData = new VpeCreationData(table1);
+
+ // creates first row in table 1
+ table1Tr1 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
+ table1Tr1Td1 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ table1Tr1Td1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ MIN_VALUE_STALE_CLASS);
+ table1Tr1Td1Text = visualDocument.createTextNode("0");
+ table1Tr1Td2 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ table1Tr1Td2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ MAX_VALUE_STALE_CLASS);
+ table1Tr1Td2Text = visualDocument.createTextNode("100");
+ table1Tr1Td3 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ table1Tr1Td3.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ TABLE_INPUT_CELL_STYLE);
+ table1Tr1Td3.setAttribute(HtmlComponentUtil.HTML_ROWSPAN_ATTR, "2");
+ table1Tr1Td3input = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_INPUT);
+
+ table1Tr1Td3input.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ /* INPUT_STYLE_CLASS+ */"-moz-user-modify:read-write");
+
+// nsIDOMAttr newVisualDOMAttribute = visualDocument
+// .createAttribute("value");
+// newVisualDOMAttribute.setValue("50");
+// table1Tr1Td3input.appendChild(newVisualDOMAttribute);
+
+ // table1Tr1Td3input.setAttribute(HtmlComponentUtil.HTML_SIZE_ATTR,
+ // "3");
+ table1Tr1Td3input.setAttribute(HtmlComponentUtil.HTML_VALUE_ATTR,
+ "50");
+
+ creationData.setData(table1Tr1Td3input);
+
String positionStyle = "margin-left: 10px;";
- if(!rightInputPosition) {
+ if (!rightInputPosition) {
positionStyle = "margin-right: 10px;";
}
- table1Tr1Td3input.setAttribute("style", positionStyle + ComponentUtil.getBackgoundImgStyle("inputNumberSlider/inputbg.gif"));
-
- table1Tr2 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
- table1Tr2Td1 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- table1Tr2Td1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- CELL_FOR_TABLE_STYLE);
- table1Tr2Td1.setAttribute(HtmlComponentUtil.HTML_COLSPAN_ATTR, "2");
- table1Tr2Td1Table2 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
- addBasicTableAttributes(table1Tr2Td1Table2);
-
- table1Tr2Td1Table2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- INNER_TABLE_STYLE);
- table1Tr2Td1Table2.setAttribute(
- HtmlComponentUtil.HTML_CELLPADDING_ATTR, "1");
- table1Tr2Td1Table2.setAttribute(
- HtmlComponentUtil.HTML_CELLSPACING_ATTR, "0");
-
- table1Tr2Td1Table2Tr1 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
+ table1Tr1Td3input.setAttribute("style", positionStyle
+ + ComponentUtil
+ .getBackgoundImgStyle("inputNumberSlider/inputbg.gif"));
- table1Tr2Td1Table2Tr1Td = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
- table1Tr2Td1Table2Tr1TdTable = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
- table1Tr2Td1Table2Tr1TdTable.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, "0");
- table1Tr2Td1Table2Tr1TdTable.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, "0");
- table1Tr2Td1Table2Tr1TdTable.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, "0");
+ table1Tr2 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
+ table1Tr2Td1 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ table1Tr2Td1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ CELL_FOR_TABLE_STYLE);
+ table1Tr2Td1.setAttribute(HtmlComponentUtil.HTML_COLSPAN_ATTR, "2");
+ table1Tr2Td1Table2 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+ addBasicTableAttributes(table1Tr2Td1Table2);
- table1Tr2Td1Table2Tr1TdTableTr = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
-
- table1Tr2Td1Table2Tr1TdTableTrTd1 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- table1Tr2Td1Table2Tr1TdTableTrTd1.setAttribute(
- HtmlComponentUtil.HTML_CLASS_ATTR, "empty-cell-style");
+ table1Tr2Td1Table2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ INNER_TABLE_STYLE);
+ table1Tr2Td1Table2.setAttribute(
+ HtmlComponentUtil.HTML_CELLPADDING_ATTR, "1");
+ table1Tr2Td1Table2.setAttribute(
+ HtmlComponentUtil.HTML_CELLSPACING_ATTR, "0");
- table1Tr2Td1Table2Tr1TdTableTrTd1.setAttribute("style", ComponentUtil.getBackgoundImgStyle("inputNumberSlider/sliderbg.gif"));
+ table1Tr2Td1Table2Tr1 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TR);
- table1Tr2Td1Table2Tr1TdTableTrTd1.setAttribute(
- HtmlComponentUtil.HTML_WIDTH_ATTR, "50%");
-
- table1Tr2Td1Table2Tr1TdTableTrTd2 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- table1Tr2Td1Table2Tr1TdTableTrTd2.setAttribute(
+ table1Tr2Td1Table2Tr1Td = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ table1Tr2Td1Table2Tr1TdTable = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+ table1Tr2Td1Table2Tr1TdTable.setAttribute(
+ HtmlComponentUtil.HTML_CELLPADDING_ATTR, "0");
+ table1Tr2Td1Table2Tr1TdTable.setAttribute(
+ HtmlComponentUtil.HTML_CELLSPACING_ATTR, "0");
+ table1Tr2Td1Table2Tr1TdTable.setAttribute(
+ HtmlComponentUtil.HTML_BORDER_ATTR, "0");
+
+ table1Tr2Td1Table2Tr1TdTableTr = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TR);
+
+ table1Tr2Td1Table2Tr1TdTableTrTd1 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ table1Tr2Td1Table2Tr1TdTableTrTd1.setAttribute(
+ HtmlComponentUtil.HTML_CLASS_ATTR, "empty-cell-style");
+
+ table1Tr2Td1Table2Tr1TdTableTrTd1.setAttribute("style", ComponentUtil
+ .getBackgoundImgStyle("inputNumberSlider/sliderbg.gif"));
+
+ table1Tr2Td1Table2Tr1TdTableTrTd1.setAttribute(
+ HtmlComponentUtil.HTML_WIDTH_ATTR, "50%");
+
+ table1Tr2Td1Table2Tr1TdTableTrTd2 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ table1Tr2Td1Table2Tr1TdTableTrTd2.setAttribute(
HtmlComponentUtil.HTML_CLASS_ATTR, "cell-with-picture");
- table1Tr2Td1Table2Tr1TdTableTrTd2.setAttribute("style", ComponentUtil.getBackgoundImgStyle("inputNumberSlider/inputbg.gif"));
-
- table1Tr2Td1Table2Tr1TdTableTrTd2Img = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_IMG);
- ComponentUtil.setImg(table1Tr2Td1Table2Tr1TdTableTrTd2Img, IMAGE_SLIDER);
+ table1Tr2Td1Table2Tr1TdTableTrTd2.setAttribute("style", ComponentUtil
+ .getBackgoundImgStyle("inputNumberSlider/inputbg.gif"));
- table1Tr2Td1Table2Tr1TdTableTrTd3 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- table1Tr2Td1Table2Tr1TdTableTrTd3.setAttribute(
- HtmlComponentUtil.HTML_CLASS_ATTR, "empty-cell-style");
+ table1Tr2Td1Table2Tr1TdTableTrTd2Img = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ ComponentUtil
+ .setImg(table1Tr2Td1Table2Tr1TdTableTrTd2Img, IMAGE_SLIDER);
- table1Tr2Td1Table2Tr1TdTableTrTd3.setAttribute("style", ComponentUtil.getBackgoundImgStyle("inputNumberSlider/sliderbg.gif"));
+ table1Tr2Td1Table2Tr1TdTableTrTd3 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ table1Tr2Td1Table2Tr1TdTableTrTd3.setAttribute(
+ HtmlComponentUtil.HTML_CLASS_ATTR, "empty-cell-style");
- table1Tr2Td1Table2Tr1TdTableTrTd3.setAttribute(
- HtmlComponentUtil.HTML_WIDTH_ATTR, "50%");
-
- table1.appendChild(table1Tr1);
- table1.appendChild(table1Tr2);
+ table1Tr2Td1Table2Tr1TdTableTrTd3.setAttribute("style", ComponentUtil
+ .getBackgoundImgStyle("inputNumberSlider/sliderbg.gif"));
- if(rightInputPosition) {
+ table1Tr2Td1Table2Tr1TdTableTrTd3.setAttribute(
+ HtmlComponentUtil.HTML_WIDTH_ATTR, "50%");
+
+ table1.appendChild(table1Tr1);
+ table1.appendChild(table1Tr2);
+
+ if (rightInputPosition) {
table1Tr1.appendChild(table1Tr1Td1);
table1Tr1.appendChild(table1Tr1Td2);
table1Tr1.appendChild(table1Tr1Td3);
@@ -284,341 +316,359 @@
table1Tr1.appendChild(table1Tr1Td3);
table1Tr1.appendChild(table1Tr1Td1);
table1Tr1.appendChild(table1Tr1Td2);
- }
+ }
- table1Tr2.appendChild(table1Tr2Td1);
- table1Tr1Td1.appendChild(table1Tr1Td1Text);
- table1Tr1Td2.appendChild(table1Tr1Td2Text);
+ table1Tr2.appendChild(table1Tr2Td1);
+ table1Tr1Td1.appendChild(table1Tr1Td1Text);
+ table1Tr1Td2.appendChild(table1Tr1Td2Text);
- table1Tr1Td3.appendChild(table1Tr1Td3input);
+ table1Tr1Td3.appendChild(table1Tr1Td3input);
- table1Tr2Td1.appendChild(table1Tr2Td1Table2);
+ table1Tr2Td1.appendChild(table1Tr2Td1Table2);
table1Tr2Td1Table2.appendChild(table1Tr2Td1Table2Tr1);
table1Tr2Td1Table2Tr1.appendChild(table1Tr2Td1Table2Tr1Td);
table1Tr2Td1Table2Tr1Td.appendChild(table1Tr2Td1Table2Tr1TdTable);
- table1Tr2Td1Table2Tr1TdTable.appendChild(table1Tr2Td1Table2Tr1TdTableTr);
- table1Tr2Td1Table2Tr1TdTableTr.appendChild(table1Tr2Td1Table2Tr1TdTableTrTd1);
- table1Tr2Td1Table2Tr1TdTableTr.appendChild(table1Tr2Td1Table2Tr1TdTableTrTd2);
- table1Tr2Td1Table2Tr1TdTableTr.appendChild(table1Tr2Td1Table2Tr1TdTableTrTd3);
- table1Tr2Td1Table2Tr1TdTableTrTd2.appendChild(table1Tr2Td1Table2Tr1TdTableTrTd2Img);
-
- //
- // set a default values
- //
-
- Object[] inPatams = new Object[2];
- inPatams[0] = table1;
- inPatams[1] = sourceNode;
-
- for (Map.Entry<String, Method> e : mapAttributeToMethod.entrySet()) {
- Method function = e.getValue();
- if (function != null) {
- try {
- function.invoke(this, inPatams);
- } catch (IllegalArgumentException e1) {
- RichFacesTemplatesActivator.getPluginLog().logWarning("IllegalArgumentException: " + e.getKey() + ":" + e1.getMessage(), e1);
- } catch (IllegalAccessException e2) {
- RichFacesTemplatesActivator.getPluginLog().logWarning("IllegalAccessException: " + e.getKey() + ":" + e2.getMessage(), e2);
- } catch (InvocationTargetException e3) {
-// RichFacesTemplatesActivator.getPluginLog().logWarning("InvocationTargetException: " + e3.getMessage(), e3);
- }
- }
- }
+ table1Tr2Td1Table2Tr1TdTable
+ .appendChild(table1Tr2Td1Table2Tr1TdTableTr);
+ table1Tr2Td1Table2Tr1TdTableTr
+ .appendChild(table1Tr2Td1Table2Tr1TdTableTrTd1);
+ table1Tr2Td1Table2Tr1TdTableTr
+ .appendChild(table1Tr2Td1Table2Tr1TdTableTrTd2);
+ table1Tr2Td1Table2Tr1TdTableTr
+ .appendChild(table1Tr2Td1Table2Tr1TdTableTrTd3);
+ table1Tr2Td1Table2Tr1TdTableTrTd2
+ .appendChild(table1Tr2Td1Table2Tr1TdTableTrTd2Img);
-
- VpeCreationData creationData = new VpeCreationData(table1);
- return creationData;
- }
+ //
+ // set a default values
+ //
+ Object[] inPatams = new Object[2];
+ inPatams[0] = table1;
+ inPatams[1] = sourceNode;
+
+ for (Map.Entry<String, Method> e : mapAttributeToMethod.entrySet()) {
+ Method function = e.getValue();
+ if (function != null) {
+ try {
+ function.invoke(this, inPatams);
+ } catch (IllegalArgumentException e1) {
+ RichFacesTemplatesActivator.getPluginLog().logWarning(
+ "IllegalArgumentException: " + e.getKey() + ":"
+ + e1.getMessage(), e1);
+ } catch (IllegalAccessException e2) {
+ RichFacesTemplatesActivator.getPluginLog().logWarning(
+ "IllegalAccessException: " + e.getKey() + ":"
+ + e2.getMessage(), e2);
+ } catch (InvocationTargetException e3) {
+ // RichFacesTemplatesActivator.getPluginLog().logWarning("InvocationTargetException:
+ // " + e3.getMessage(), e3);
+ }
+ }
+ }
+
+ return creationData;
+ }
+
private void setInputPosition(Node sourceNode) {
String position = getAttribute("inputPosition", sourceNode);
rightInputPosition = !"left".equalsIgnoreCase(position);
}
- /**
- *
- * @see com.exadel.vpe.editor.template.VpeAbstractTemplate#setAttribute(com.exadel.vpe.editor.context.VpePageContext,
- * org.w3c.dom.Element, org.w3c.dom.Document, org.w3c.dom.Node,
- * java.lang.Object, java.lang.String, java.lang.String)
+ /**
+ *
+ * @see com.exadel.vpe.editor.template.VpeAbstractTemplate#setAttribute(com.exadel.vpe.editor.context.VpePageContext,
+ * org.w3c.dom.Element, org.w3c.dom.Document, org.w3c.dom.Node,
+ * java.lang.Object, java.lang.String, java.lang.String)
*/
- @Override
- public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name, String value) {
-
- Method function = mapAttributeToMethod.get(name);
- if (function != null) {
- Object[] inPatams = new Object[2];
- inPatams[0] = visualNode;
- inPatams[1] = sourceElement;
- try {
- function.invoke(this, inPatams);
- } catch (IllegalArgumentException e1) {
- RichFacesTemplatesActivator.getPluginLog().logWarning("IllegalArgumentException: " + name + ":" + e1.getMessage() );
- } catch (IllegalAccessException e2) {
- RichFacesTemplatesActivator.getPluginLog().logWarning("IllegalAccessException: " + name + ":" + e2.getMessage() );
- } catch (InvocationTargetException e3) {
-// RichFacesTemplatesActivator.getPluginLog().logWarning("InvocationTargetException: " + name + ":"+ e3.getMessage() );
- }
+ @Override
+ public void setAttribute(VpePageContext pageContext, Element sourceElement,
+ nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data,
+ String name, String value) {
+
+ Method function = mapAttributeToMethod.get(name);
+ if (function != null) {
+ Object[] inPatams = new Object[2];
+ inPatams[0] = visualNode;
+ inPatams[1] = sourceElement;
+ try {
+ function.invoke(this, inPatams);
+ } catch (IllegalArgumentException e1) {
+ RichFacesTemplatesActivator.getPluginLog().logWarning(
+ "IllegalArgumentException: " + name + ":"
+ + e1.getMessage());
+ } catch (IllegalAccessException e2) {
+ RichFacesTemplatesActivator.getPluginLog().logWarning(
+ "IllegalAccessException: " + name + ":"
+ + e2.getMessage());
+ } catch (InvocationTargetException e3) {
+ // RichFacesTemplatesActivator.getPluginLog().logWarning("InvocationTargetException:
+ // " + name + ":"+ e3.getMessage() );
+ }
}
-
- nsIDOMElement visualtElement = (nsIDOMElement) visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
-
- correctArrowPosition(sourceElement, visualtElement);
+
+ nsIDOMElement visualtElement = (nsIDOMElement) visualNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ correctArrowPosition(sourceElement, visualtElement);
}
-
- /**
- *
- */
- public String getDefaultInputSize() {
- return HTML_INPUTSIZE_DEFAULT;
- }
-
- /**
- *
- */
- public String getDefaultInputClass() {
- return INPUT_STYLE_CLASS;
- }
-
- /**
- * Sets some attributes which necessary for displaying table as tree
- *
- * @param tree
- */
- private void addBasicTableAttributes(nsIDOMElement table) {
- table.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, "0");
- table.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, "0");
- table.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, "0");
- }
-
- /**
- *
- * @param visualNode
- * @return
- */
- private nsIDOMElement getInputElement(nsIDOMElement visualNode) {
- nsIDOMElement table = visualNode;
- nsIDOMNodeList tableList = table.getChildNodes();
- nsIDOMNode tr = tableList.item(0);
+
+ /**
+ *
+ */
+ public String getDefaultInputSize() {
+ return HTML_INPUTSIZE_DEFAULT;
+ }
+
+ /**
+ *
+ */
+ public String getDefaultInputClass() {
+ return INPUT_STYLE_CLASS;
+ }
+
+ /**
+ * Sets some attributes which necessary for displaying table as tree
+ *
+ * @param tree
+ */
+ private void addBasicTableAttributes(nsIDOMElement table) {
+ table.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, "0");
+ table.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, "0");
+ table.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, "0");
+ }
+
+ /**
+ *
+ * @param visualNode
+ * @return
+ */
+ private nsIDOMElement getInputElement(nsIDOMElement visualNode) {
+ nsIDOMElement table = visualNode;
+ nsIDOMNodeList tableList = table.getChildNodes();
+ nsIDOMNode tr = tableList.item(0);
nsIDOMNodeList trList = tr.getChildNodes();
nsIDOMNode td1 = null;
- if(rightInputPosition) {
+ if (rightInputPosition) {
td1 = trList.item(2);
} else {
td1 = trList.item(0);
- }
- nsIDOMNodeList td1List = td1.getChildNodes();
- nsIDOMNode input = td1List.item(0);
- nsIDOMElement inputElement = (nsIDOMElement) input.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- return inputElement;
- }
-
- /**
- *
- * @param visualNode
- * @return
- */
- private nsIDOMNode getMaxValueElement(nsIDOMElement visualNode) {
- nsIDOMElement table = visualNode;
- nsIDOMNodeList tableList = table.getChildNodes();
- nsIDOMNode tr = tableList.item(0);
- nsIDOMNodeList trList = tr.getChildNodes();
- nsIDOMNode td1 = trList.item(1);
- nsIDOMNodeList td1List = td1.getChildNodes();
+ }
+ nsIDOMNodeList td1List = td1.getChildNodes();
+ nsIDOMNode input = td1List.item(0);
+ nsIDOMElement inputElement = (nsIDOMElement) input
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ return inputElement;
+ }
+
+ /**
+ *
+ * @param visualNode
+ * @return
+ */
+ private nsIDOMNode getMaxValueElement(nsIDOMElement visualNode) {
+ nsIDOMElement table = visualNode;
+ nsIDOMNodeList tableList = table.getChildNodes();
+ nsIDOMNode tr = tableList.item(0);
+ nsIDOMNodeList trList = tr.getChildNodes();
+ nsIDOMNode td1 = trList.item(1);
+ nsIDOMNodeList td1List = td1.getChildNodes();
nsIDOMNode maxValue = td1List.item(0);
- return maxValue;
- }
-
- /**
- *
- * @param visualNode
- * @return
- */
- private nsIDOMNode getMinValueElement(nsIDOMElement visualNode) {
- nsIDOMElement table = visualNode;
- nsIDOMNodeList tableList = table.getChildNodes();
- nsIDOMNode tr = tableList.item(0);
- nsIDOMNodeList trList = tr.getChildNodes();
- nsIDOMNode td1 = trList.item(0);
- nsIDOMNodeList td1List = td1.getChildNodes();
+ return maxValue;
+ }
+
+ /**
+ *
+ * @param visualNode
+ * @return
+ */
+ private nsIDOMNode getMinValueElement(nsIDOMElement visualNode) {
+ nsIDOMElement table = visualNode;
+ nsIDOMNodeList tableList = table.getChildNodes();
+ nsIDOMNode tr = tableList.item(0);
+ nsIDOMNodeList trList = tr.getChildNodes();
+ nsIDOMNode td1 = trList.item(0);
+ nsIDOMNodeList td1List = td1.getChildNodes();
nsIDOMNode minValue = td1List.item(0);
- return minValue;
- }
-
- /**
- *
- * @param visualNode
- * @param sourceNode
- */
- public void showInput(nsIDOMElement visualNode, Element sourceNode) {
- nsIDOMElement input = getInputElement(visualNode);
- if (getAttribute(SLIDER_SHOWINPUT_ATTR, sourceNode).equalsIgnoreCase(
- "false")) {
- input.setAttribute(HtmlComponentUtil.HTML_TYPE_ATTR,
- HTML_INPUTTYPE_HIDDEN);
- } else {
- input.setAttribute(HtmlComponentUtil.HTML_TYPE_ATTR,
- HTML_INPUTTYPE_TEXT);
- }
- }
-
- /**
- *
- * @param visualNode
- * @param sourceNode
- */
- public void showBoundaryValues(nsIDOMElement visualNode, Element sourceNode) {
- setMaxValue(visualNode, sourceNode);
- setMinValue(visualNode, sourceNode);
- }
-
- /**
- *
- * @param visualNode
- * @param sourceNode
- */
- public void setInputSize(nsIDOMElement visualNode, Element sourceNode) {
- nsIDOMElement input = getInputElement(visualNode);
- if (input != null) {
- input.setAttribute("size", getInputSize(sourceNode));
- }
- }
-
- /**
- *
- * @param visualNode
- * @param sourceNode
- */
- public void setInputClass(nsIDOMElement visualNode, Element sourceNode) {
- nsIDOMElement input = getInputElement(visualNode);
- if (input != null) {
- String tmp = getInputClass(sourceNode);
- input.setAttribute("class", tmp);
- }
- }
-
- /**
- *
- * @param visualNode
- * @param sourceNode
- */
- public void setMaxValue(nsIDOMElement visualNode, Element sourceNode) {
- nsIDOMNode maxValue = getMaxValueElement(visualNode);
- if (maxValue != null) {
- if (getAttribute(SLIDER_SHOWBOUNDARY_ATTR, sourceNode)
- .equalsIgnoreCase("false")) {
- maxValue.setNodeValue("");
- } else {
- String tmp = getAttribute(SLIDER_MAXVALUE_ATTR, sourceNode);
-
- if (tmp.length() == 0) {
- maxValue.setNodeValue(SLIDER_MAXVALUE_DEFAULT);
- } else {
- maxValue.setNodeValue(tmp);
- }
- }
- }
- correctArrowPosition(sourceNode, visualNode);
- }
-
- /**
- *
- * @param visualNode
- * @param sourceNode
- */
- public void setMinValue(nsIDOMElement visualNode, Element sourceNode) {
- nsIDOMNode minValue = getMinValueElement(visualNode);
- if (minValue != null) {
- if (getAttribute(SLIDER_SHOWBOUNDARY_ATTR, sourceNode)
- .equalsIgnoreCase("false")) {
- minValue.setNodeValue("");
- } else {
- String tmp = getAttribute(SLIDER_MINVALUE_ATTR, sourceNode);
- if (tmp.length() == 0) {
- minValue.setNodeValue(SLIDER_MINVALUE_DEFAULT);
- } else {
- minValue.setNodeValue(tmp);
- }
- }
- }
- correctArrowPosition(sourceNode, visualNode);
- }
-
- /**
- *
- * @param visualNode
- * @param sourceNode
- */
- public void setWidth(nsIDOMElement visualNode, Element sourceNode) {
- nsIDOMElement table = visualNode;
- String tmp = getAttribute(HtmlComponentUtil.HTML_WIDTH_ATTR, sourceNode);
- if (tmp.length() == 0) {
- tmp = parseStyleWidth(sourceNode);
- }
- if (tmp.length() == 0) {
- table.setAttribute(HtmlComponentUtil.HTML_WIDTH_ATTR, "200px;");
- } else {
- table.setAttribute(HtmlComponentUtil.HTML_WIDTH_ATTR, tmp);
- }
- }
-
- /**
- *
- * @param visualNode
- * @param sourceNode
- */
- public void setStyle(nsIDOMElement visualNode, Element sourceNode) {
- /*
- * Element table= visualNode; String tmp =
- * getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,sourceNode);
- */
-
- }
-
- /**
- * Corrects arrow position accordinlye max, min and inputValues
- *
- * @param sourceNode
- * @param visualElement
- */
- private void correctArrowPosition(Element sourceNode, nsIDOMElement visualElement) {
-
- String minValue = sourceNode.getAttribute(SLIDER_MINVALUE_ATTR);
- String maxValue = sourceNode.getAttribute(SLIDER_MAXVALUE_ATTR);
- String valueValue = sourceNode.getAttribute(SLIDER_VALUE_ATTR);
- String stepValue = sourceNode.getAttribute(SLIDER_STEP_ATTR);
- double min = 0;
- double max = 0;
- double value = 50;
- double step = 1;
- try {
- min = Integer.parseInt(minValue);
- } catch (NumberFormatException ex) {
- min = 0;
- }
- try {
- max = Integer.parseInt(maxValue);
- } catch (NumberFormatException ex) {
- max = 100;
- }
-
- try {
- value = Integer.parseInt(valueValue);
- } catch (NumberFormatException ex) {
- value = 50;
- }
- try {
- step = Integer.parseInt(stepValue);
- if (step < 1) {
- step=1;
- }
- } catch (NumberFormatException ex) {
- step = 1;
- }
- double h1 = ((roundForStep(step, value) - min) / (max - min)) * 100;
+ return minValue;
+ }
+
+ /**
+ *
+ * @param visualNode
+ * @param sourceNode
+ */
+ public void showInput(nsIDOMElement visualNode, Element sourceNode) {
+ nsIDOMElement input = getInputElement(visualNode);
+ if (getAttribute(SLIDER_SHOWINPUT_ATTR, sourceNode).equalsIgnoreCase(
+ "false")) {
+ input.setAttribute(HtmlComponentUtil.HTML_TYPE_ATTR,
+ HTML_INPUTTYPE_HIDDEN);
+ } else {
+ input.setAttribute(HtmlComponentUtil.HTML_TYPE_ATTR,
+ HTML_INPUTTYPE_TEXT);
+ }
+ }
+
+ /**
+ *
+ * @param visualNode
+ * @param sourceNode
+ */
+ public void showBoundaryValues(nsIDOMElement visualNode, Element sourceNode) {
+ setMaxValue(visualNode, sourceNode);
+ setMinValue(visualNode, sourceNode);
+ }
+
+ /**
+ *
+ * @param visualNode
+ * @param sourceNode
+ */
+ public void setInputSize(nsIDOMElement visualNode, Element sourceNode) {
+ nsIDOMElement input = getInputElement(visualNode);
+ if (input != null) {
+ input.setAttribute("size", getInputSize(sourceNode));
+ }
+ }
+
+ /**
+ *
+ * @param visualNode
+ * @param sourceNode
+ */
+ public void setInputClass(nsIDOMElement visualNode, Element sourceNode) {
+ nsIDOMElement input = getInputElement(visualNode);
+ if (input != null) {
+ String tmp = getInputClass(sourceNode);
+ input.setAttribute("class", tmp);
+ }
+ }
+
+ /**
+ *
+ * @param visualNode
+ * @param sourceNode
+ */
+ public void setMaxValue(nsIDOMElement visualNode, Element sourceNode) {
+ nsIDOMNode maxValue = getMaxValueElement(visualNode);
+ if (maxValue != null) {
+ if (getAttribute(SLIDER_SHOWBOUNDARY_ATTR, sourceNode)
+ .equalsIgnoreCase("false")) {
+ maxValue.setNodeValue("");
+ } else {
+ String tmp = getAttribute(SLIDER_MAXVALUE_ATTR, sourceNode);
+
+ if (tmp.length() == 0) {
+ maxValue.setNodeValue(SLIDER_MAXVALUE_DEFAULT);
+ } else {
+ maxValue.setNodeValue(tmp);
+ }
+ }
+ }
+ correctArrowPosition(sourceNode, visualNode);
+ }
+
+ /**
+ *
+ * @param visualNode
+ * @param sourceNode
+ */
+ public void setMinValue(nsIDOMElement visualNode, Element sourceNode) {
+ nsIDOMNode minValue = getMinValueElement(visualNode);
+ if (minValue != null) {
+ if (getAttribute(SLIDER_SHOWBOUNDARY_ATTR, sourceNode)
+ .equalsIgnoreCase("false")) {
+ minValue.setNodeValue("");
+ } else {
+ String tmp = getAttribute(SLIDER_MINVALUE_ATTR, sourceNode);
+ if (tmp.length() == 0) {
+ minValue.setNodeValue(SLIDER_MINVALUE_DEFAULT);
+ } else {
+ minValue.setNodeValue(tmp);
+ }
+ }
+ }
+ correctArrowPosition(sourceNode, visualNode);
+ }
+
+ /**
+ *
+ * @param visualNode
+ * @param sourceNode
+ */
+ public void setWidth(nsIDOMElement visualNode, Element sourceNode) {
+ nsIDOMElement table = visualNode;
+ String tmp = getAttribute(HtmlComponentUtil.HTML_WIDTH_ATTR, sourceNode);
+ if (tmp.length() == 0) {
+ tmp = parseStyleWidth(sourceNode);
+ }
+ if (tmp.length() == 0) {
+ table.setAttribute(HtmlComponentUtil.HTML_WIDTH_ATTR, "200px;");
+ } else {
+ table.setAttribute(HtmlComponentUtil.HTML_WIDTH_ATTR, tmp);
+ }
+ }
+
+ /**
+ *
+ * @param visualNode
+ * @param sourceNode
+ */
+ public void setStyle(nsIDOMElement visualNode, Element sourceNode) {
+ /*
+ * Element table= visualNode; String tmp =
+ * getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,sourceNode);
+ */
+
+ }
+
+ /**
+ * Corrects arrow position accordinlye max, min and inputValues
+ *
+ * @param sourceNode
+ * @param visualElement
+ */
+ private void correctArrowPosition(Element sourceNode,
+ nsIDOMElement visualElement) {
+
+ String minValue = sourceNode.getAttribute(SLIDER_MINVALUE_ATTR);
+ String maxValue = sourceNode.getAttribute(SLIDER_MAXVALUE_ATTR);
+ String valueValue = sourceNode.getAttribute(SLIDER_VALUE_ATTR);
+ String stepValue = sourceNode.getAttribute(SLIDER_STEP_ATTR);
+ double min = 0;
+ double max = 0;
+ double value = 50;
+ double step = 1;
+ try {
+ min = Integer.parseInt(minValue);
+ } catch (NumberFormatException ex) {
+ min = 0;
+ }
+ try {
+ max = Integer.parseInt(maxValue);
+ } catch (NumberFormatException ex) {
+ max = 100;
+ }
+
+ try {
+ value = Integer.parseInt(valueValue);
+ } catch (NumberFormatException ex) {
+ value = 50;
+ }
+ try {
+ step = Integer.parseInt(stepValue);
+ if (step < 1) {
+ step = 1;
+ }
+ } catch (NumberFormatException ex) {
+ step = 1;
+ }
+ double h1 = ((roundForStep(step, value) - min) / (max - min)) * 100;
double h2 = 100 - h1;
nsIDOMNodeList nodeList = visualElement.getChildNodes();
- nsIDOMNode node_01 = nodeList.item(1);
+ nsIDOMNode node_01 = nodeList.item(1);
nsIDOMNodeList nodeList_01 = node_01.getChildNodes();
nsIDOMNode node_01_00 = nodeList_01.item(0);
nsIDOMNodeList nodeList_01_00 = node_01_00.getChildNodes();
@@ -628,76 +678,81 @@
nsIDOMNodeList nodeList_01_00_00_00 = node_01_00_00_00.getChildNodes();
nsIDOMNode node_01_00_00_00_00 = nodeList_01_00_00_00.item(0);
nsIDOMNode node_01_00_00_00_02 = nodeList_01_00_00_00.item(2);
-
- nsIDOMElement table1Tr2Td1Table2Tr1Td1 = (nsIDOMElement)node_01_00_00_00_00.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
-
- table1Tr2Td1Table2Tr1Td1.setAttribute(
+
+ nsIDOMElement table1Tr2Td1Table2Tr1Td1 = (nsIDOMElement) node_01_00_00_00_00
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ table1Tr2Td1Table2Tr1Td1.setAttribute(
HtmlComponentUtil.HTML_WIDTH_ATTR, (int) h1 + "%");
- if(node_01_00_00_00_02!=null) {
- nsIDOMElement table1Tr2Td1Table2Tr1Td2 = (nsIDOMElement)node_01_00_00_00_02.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- table1Tr2Td1Table2Tr1Td2.setAttribute(
- HtmlComponentUtil.HTML_WIDTH_ATTR, (int) h2 + "%");
- }
- }
-
- /**
- * Round result accordinly step
- *
- * @param step
- * @param value
- * @return
- */
- private double roundForStep(double step, double value) {
- return Math.round(value / step) * step;
- }
-
- /**
- *
- * @param visualNode
- * @param sourceNode
- */
- public void setClass(nsIDOMElement visualNode, Element sourceNode) {
- nsIDOMElement table = visualNode;
- String tmp = getAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, sourceNode);
- table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- new StringBuffer().append(tmp).toString());
- }
-
- /**
- *
- * @param visualNode
- * @param sourceNode
- */
- public void setInputValue(nsIDOMElement visualNode, Element sourceNode) {
- nsIDOMElement input = getInputElement(visualNode);
- if (input != null) {
- String tmp = getAttribute("value", sourceNode);
- if (tmp.length() == 0) {
- input.setAttribute("value", HTML_INPUTVALUE_DEFAULT);
- } else {
- input.setAttribute("value", tmp);
- }
- }
- correctArrowPosition(sourceNode, visualNode);
- }
-
- /**
- *
- * @param visualNode
- * @param sourceNode
- */
- public void setInputStyle(nsIDOMElement visualNode, Element sourceNode) {
- nsIDOMElement input = getInputElement(visualNode);
- if (input != null) {
- String tmp = getAttribute("inputStyle", sourceNode);
- String style = getAttribute("style", (Element)input);
- if(style!=null) {
- input.setAttribute("style", tmp + style);
+ if (node_01_00_00_00_02 != null) {
+ nsIDOMElement table1Tr2Td1Table2Tr1Td2 = (nsIDOMElement) node_01_00_00_00_02
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ table1Tr2Td1Table2Tr1Td2.setAttribute(
+ HtmlComponentUtil.HTML_WIDTH_ATTR, (int) h2 + "%");
+ }
+ }
+
+ /**
+ * Round result accordinly step
+ *
+ * @param step
+ * @param value
+ * @return
+ */
+ private double roundForStep(double step, double value) {
+ return Math.round(value / step) * step;
+ }
+
+ /**
+ *
+ * @param visualNode
+ * @param sourceNode
+ */
+ public void setClass(nsIDOMElement visualNode, Element sourceNode) {
+ nsIDOMElement table = visualNode;
+ String tmp = getAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, sourceNode);
+ table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ new StringBuffer().append(tmp).toString());
+ }
+
+ /**
+ *
+ * @param visualNode
+ * @param sourceNode
+ */
+ public void setInputValue(nsIDOMElement visualNode, Element sourceNode) {
+ nsIDOMElement input = getInputElement(visualNode);
+ if (input != null) {
+ String tmp = getAttribute("value", sourceNode);
+ if (tmp.length() == 0) {
+ // input.setAttribute("value", HTML_INPUTVALUE_DEFAULT);
+ input.getAttributeNode("value").setNodeValue(
+ HTML_INPUTVALUE_DEFAULT);
} else {
+ // input.setAttribute("value", tmp);
+ input.getAttributeNode("value").setNodeValue(tmp);
+ }
+ }
+ correctArrowPosition(sourceNode, visualNode);
+ }
+
+ /**
+ *
+ * @param visualNode
+ * @param sourceNode
+ */
+ public void setInputStyle(nsIDOMElement visualNode, Element sourceNode) {
+ nsIDOMElement input = getInputElement(visualNode);
+ if (input != null) {
+ String tmp = getAttribute("inputStyle", sourceNode);
+ String style = getAttribute("style", (Element) input);
+ if (style != null) {
+ input.setAttribute("style", tmp + style);
+ } else {
input.setAttribute("style", tmp);
}
- }
- }
+ }
+ }
/**
*
@@ -706,24 +761,43 @@
*/
public void setInputPosition(nsIDOMElement visualNode, Element sourceNode) {
}
-
- /**
- *
- * @param visualNode
- * @param sourceNode
- */
- public void setMaxlength(nsIDOMElement visualNode, Element sourceNode) {
- nsIDOMElement input = getInputElement(visualNode);
- if (input != null) {
- String tmp = getAttribute("maxlength", sourceNode);
- input.setAttribute("maxlength", tmp);
- }
+
+ /**
+ *
+ * @param visualNode
+ * @param sourceNode
+ */
+ public void setMaxlength(nsIDOMElement visualNode, Element sourceNode) {
+ nsIDOMElement input = getInputElement(visualNode);
+ if (input != null) {
+ String tmp = getAttribute("maxlength", sourceNode);
+ input.setAttribute("maxlength", tmp);
+ }
}
@Override
public boolean isRecreateAtAttrChange(VpePageContext pageContext,
Element sourceElement, nsIDOMDocument visualDocument,
nsIDOMElement visualNode, Object data, String name, String value) {
- return true;
- }
+ return true;
+ }
+
+ @Override
+ public void setSourceAttributeSelection(VpePageContext pageContext,
+ Element sourceElement, int offset, int length, Object data) {
+ System.out.print("\n sourceElement:" + sourceElement.getNodeName()
+ + "\toffset:" + offset + "\tlength:" + length + "\tdata : "
+ + data);
+ VpeSourceDomBuilder sourceBuilder = pageContext.getSourceBuilder();
+ sourceBuilder.setAttributeSelection(sourceElement.getAttributeNode("value"), offset, length);
+ super.setSourceAttributeSelection(pageContext, sourceElement, offset,
+ length, data);
+ }
+ @Override
+ public void refreshBundleValues(VpePageContext pageContext,
+ Element sourceElement, Object data) {
+ System.out.print("\nrefresh");
+ // TODO Auto-generated method stub
+ super.refreshBundleValues(pageContext, sourceElement, data);
+ }
}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListShuttleTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListShuttleTemplate.java 2008-01-23 06:32:12 UTC (rev 5905)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListShuttleTemplate.java 2008-01-23 09:13:18 UTC (rev 5906)
@@ -24,9 +24,11 @@
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
import org.mozilla.interfaces.nsIDOMText;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
/**
* @author Sergey Dzmitrovich
@@ -34,7 +36,13 @@
*/
public class RichFacesListShuttleTemplate extends VpeAbstractTemplate {
+ private static final String ATTR_CONTROLS_TYPE = "controlsType";
/**
+ *
+ */
+ private static final String ATTR_SHOW_BUTTON_LABELS = "showButtonLabels";
+
+ /**
* source caption key
*/
private static final String SOURCE_CAPTION = "sourceCaption";
@@ -50,6 +58,16 @@
private static final String STYLE_PATH = "shuttle/shuttle.css";
/**
+ * path to img
+ */
+ private static final String BUTTON_IMG_PATH = "shuttle/button.gif";
+
+ /**
+ * path to img
+ */
+ private static final String HEADER_IMG_PATH = "shuttle/button.gif";
+
+ /**
* default value of width of box(list)
*/
private static final String DEFAULT_LIST_WIDTH = "140px";
@@ -60,6 +78,16 @@
private static final String DEFAULT_LIST_HEIGHT = "140px";
/**
+ * rowClasses attribute name
+ */
+ private static final String ATTR_ROW_CLASSES = "rowClasses";
+
+ /**
+ * columnClasses attribute name
+ */
+ private static final String ATTR_COLUMN_CLASSES = "columnClasses";
+
+ /**
* attribute name of width of source list
*/
private static final String ATTR_SOURCE_LIST_WIDTH = "sourceListWidth";
@@ -138,6 +166,57 @@
}
/**
+ * style classes
+ */
+ private static final Map<String, String> defaultStyleClasses;
+
+ static {
+ defaultStyleClasses = new HashMap<String, String>();
+
+ // general style
+ defaultStyleClasses.put("style", "rich-list-shuttle");
+
+ // styles of the lists
+ defaultStyleClasses.put("list-header", "rich-shuttle-list-header");
+ defaultStyleClasses.put("list", "rich-shuttle-list-content");
+
+ // styles of button's block
+ defaultStyleClasses.put("controls", "rich-shuttle-controls");
+
+ // styles of the first set of buttons
+ defaultStyleClasses.put("copyAllControl",
+ "rich-shuttle-button rich-shuttle-copyAll");
+ defaultStyleClasses.put("copyControl",
+ "rich-shuttle-button rich-shuttle-copy");
+ defaultStyleClasses.put("removeControl",
+ "rich-shuttle-button rich-shuttle-remove");
+ defaultStyleClasses.put("removeAllControl",
+ "rich-shuttle-button rich-shuttle-removeAll");
+
+ // styles of the second set of buttons
+ defaultStyleClasses.put("topControl",
+ "rich-shuttle-button rich-shuttle-top");
+ defaultStyleClasses.put("upControl",
+ "rich-shuttle-button rich-shuttle-up");
+ defaultStyleClasses.put("downControl",
+ "rich-shuttle-button rich-shuttle-down");
+ defaultStyleClasses.put("bottomControl",
+ "rich-shuttle-button rich-shuttle-bottom");
+
+ // styles of captions
+ defaultStyleClasses.put("sourceCaption", "rich-shuttle-source-caption");
+ defaultStyleClasses.put("targetCaption", "rich-shuttle-target-caption");
+
+ // styles of rows
+ defaultStyleClasses.put("sourceRow", "rich-shuttle-source-row");
+ defaultStyleClasses.put("targetRow", "rich-shuttle-target-row");
+
+ // styles of rows
+ defaultStyleClasses.put("columns", "");
+
+ }
+
+ /**
* default labels
*/
private static final Map<String, String> defaultLabels;
@@ -225,6 +304,11 @@
private final List<String> targetButtons = new ArrayList<String>();
/**
+ *
+ */
+ private static final Map<String, String> styleClasses = new HashMap<String, String>();
+
+ /**
* value of vertical-align attribute for source (copy/remove) buttons
*/
private String sourceButtonsAlign;
@@ -250,8 +334,28 @@
private String targetListsWidth;
/**
+ * row style class
+ */
+ private String rowClass;
+
+ /**
+ * column style class
+ */
+ private List<String> columnClasses;
+
+ /**
+ * facetLabels
+ */
+ private final Map<String, Node> facetLabels = new HashMap<String, Node>();
+
+ /**
*
*/
+ private boolean isShowButtonLabels;
+
+ /**
+ *
+ */
public RichFacesListShuttleTemplate() {
}
@@ -292,11 +396,14 @@
// create table element
nsIDOMElement basicTable = visualDocument.createElement(HTML.TAG_TABLE);
- ComponentUtil.copyAttributes(sourceNode, basicTable);
+ // ComponentUtil.copyAttributes(sourceNode, basicTable);
+
+ basicTable.setAttribute("class", styleClasses.get("style"));
+
VpeCreationData creationData = new VpeCreationData(basicTable);
// create caption
- nsIDOMElement caption = createCaption(visualDocument);
+ nsIDOMElement caption = createCaption(visualDocument, creationData);
if (caption != null)
basicTable.appendChild(caption);
@@ -306,7 +413,7 @@
// create source box
nsIDOMElement sourceBoxTd = visualDocument.createElement(HTML.TAG_TD);
nsIDOMElement sourceBox = createBox(visualDocument, creationData,
- children);
+ children, "source");
sourceBox.setAttribute(HTML.ATTR_STYLE, "width:" + sourceListsWidth
+ ";height:" + listsHeight + ";");
sourceBoxTd.appendChild(sourceBox);
@@ -315,7 +422,7 @@
nsIDOMElement sourceButtonsTd = visualDocument
.createElement(HTML.TAG_TD);
nsIDOMElement sourceButtonsBlock = createButtonsBlock(visualDocument,
- sourceButtons);
+ creationData, sourceButtons);
sourceButtonsTd.appendChild(sourceButtonsBlock);
// set vertical-align attribute for source buttons
@@ -325,7 +432,7 @@
// create target box
nsIDOMElement targetBoxTd = visualDocument.createElement(HTML.TAG_TD);
nsIDOMElement targetBox = createBox(visualDocument, creationData,
- children);
+ children, "target");
targetBox.setAttribute(HTML.ATTR_STYLE, "width:" + targetListsWidth
+ ";height:" + listsHeight + ";");
targetBoxTd.appendChild(targetBox);
@@ -334,7 +441,7 @@
nsIDOMElement targetButtonsTd = visualDocument
.createElement(HTML.TAG_TD);
nsIDOMElement targetButtonsBlock = createButtonsBlock(visualDocument,
- targetButtons);
+ creationData, targetButtons);
targetButtonsTd.appendChild(targetButtonsBlock);
// set vertical-align attribute for target buttons
@@ -350,6 +457,8 @@
// add "tr" to table
basicTable.appendChild(basicTr);
+ clearData();
+
return creationData;
}
@@ -361,24 +470,29 @@
* @param sourceCaptionLabel
* @param targetCaptionLabel
* @param visualDocument
+ * @param creationData
+ * @param sourceElement
* @return
*/
- private nsIDOMElement createCaption(nsIDOMDocument visualDocument) {
+ private nsIDOMElement createCaption(nsIDOMDocument visualDocument,
+ VpeCreationData creationData) {
// check sourceCaptionLabel
if ((labels.get(SOURCE_CAPTION).length() == 0)
- && (labels.get(TARGET_CAPTION).length() == 0))
+ && (!facetLabels.containsKey(SOURCE_CAPTION))
+ && (labels.get(TARGET_CAPTION).length() == 0)
+ && (!facetLabels.containsKey(TARGET_CAPTION)))
return null;
// basic element for caption is "tr" tag
nsIDOMElement caption = visualDocument.createElement(HTML.TAG_TR);
// create source caption label
- caption.appendChild(createCaptionLabel(visualDocument, labels
- .get(SOURCE_CAPTION)));
+ caption.appendChild(createCaptionLabel(visualDocument, creationData,
+ SOURCE_CAPTION));
// create target caption label
- caption.appendChild(createCaptionLabel(visualDocument, labels
- .get(TARGET_CAPTION)));
+ caption.appendChild(createCaptionLabel(visualDocument, creationData,
+ TARGET_CAPTION));
return caption;
@@ -388,11 +502,13 @@
* create caption label
*
* @param visualDocument
+ * @param creationData
+ * @param sourceElement
* @param label
* @return
*/
private nsIDOMElement createCaptionLabel(nsIDOMDocument visualDocument,
- String label) {
+ VpeCreationData creationData, String labelId) {
// create "td" for target caption label
nsIDOMElement captionLabelTd = visualDocument
@@ -400,14 +516,25 @@
// set attributes
captionLabelTd.setAttribute(HTML.ATTR_COLSPAN, "2");
- captionLabelTd.setAttribute(HTML.ATTR_CLASS,
- "rich-shuttle-caption-label");
+ captionLabelTd.setAttribute(HTML.ATTR_CLASS, styleClasses.get(labelId));
+ // if facet is defined for this label add facet to "td"
+ if (facetLabels.containsKey(labelId)) {
+
+ VpeChildrenInfo captionLabelTdInfo = new VpeChildrenInfo(
+ captionLabelTd);
+ creationData.addChildrenInfo(captionLabelTdInfo);
+
+ captionLabelTdInfo.addSourceChild(facetLabels.get(labelId));
+ }
// add to "td" value of captionLabel
- nsIDOMText captionLabelText = visualDocument.createTextNode(label);
+ else {
+ nsIDOMText captionLabelText = visualDocument.createTextNode(labels
+ .get(labelId));
- captionLabelTd.appendChild(captionLabelText);
+ captionLabelTd.appendChild(captionLabelText);
+ }
return captionLabelTd;
}
@@ -420,17 +547,21 @@
* @return
*/
private nsIDOMElement createBox(nsIDOMDocument visualDocument,
- VpeCreationData creationData, List<Node> children) {
+ VpeCreationData creationData, List<Node> children, String boxId) {
nsIDOMElement div = visualDocument.createElement(HTML.TAG_DIV);
- div.setAttribute(HTML.ATTR_CLASS, "rich-shuttle-box");
+ div.setAttribute(HTML.ATTR_CLASS, styleClasses.get("list"));
// create table element
nsIDOMElement box = visualDocument.createElement(HTML.TAG_TABLE);
- // box.setAttribute(HTML.ATTR_CLASS, "rich-shuttle-box");
+ box.setAttribute("cellspacing", "0");
+ box.setAttribute("cellpadding", "0");
+ box.setAttribute("width", "100%");
// create "tr" for box
nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
tr.setAttribute(HTML.ATTR_STYLE, "vertical-align:top");
+ tr.setAttribute(HTML.ATTR_CLASS, styleClasses.get(boxId + "Row") + " "
+ + rowClass);
VpeChildrenInfo trInfo = new VpeChildrenInfo(tr);
creationData.addChildrenInfo(trInfo);
@@ -452,20 +583,22 @@
* create buttons block
*
* @param visualDocument
+ * @param creationData
* @param buttonNames
* @return
*/
private nsIDOMElement createButtonsBlock(nsIDOMDocument visualDocument,
- List<String> buttonNames) {
+ VpeCreationData creationData, List<String> buttonNames) {
// create "div"
nsIDOMElement buttonsBlock = visualDocument.createElement(HTML.TAG_DIV);
- buttonsBlock.setAttribute(HTML.ATTR_CLASS, "rich-shuttle-controls");
+ buttonsBlock
+ .setAttribute(HTML.ATTR_CLASS, styleClasses.get("controls"));
for (String buttonId : buttonNames) {
- buttonsBlock.appendChild(createButton(visualDocument, labels
- .get(buttonId), buttonImages.get(buttonId)));
+ buttonsBlock.appendChild(createButton(visualDocument, creationData,
+ buttonId));
}
@@ -477,44 +610,57 @@
* create button
*
* @param visualDocument
+ * @param creationData
* @param buttonValue
* @param buttonImage
* @return
*/
private nsIDOMElement createButton(nsIDOMDocument visualDocument,
- String buttonValue, String buttonImageFile) {
+ VpeCreationData creationData, String buttonId) {
nsIDOMElement buttonSpace = visualDocument.createElement(HTML.TAG_DIV);
buttonSpace.setAttribute(HTML.ATTR_CLASS, "rich-shuttle-control");
- // button represent "div" element
- nsIDOMElement button = visualDocument.createElement(HTML.TAG_DIV);
- button.setAttribute(HTML.ATTR_CLASS, "rich-shuttle-button");
- button.setAttribute(HTML.ATTR_STYLE, ComponentUtil
- .getBackgoundImgStyle("shuttle/button.gif"));
+ if (facetLabels.containsKey(buttonId)) {
- // button represent "div" element
- nsIDOMElement buttonContent = visualDocument
- .createElement(HTML.TAG_DIV);
- buttonContent.setAttribute(HTML.ATTR_CLASS,
- "rich-shuttle-button-content");
+ VpeChildrenInfo buttonInfo = new VpeChildrenInfo(buttonSpace);
+ creationData.addChildrenInfo(buttonInfo);
- nsIDOMElement buttonImage = visualDocument.createElement(HTML.TAG_IMG);
+ buttonInfo.addSourceChild(facetLabels.get(buttonId));
- buttonImage.setAttribute(HTML.ATTR_WIDTH, "15");
- buttonImage.setAttribute(HTML.ATTR_HEIGHT, "15");
- buttonImage
- .setAttribute(HTML.ATTR_CLASS, "rich-shuttle-button-content");
- ComponentUtil.setImg(buttonImage, buttonImageFile);
+ } else {
+ // button represent "div" element
+ nsIDOMElement button = visualDocument.createElement(HTML.TAG_DIV);
+ button.setAttribute(HTML.ATTR_CLASS, styleClasses.get(buttonId));
+ button.setAttribute(HTML.ATTR_STYLE, ComponentUtil
+ .getBackgoundImgStyle(BUTTON_IMG_PATH));
+ // button represent "div" element
+ nsIDOMElement buttonContent = visualDocument
+ .createElement(HTML.TAG_DIV);
+ buttonContent.setAttribute(HTML.ATTR_CLASS,
+ "rich-shuttle-button-content");
- nsIDOMText buttonText = visualDocument.createTextNode(buttonValue);
+ nsIDOMElement buttonImage = visualDocument
+ .createElement(HTML.TAG_IMG);
- buttonContent.appendChild(buttonImage);
- buttonContent.appendChild(buttonText);
+ buttonImage.setAttribute(HTML.ATTR_WIDTH, "15");
+ buttonImage.setAttribute(HTML.ATTR_HEIGHT, "15");
+ buttonImage.setAttribute(HTML.ATTR_CLASS,
+ "rich-shuttle-button-content");
+ ComponentUtil.setImg(buttonImage, buttonImages.get(buttonId));
+ buttonContent.appendChild(buttonImage);
- button.appendChild(buttonContent);
- buttonSpace.appendChild(button);
+ if (isShowButtonLabels) {
+ nsIDOMText buttonText = visualDocument.createTextNode(labels
+ .get(buttonId));
+ buttonContent.appendChild(buttonText);
+ }
+
+ button.appendChild(buttonContent);
+
+ buttonSpace.appendChild(button);
+ }
return buttonSpace;
}
@@ -527,38 +673,82 @@
void prepareData(Element sourceElement) {
// prepare labels
- labels.clear();
+ Set<String> labelsKeys = defaultLabels.keySet();
- Set<String> labelsKeys = defaultLabels.keySet();
+ isShowButtonLabels = !"false".equalsIgnoreCase(sourceElement
+ .getAttribute(ATTR_SHOW_BUTTON_LABELS));
+
for (String key : labelsKeys) {
String label = sourceElement.getAttribute(key + "Label");
+
if (label != null)
labels.put(key, label);
else
labels.put(key, defaultLabels.get(key));
}
- // prepare source buttons
- sourceButtons.clear();
- if (!"false".equalsIgnoreCase(sourceElement
- .getAttribute(ATTR_FAST_MOVE_CONTROLS_VIZIBLE)))
- sourceButtons.addAll(fastMoveButtons);
- if (!"false".equalsIgnoreCase(sourceElement
- .getAttribute(ATTR_MOVE_CONTROLS_VIZIBLE)))
- sourceButtons
- .addAll(sourceButtons.size() == 0 ? 0 : 1, moveButtons);
+ // prepare style classes
+ Set<String> styleClassesKeys = defaultStyleClasses.keySet();
+ for (String key : styleClassesKeys) {
- // prepare target buttons
- targetButtons.clear();
- if (!"false".equalsIgnoreCase(sourceElement
- .getAttribute(ATTR_FAST_ORDER_CONTROLS_VIZIBLE)))
- targetButtons.addAll(fastOrderButtons);
- if (!"false".equalsIgnoreCase(sourceElement
- .getAttribute(ATTR_ORDER_CONTROLS_VIZIBLE)))
- targetButtons.addAll(targetButtons.size() == 0 ? 0 : 1,
- orderButtons);
+ String styleClass = sourceElement.getAttribute(key + "Class");
+ if (styleClass != null)
+ styleClasses.put(key, defaultStyleClasses.get(key) + " "
+ + styleClass);
+ else
+ styleClasses.put(key, defaultStyleClasses.get(key));
+ }
+ // prepare facets
+ NodeList children = sourceElement.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+
+ Node child = children.item(i);
+
+ if ((child instanceof Element)
+ && ("facet".equals(child.getLocalName()))
+ && (defaultLabels.containsKey(((Element) child)
+ .getAttribute("name")))) {
+
+ facetLabels.put(((Element) child).getAttribute("name"), child);
+
+ }
+
+ }
+
+ // get rowClass
+ String rowClasses = sourceElement.getAttribute(ATTR_ROW_CLASSES);
+
+ // if this attribue exist then
+ if (rowClasses != null) {
+ rowClass = rowClasses.split(",")[0];
+ }
+
+ // if "controlsType" attribute is not "none" (if buttons are visible)
+ if (!"none".equalsIgnoreCase(sourceElement
+ .getAttribute(ATTR_CONTROLS_TYPE))) {
+
+ // prepare source buttons
+ if (!"false".equalsIgnoreCase(sourceElement
+ .getAttribute(ATTR_FAST_MOVE_CONTROLS_VIZIBLE)))
+ sourceButtons.addAll(fastMoveButtons);
+ if (!"false".equalsIgnoreCase(sourceElement
+ .getAttribute(ATTR_MOVE_CONTROLS_VIZIBLE)))
+ sourceButtons.addAll(sourceButtons.size() == 0 ? 0 : 1,
+ moveButtons);
+
+ // prepare target buttons
+ if (!"false".equalsIgnoreCase(sourceElement
+ .getAttribute(ATTR_FAST_ORDER_CONTROLS_VIZIBLE)))
+ targetButtons.addAll(fastOrderButtons);
+ if (!"false".equalsIgnoreCase(sourceElement
+ .getAttribute(ATTR_ORDER_CONTROLS_VIZIBLE)))
+ targetButtons.addAll(targetButtons.size() == 0 ? 0 : 1,
+ orderButtons);
+
+ }
+
// prepare buttons attributes
sourceButtonsAlign = sourceElement
.getAttribute(ATTR_MOVE_CONTROLS_VERTICAL_ALIGN) != null ? sourceElement
@@ -583,4 +773,22 @@
.getAttribute(ATTR_TARGET_LIST_WIDTH)
: DEFAULT_LIST_WIDTH;
}
+
+ private void clearData() {
+
+ labels.clear();
+ styleClasses.clear();
+ sourceButtons.clear();
+ targetButtons.clear();
+ facetLabels.clear();
+
+ }
+
+ /**
+ *
+ * @param sourceElement
+ * @param name
+ * @return
+ */
+
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-01-23 06:32:12 UTC (rev 5905)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-01-23 09:13:18 UTC (rev 5906)
@@ -727,6 +727,7 @@
</vpe:tag>
<vpe:tag name="rich:listShuttle" case-sensitive="yes">
+ <vpe:copy attrs="style" />
<vpe:template children="yes" modify="yes"
class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesListShuttleTemplate">
<vpe:dnd>
@@ -735,6 +736,9 @@
<vpe:container-child tag-name="column" />
</vpe:drop>
</vpe:dnd>
+ <vpe:resize>
+ <vpe:height height-attr="listsHeight" />
+ </vpe:resize>
<vpe:textFormating>
<vpe:format type="UnderlineFormat">
<vpe:formatAttribute type="style" />
18 years, 2 months
JBoss Tools SVN: r5905 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-01-23 01:32:12 -0500 (Wed, 23 Jan 2008)
New Revision: 5905
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploySection.java
Log:
JBIDE-1306 slight UI improvement
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploySection.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploySection.java 2008-01-23 05:35:15 UTC (rev 5904)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploySection.java 2008-01-23 06:32:12 UTC (rev 5905)
@@ -132,11 +132,12 @@
// first row
FormData labelData = new FormData();
labelData.left = new FormAttachment(0,5);
+ labelData.right = new FormAttachment(text,-5);
labelData.top = new FormAttachment(descriptionLabel,5);
label.setLayoutData(labelData);
FormData textData = new FormData();
- textData.left = new FormAttachment(label, 5);
+ textData.left = new FormAttachment(button, -305);
textData.top = new FormAttachment(descriptionLabel,5);
textData.right = new FormAttachment(button, -5);
text.setLayoutData(textData);
@@ -150,11 +151,12 @@
// second row
FormData tempLabelData = new FormData();
tempLabelData.left = new FormAttachment(0,5);
+ tempLabelData.right = new FormAttachment(text, -5);
tempLabelData.top = new FormAttachment(text,5);
tempDeployLabel.setLayoutData(tempLabelData);
FormData tempTextData = new FormData();
- tempTextData.left = new FormAttachment(tempDeployLabel, 5);
+ tempTextData.left = new FormAttachment(tempDeployButton, -305);
tempTextData.top = new FormAttachment(text,5);
tempTextData.right = new FormAttachment(tempDeployButton, -5);
tempDeployText.setLayoutData(tempTextData);
@@ -165,8 +167,6 @@
tempButtonData.top = new FormAttachment(text,5);
tempDeployButton.setLayoutData(tempButtonData);
-
-
text.setEditable(false);
tempDeployText.setEditable(false);
18 years, 2 months
JBoss Tools SVN: r5904 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-01-23 00:35:15 -0500 (Wed, 23 Jan 2008)
New Revision: 5904
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/JBossServerView.java
Log:
JBIDE-1281 an oldie but a goodie! finally fixed
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/JBossServerView.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/JBossServerView.java 2008-01-23 02:14:11 UTC (rev 5903)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/JBossServerView.java 2008-01-23 05:35:15 UTC (rev 5904)
@@ -174,6 +174,7 @@
public ServerExtensionFrame getExtensionFrame() { return this.extensionFrame; }
public void setFocus() {
+ getExtensionFrame().getViewer().getTree().setFocus();
}
public IServer getSelectedServer() {
18 years, 2 months
JBoss Tools SVN: r5903 - in trunk: jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-01-22 21:14:11 -0500 (Tue, 22 Jan 2008)
New Revision: 5903
Modified:
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/META-INF/MANIFEST.MF
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/WebWizardsTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamPreferencesPageTest.java
trunk/tests/features/org.jboss.tools.test.feature/feature.xml
Log:
tests added for preferences pages and new wizards
Modified: trunk/jst/tests/org.jboss.tools.jst.web.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.ui.test/META-INF/MANIFEST.MF 2008-01-23 02:10:33 UTC (rev 5902)
+++ trunk/jst/tests/org.jboss.tools.jst.web.ui.test/META-INF/MANIFEST.MF 2008-01-23 02:14:11 UTC (rev 5903)
@@ -8,6 +8,7 @@
org.junit,
org.eclipse.ui,
org.eclipse.core.runtime,
- org.jboss.tools.common.model.ui
+ org.jboss.tools.common.model.ui,
+ org.jboss.tools.common.model.ui.test
Export-Package: org.jboss.tools.jst.web.ui.test
Bundle-ClassPath: jst-web-ui.jar
Modified: trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/WebWizardsTest.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/WebWizardsTest.java 2008-01-23 02:10:33 UTC (rev 5902)
+++ trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/WebWizardsTest.java 2008-01-23 02:14:11 UTC (rev 5903)
@@ -16,6 +16,7 @@
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.PlatformUI;
+import org.jboss.common.model.ui.test.ModelNewWizardTest;
import org.jboss.tools.common.model.ui.wizard.newfile.NewHTMLFileWizard;
import org.jboss.tools.common.model.ui.wizard.newfile.NewJSPFileWizard;
import org.jboss.tools.common.model.ui.wizard.newfile.NewPropertiesFileWizard;
@@ -31,26 +32,8 @@
* @author eskimo
*
*/
-public class WebWizardsTest extends TestCase {
+public class WebWizardsTest extends ModelNewWizardTest {
- private void testNewWizardInstanceIsCreated(String id) {
- IWizard
- aWizard = WorkbenchUtils.findWizardByDefId(
- id);
-
- WizardDialog dialog = new WizardDialog(
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- aWizard);
- dialog.setBlockOnOpen(false);
- try {
- dialog.open();
- IWizardPage page = dialog.getCurrentPage();
- assertTrue("Start page is not loaded",page instanceof DefaultStandardStep);
- } finally {
- dialog.close();
- }
- }
-
public void testNewCssWizardInstanceIsCreated() {
testNewWizardInstanceIsCreated(NewCSSFileWizard.class.getName());
}
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamPreferencesPageTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamPreferencesPageTest.java 2008-01-23 02:10:33 UTC (rev 5902)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamPreferencesPageTest.java 2008-01-23 02:14:11 UTC (rev 5903)
@@ -17,6 +17,7 @@
import org.jboss.tools.seam.core.project.facet.SeamRuntime;
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.ui.preferences.SeamPreferencePage;
+import org.jboss.tools.seam.ui.preferences.SeamValidatorPreferencePage;
import org.jboss.tools.test.util.WorkbenchUtils;
import junit.framework.TestCase;
@@ -28,18 +29,7 @@
public class SeamPreferencesPageTest extends TestCase {
- @Override
- protected void setUp() throws Exception {
- // TODO Auto-generated method stub
- super.setUp();
- }
- @Override
- protected void tearDown() throws Exception {
- // TODO Auto-generated method stub
- super.tearDown();
- }
-
/**
* Test that preference page is showed up without errors
*/
@@ -60,6 +50,26 @@
}
}
+ /**
+ * Test that preference page is showed up without errors
+ */
+ public void testShowSeamValidationPreferencePage() {
+
+ PreferenceDialog prefDialog =
+ WorkbenchUtils.createPreferenceDialog(
+ SeamValidatorPreferencePage.PREF_ID);
+
+ try {
+ prefDialog.setBlockOnOpen(false);
+ prefDialog.open();
+
+ Object selectedPage = prefDialog.getSelectedPage();
+ assertTrue("Selected page is not an instance of SeamValidatorPreferencePage", selectedPage instanceof SeamValidatorPreferencePage);
+ } finally {
+ prefDialog.close();
+ }
+ }
+
public void testJiraJbide1490 () {
SeamRuntime[] seamRts = SeamRuntimeManager.getInstance().getRuntimes();
Modified: trunk/tests/features/org.jboss.tools.test.feature/feature.xml
===================================================================
--- trunk/tests/features/org.jboss.tools.test.feature/feature.xml 2008-01-23 02:10:33 UTC (rev 5902)
+++ trunk/tests/features/org.jboss.tools.test.feature/feature.xml 2008-01-23 02:14:11 UTC (rev 5903)
@@ -1,24 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.jboss.tools.test_feature"
- label="Tools Tests"
- version="2.0.0">
-
- <description url="http://www.jboss.org/tools">
- JBossTools unit tests feature
- </description>
-
- <copyright>
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.test_feature"
+ label="Tools Tests"
+ version="2.0.0">
+
+ <description url="http://www.jboss.org/tools">
+ JBossTools unit tests feature
+ </description>
+
+ <copyright>
Copyright (c) 2007 Exadel, Inc and 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:
-Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- </copyright>
-
- <license url="http://www.eclipse.org/legal/epl-v10.html">
+Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ </copyright>
+
+ <license url="http://www.eclipse.org/legal/epl-v10.html">
Eclipse Public License - v 1.0
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS
ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
@@ -214,141 +214,148 @@
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.common.kb.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.common.model.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.common.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.common.verification.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jsf.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jsf.text.ext.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jsf.verification.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jst.web.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.vpe.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jst.web.ui.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.seam.core.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.seam.ui.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.vpe.xulrunner.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jsf.vpe.richfaces.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jsf.vpe.ui.test"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.jsf.vpe.facelets.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jsf.vpe.jsf.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jsf.vpe.seam.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jsf.vpe.html.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.struts.vpe.struts.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.test.product"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
+litigation.
+ </license>
+
+ <plugin
+ id="org.jboss.tools.common.kb.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.common.model.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.common.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.common.verification.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.text.ext.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.verification.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jst.web.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.vpe.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jst.web.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.seam.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.seam.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.vpe.xulrunner.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.vpe.richfaces.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.vpe.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.vpe.facelets.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.vpe.jsf.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.vpe.seam.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.vpe.html.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.struts.vpe.struts.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.test.product"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.common.model.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
18 years, 2 months
JBoss Tools SVN: r5902 - in trunk/jsf/tests/org.jboss.tools.jsf.ui.test: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-01-22 21:10:33 -0500 (Tue, 22 Jan 2008)
New Revision: 5902
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/.classpath
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/.project
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/build.properties
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/
Log:
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/.classpath
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/.classpath (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/.classpath 2008-01-23 02:10:33 UTC (rev 5902)
@@ -0,0 +1,7 @@
+<?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="output" path="bin"/>
+</classpath>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/.project
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/.project (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/.project 2008-01-23 02:10:33 UTC (rev 5902)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.jsf.ui.test</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/jsf/tests/org.jboss.tools.jsf.ui.test/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF 2008-01-23 02:10:33 UTC (rev 5902)
@@ -0,0 +1,6 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: JSF UI Test Plug-in
+Bundle-SymbolicName: org.jboss.tools.jsf.ui.test
+Bundle-Version: 1.0.0
+Bundle-Vendor: Red Hat, Inc.
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/build.properties
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/build.properties (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/build.properties 2008-01-23 02:10:33 UTC (rev 5902)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
18 years, 2 months
JBoss Tools SVN: r5901 - trunk/jsf/tests.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-01-22 21:10:19 -0500 (Tue, 22 Jan 2008)
New Revision: 5901
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/
Log:
jsf.ui tests plugin
18 years, 2 months
JBoss Tools SVN: r5900 - trunk/common/tests.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-01-22 21:04:04 -0500 (Tue, 22 Jan 2008)
New Revision: 5900
Added:
trunk/common/tests/org.jboss.tools.common.model.ui.test/
Removed:
trunk/common/tests/org.jboss.common.model.ui.test/
Log:
correct plugin name
Copied: trunk/common/tests/org.jboss.tools.common.model.ui.test (from rev 5899, trunk/common/tests/org.jboss.common.model.ui.test)
18 years, 2 months
JBoss Tools SVN: r5899 - in trunk/common/tests/org.jboss.common.model.ui.test: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-01-22 21:03:29 -0500 (Tue, 22 Jan 2008)
New Revision: 5899
Modified:
trunk/common/tests/org.jboss.common.model.ui.test/.project
trunk/common/tests/org.jboss.common.model.ui.test/META-INF/MANIFEST.MF
Log:
correct plugin name
Modified: trunk/common/tests/org.jboss.common.model.ui.test/.project
===================================================================
--- trunk/common/tests/org.jboss.common.model.ui.test/.project 2008-01-23 01:59:15 UTC (rev 5898)
+++ trunk/common/tests/org.jboss.common.model.ui.test/.project 2008-01-23 02:03:29 UTC (rev 5899)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.jboss.common.model.ui.test</name>
+ <name>org.jboss.tools.common.model.ui.test</name>
<comment></comment>
<projects>
</projects>
Modified: trunk/common/tests/org.jboss.common.model.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/tests/org.jboss.common.model.ui.test/META-INF/MANIFEST.MF 2008-01-23 01:59:15 UTC (rev 5898)
+++ trunk/common/tests/org.jboss.common.model.ui.test/META-INF/MANIFEST.MF 2008-01-23 02:03:29 UTC (rev 5899)
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Model UI Test Plug-in
-Bundle-SymbolicName: org.jboss.common.model.ui.test
+Bundle-SymbolicName: org.jboss.tools.common.model.ui.test
Bundle-Version: 1.0.0
Require-Bundle: org.junit;visibility:=reexport,
org.eclipse.jface,
18 years, 2 months