JBoss Tools SVN: r16471 - in trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature: sourceTemplatePlugin and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-07-07 13:44:08 -0400 (Tue, 07 Jul 2009)
New Revision: 16471
Modified:
trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplateFeature/feature.properties
trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplatePlugin/about.properties
trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplatePlugin/plugin.properties
Log:
update source plugin and feature name
Modified: trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplateFeature/feature.properties
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplateFeature/feature.properties 2009-07-07 17:30:48 UTC (rev 16470)
+++ trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplateFeature/feature.properties 2009-07-07 17:44:08 UTC (rev 16471)
@@ -1,5 +1,5 @@
# properties file for org.jboss.tools.jmx.source
-featureName=jPDL4 Graphical Editor Sources
+featureName=jBPM 4 Graphical Editor and Tools Sources
featureProvider=JBoss by Red Hat
# "updateSiteName" property - label for the update site
Modified: trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplatePlugin/about.properties
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplatePlugin/about.properties 2009-07-07 17:30:48 UTC (rev 16470)
+++ trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplatePlugin/about.properties 2009-07-07 17:44:08 UTC (rev 16471)
@@ -1,4 +1,4 @@
-blurb=jPDL4 Graphical Editor Source\n\
+blurb=jBPM 4 Graphical Editor and Tools Sources\n\
\n\
Version: {featureVersion}\n\
Build id: {0}\n\
Modified: trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplatePlugin/plugin.properties
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplatePlugin/plugin.properties 2009-07-07 17:30:48 UTC (rev 16470)
+++ trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplatePlugin/plugin.properties 2009-07-07 17:44:08 UTC (rev 16471)
@@ -1,3 +1,3 @@
-pluginName = jPDL4 Graphical Editor Sources
+pluginName = jBPM 4 Graphical Editor and Tools Sources
providerName = JBoss by Red Hat
16 years, 9 months
JBoss Tools SVN: r16470 - in trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature: sourceTemplatePlugin and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-07-07 13:30:48 -0400 (Tue, 07 Jul 2009)
New Revision: 16470
Modified:
trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplateFeature/feature.properties
trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplatePlugin/plugin.properties
Log:
Modified: trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplateFeature/feature.properties
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplateFeature/feature.properties 2009-07-07 17:29:03 UTC (rev 16469)
+++ trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplateFeature/feature.properties 2009-07-07 17:30:48 UTC (rev 16470)
@@ -1,5 +1,5 @@
# properties file for org.jboss.tools.jmx.source
-featureName=jPDL4 Graphical Editor Source
+featureName=jPDL4 Graphical Editor Sources
featureProvider=JBoss by Red Hat
# "updateSiteName" property - label for the update site
Modified: trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplatePlugin/plugin.properties
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplatePlugin/plugin.properties 2009-07-07 17:29:03 UTC (rev 16469)
+++ trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplatePlugin/plugin.properties 2009-07-07 17:30:48 UTC (rev 16470)
@@ -1,3 +1,3 @@
-pluginName = jPDL4 Graphical Editor Source
+pluginName = jPDL4 Graphical Editor Sources
providerName = JBoss by Red Hat
16 years, 9 months
JBoss Tools SVN: r16469 - in trunk/jbpm/features/org.jboss.tools.jbpm.common.feature: sourceTemplatePlugin and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-07-07 13:29:03 -0400 (Tue, 07 Jul 2009)
New Revision: 16469
Modified:
trunk/jbpm/features/org.jboss.tools.jbpm.common.feature/sourceTemplateFeature/feature.properties
trunk/jbpm/features/org.jboss.tools.jbpm.common.feature/sourceTemplatePlugin/plugin.properties
Log:
Modified: trunk/jbpm/features/org.jboss.tools.jbpm.common.feature/sourceTemplateFeature/feature.properties
===================================================================
--- trunk/jbpm/features/org.jboss.tools.jbpm.common.feature/sourceTemplateFeature/feature.properties 2009-07-07 17:26:40 UTC (rev 16468)
+++ trunk/jbpm/features/org.jboss.tools.jbpm.common.feature/sourceTemplateFeature/feature.properties 2009-07-07 17:29:03 UTC (rev 16469)
@@ -1,5 +1,5 @@
# properties file for org.jboss.tools.jmx.source
-featureName=jBPM Common Source
+featureName=Common tools for jBPM 3 and jBPM 4 Sources
featureProvider=JBoss by Red Hat
# "updateSiteName" property - label for the update site
Modified: trunk/jbpm/features/org.jboss.tools.jbpm.common.feature/sourceTemplatePlugin/plugin.properties
===================================================================
--- trunk/jbpm/features/org.jboss.tools.jbpm.common.feature/sourceTemplatePlugin/plugin.properties 2009-07-07 17:26:40 UTC (rev 16468)
+++ trunk/jbpm/features/org.jboss.tools.jbpm.common.feature/sourceTemplatePlugin/plugin.properties 2009-07-07 17:29:03 UTC (rev 16469)
@@ -1,3 +1,3 @@
-pluginName = jBPM Common Source
+pluginName = Common tools for jBPM 3 and jBPM 4 Sources
providerName = JBoss by Red Hat
16 years, 9 months
JBoss Tools SVN: r16468 - trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-07-07 13:26:40 -0400 (Tue, 07 Jul 2009)
New Revision: 16468
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage/plugin.properties
Log:
update plugin name
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage/plugin.properties
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage/plugin.properties 2009-07-07 17:25:59 UTC (rev 16467)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage/plugin.properties 2009-07-07 17:26:40 UTC (rev 16468)
@@ -1,2 +1,2 @@
-pluginName=Jpdl4 Multipage Editor Plug-in
+pluginName=Jpdl4 Multipage Editor
providerName=JBoss by Red Hat
\ No newline at end of file
16 years, 9 months
JBoss Tools SVN: r16467 - trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-07-07 13:25:59 -0400 (Tue, 07 Jul 2009)
New Revision: 16467
Modified:
trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/feature.properties
Log:
update feature name
Modified: trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/feature.properties
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/feature.properties 2009-07-07 17:23:49 UTC (rev 16466)
+++ trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/feature.properties 2009-07-07 17:25:59 UTC (rev 16467)
@@ -1,4 +1,4 @@
-featureName=jBPM 4 Tools
+featureName=jBPM 4 Graphical Editor and Tools
featureProvider=JBoss by Red Hat
description=This feature includes tools for jBPM 4.
copyright=Copyright 2009 Red Hat, Inc.
16 years, 9 months
JBoss Tools SVN: r16466 - trunk/flow/features/org.jboss.tools.flow.common.feature.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-07-07 13:23:49 -0400 (Tue, 07 Jul 2009)
New Revision: 16466
Modified:
trunk/flow/features/org.jboss.tools.flow.common.feature/feature.properties
Log:
update feature name
Modified: trunk/flow/features/org.jboss.tools.flow.common.feature/feature.properties
===================================================================
--- trunk/flow/features/org.jboss.tools.flow.common.feature/feature.properties 2009-07-07 17:22:45 UTC (rev 16465)
+++ trunk/flow/features/org.jboss.tools.flow.common.feature/feature.properties 2009-07-07 17:23:49 UTC (rev 16466)
@@ -1,4 +1,4 @@
-featureName=Common Tools for Flow Languages
+featureName=Flow Languages Common Tools
featureProvider=JBoss by Red Hat
description=This feature includes common tools for flow languages.
copyright=Copyright 2009 Red Hat, Inc.
16 years, 9 months
JBoss Tools SVN: r16465 - trunk/flow/plugins/org.jboss.tools.flow.common.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-07-07 13:22:45 -0400 (Tue, 07 Jul 2009)
New Revision: 16465
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/plugin.properties
Log:
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/plugin.properties
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/plugin.properties 2009-07-07 17:21:03 UTC (rev 16464)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/plugin.properties 2009-07-07 17:22:45 UTC (rev 16465)
@@ -1,3 +1,3 @@
#Properties file for org.jboss.tools.flow.common
Bundle-Vendor.0 = JBoss
-Bundle-Name.0 = JBoss Tools Process Plug-in
\ No newline at end of file
+Bundle-Name.0 = Flow Language Common Tools
\ No newline at end of file
16 years, 9 months
JBoss Tools SVN: r16464 - trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-07-07 13:21:03 -0400 (Tue, 07 Jul 2009)
New Revision: 16464
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.properties
Log:
update plugin name
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.properties
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.properties 2009-07-07 14:40:58 UTC (rev 16463)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.properties 2009-07-07 17:21:03 UTC (rev 16464)
@@ -1,3 +1,3 @@
#Properties file for org.jboss.tools.flow.jpdl4
Bundle-Vendor.0 = JBoss by Red Hat
-Bundle-Name.0 = Jpdl4 Plug-in
\ No newline at end of file
+Bundle-Name.0 = jPDL4 Graphical Editor
\ No newline at end of file
16 years, 9 months
JBoss Tools SVN: r16463 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-07-07 10:40:58 -0400 (Tue, 07 Jul 2009)
New Revision: 16463
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFLogTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfInputTextTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/InputNumberSliderTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSpinnerTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesLayoutPanelTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesLayoutTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPageTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPaint2DTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSpacerTemplate.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataTable&Spacer&DataScroller.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/JBIDE4309.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesInplaceInputTemplateTestCase.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3225, https://jira.jboss.org/jira/browse/JBIDE-3708, text processing in jsf templates was changed, util methods were added.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFLogTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFLogTemplate.java 2009-07-07 14:37:35 UTC (rev 16462)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFLogTemplate.java 2009-07-07 14:40:58 UTC (rev 16463)
@@ -22,6 +22,7 @@
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
@@ -100,32 +101,14 @@
clearButton.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TYPE_BUTTON);
divElement.appendChild(clearButton);
-
- // ================================================================================
- // Check if template component has children elements
- // ================================================================================
- List<Node> list = ComponentUtil.getChildren(sourceElement, true);
- VpeCreationData creationData = null;
- if (list != null && list.size() > 0) {
- nsIDOMElement rootDiv = visualDocument.createElement(HTML.TAG_DIV);
-
- // this element is used to contains template children
- nsIDOMElement childDiv = visualDocument.createElement(HTML.TAG_DIV);
-
- rootDiv.appendChild(childDiv);
- rootDiv.appendChild(divElement);
-
- // Create return variable contains template
- creationData = new VpeCreationData(rootDiv);
- VpeChildrenInfo divInfo = new VpeChildrenInfo(childDiv);
- creationData.addChildrenInfo(divInfo);
- for (Node child : list) {
- divInfo.addSourceChild(child);
- }
- } else {
- creationData = new VpeCreationData(divElement);
- }
-
+
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-3708
+ * Component should render its children.
+ */
+ VpeCreationData creationData = VisualDomUtil.createTemplateWithTextContainer(
+ sourceElement, divElement, HTML.TAG_DIV, visualDocument);
+
return creationData;
}
}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfInputTextTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfInputTextTemplate.java 2009-07-07 14:37:35 UTC (rev 16462)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfInputTextTemplate.java 2009-07-07 14:40:58 UTC (rev 16463)
@@ -18,6 +18,7 @@
import org.jboss.tools.vpe.editor.mapping.VpeElementData;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Attr;
@@ -33,7 +34,13 @@
nsIDOMElement input = visualDocument.createElement(HTML.TAG_INPUT);
- VpeCreationData creationData = new VpeCreationData(input);
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-3225
+ * Component should render its children.
+ */
+ VpeCreationData creationData = VisualDomUtil
+ .createTemplateWithTextContainer(sourceElement,
+ input, HTML.TAG_SPAN, visualDocument);
copyGeneralJsfAttributes(sourceElement, input);
ComponentUtil.copyDisabled(sourceElement, input);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/InputNumberSliderTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/InputNumberSliderTemplate.java 2009-07-07 14:37:35 UTC (rev 16462)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/InputNumberSliderTemplate.java 2009-07-07 14:40:58 UTC (rev 16463)
@@ -25,6 +25,7 @@
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMHTMLInputElement;
@@ -151,30 +152,12 @@
basicTable.appendChild(valuesBlock);
basicTable.appendChild(sliderBlock);
- // ================================================================================
- // Check if template component has children elements
- // ================================================================================
- List<Node> list = ComponentUtil.getChildren(sourceElement, true);
- VpeCreationData creationData = null;
- if (list != null && list.size() > 0) {
- nsIDOMElement rootDiv = visualDocument.createElement(HTML.TAG_DIV);
-
- // this element is used to contains template children
- nsIDOMElement childDiv = visualDocument.createElement(HTML.TAG_DIV);
-
- rootDiv.appendChild(childDiv);
- rootDiv.appendChild(basicTable);
-
- // Create return variable contains template
- creationData = new VpeCreationData(rootDiv);
- VpeChildrenInfo divInfo = new VpeChildrenInfo(childDiv);
- creationData.addChildrenInfo(divInfo);
- for (Node child : list) {
- divInfo.addSourceChild(child);
- }
- } else {
- creationData = new VpeCreationData(basicTable);
- }
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-3225
+ * Component should render its children.
+ */
+ VpeCreationData creationData = VisualDomUtil.createTemplateWithTextContainer(
+ sourceElement, basicTable, HTML.TAG_DIV, visualDocument);
creationData.setElementData(elementData);
return creationData;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java 2009-07-07 14:37:35 UTC (rev 16462)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java 2009-07-07 14:40:58 UTC (rev 16463)
@@ -81,6 +81,8 @@
/** The Constant SPACER_GIF. */
protected final String SPACER_GIF = getCssExtension() + "/spacer.gif"; //$NON-NLS-1$
+ protected final String DEFAULT_LABEL_VALUE = "\u00A0\u00A0\u00A0"; //$NON-NLS-1$
+
protected String sourceCancelButtonIcon;
protected String sourceApplyButtonIcon;
@@ -103,10 +105,7 @@
*/
protected nsIDOMElement createRootSpanTemplateMethod(Element source, nsIDOMDocument visualDocument, Attributes attrs) {
final nsIDOMElement rootSpan = visualDocument.createElement(HTML.TAG_SPAN);
- // if(!(this.showControls && this.isToggle)){
rootSpan.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String.valueOf(this.isToggle));
- // }
-// final String rootClass = MessageFormat.format(defaultStyleClasses.get("rootSpan"), getRootSpanClasses()); //$NON-NLS-1$
String rootStyleClass = "rich-inplace" + getCssStylesSuffix(); //$NON-NLS-1$
for (String sc : getRootSpanClasses(attrs)) {
if (ComponentUtil.isNotBlank(sc)) {
@@ -156,16 +155,18 @@
* @return the value
*/
protected String getValue(Attributes attrs) {
- String rst = Constants.EMPTY;
- if (ComponentUtil.isNotBlank(attrs.getDefaultLabel())) {
- rst = attrs.getDefaultLabel();
- } else if (ComponentUtil.isBlank(attrs.getDefaultLabel())
- && ComponentUtil.isNotBlank(attrs.getValue())) {
- rst = attrs.getValue();
- } else {
- rst = Constants.WHITE_SPACE;
- }
- return rst;
+ String rst = Constants.EMPTY;
+ if (ComponentUtil.isNotBlank(attrs.getDefaultLabel())) {
+ rst = attrs.getDefaultLabel();
+ } else if (ComponentUtil.isBlank(attrs.getDefaultLabel())
+ && ComponentUtil.isNotBlank(attrs.getValue())) {
+ rst = attrs.getValue();
+ } else if (isToggle) {
+ rst = Constants.WHITE_SPACE;
+ } else {
+ rst = DEFAULT_LABEL_VALUE;
+ }
+ return rst;
}
/**
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java 2009-07-07 14:37:35 UTC (rev 16462)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java 2009-07-07 14:40:58 UTC (rev 16463)
@@ -12,12 +12,15 @@
package org.jboss.tools.jsf.vpe.richfaces.template;
+import java.util.List;
+
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
@@ -55,50 +58,47 @@
* @return The information on the created node of the visual tree.
*/
public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
- VpeCreationData data = null;
- // <span id="j_id5" class="rich-inplace rich-inplace-view" style="">
- ComponentUtil.setCSSLink(pageContext, getCssStyle(), getCssExtension());
- // cast to Element
- Element sourceElement = (Element) sourceNode;
- final Attributes attrs = new Attributes(sourceElement);
- // prepare images
- prepareImages(sourceElement);
+ ComponentUtil.setCSSLink(pageContext, getCssStyle(), getCssExtension());
+ Element sourceElement = (Element) sourceNode;
+ final Attributes attrs = new Attributes(sourceElement);
+ /*
+ * Prepare data
+ */
+ prepareData(pageContext, sourceElement);
- final nsIDOMElement rootSpan = createRootSpanTemplateMethod(sourceElement, visualDocument, attrs);
- final nsIDOMElement innerInput1 = visualDocument.createElement(HTML.TAG_INPUT);
- data = new VpeCreationData(rootSpan, true);
+ final nsIDOMElement rootSpan = createRootSpanTemplateMethod(sourceElement, visualDocument, attrs);
+ final nsIDOMElement innerInput1 = visualDocument.createElement(HTML.TAG_INPUT);
+ VpeCreationData creationData = VisualDomUtil.createTemplateWithTextContainer(
+ sourceElement, rootSpan, HTML.TAG_SPAN, visualDocument);
+ if (isToggle) {
+ rootSpan.appendChild(innerInput1);
+ innerInput1.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
+ innerInput1.setAttribute(HTML.ATTR_CLASS, "rich-inplace-field"); //$NON-NLS-1$
+ innerInput1.setAttribute(HTML.ATTR_STYLE, "top: 0px; width: " + this.inputWidth + Constants.SEMICOLON); //$NON-NLS-1$
+ innerInput1.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TYPE_TEXT);
+ innerInput1.setAttribute("autocomplete", "off"); //$NON-NLS-1$ //$NON-NLS-2$
- if (isToggle) {
- rootSpan.appendChild(innerInput1);
- innerInput1.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
- innerInput1.setAttribute(HTML.ATTR_CLASS, "rich-inplace-field"); //$NON-NLS-1$
- innerInput1.setAttribute(HTML.ATTR_STYLE, "top: 0px; width: " + this.inputWidth + Constants.SEMICOLON); //$NON-NLS-1$
- innerInput1.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TYPE_TEXT);
- innerInput1.setAttribute("autocomplete", "off"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (attrs.isShowControls()) {
+ rootSpan.appendChild(createControlsDiv(pageContext, sourceNode,
+ visualDocument, creationData, attrs));
+ }
+ } else {
+ innerInput1.setAttribute(HTML.ATTR_STYLE,
+ "width: " + this.inputWidth + "; position: absolute; left: -32767px;"); //$NON-NLS-1$ //$NON-NLS-2$
+ innerInput1.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TYPE_BUTTON);
- if (attrs.isShowControls()) {
- rootSpan.appendChild(createControlsDiv(pageContext, sourceNode, visualDocument, data, attrs));
- }
- } else {
- innerInput1.setAttribute(HTML.ATTR_STYLE,
- "width: " + this.inputWidth + "; position: absolute; left: -32767px;"); //$NON-NLS-1$ //$NON-NLS-2$
- innerInput1.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TYPE_BUTTON);
-
- /*
- * Add empty children info to avoid children processing.
- * Only available child is "controls" facet
- */
- data.addChildrenInfo(new VpeChildrenInfo(rootSpan));
- }
- if (!isToggle) {
- rootSpan.appendChild(visualDocument.createTextNode(getValue(attrs)));
- } else {
- innerInput1.setAttribute(HTML.ATTR_VALUE, getValue(attrs));
- }
-// final DOMTreeDumper dumper = new DOMTreeDumper();
-// dumper.dumpToStream(System.err, rootSpan);
-
- return data;
+ /*
+ * Add empty children info to avoid children processing.
+ * Only available child is "controls" facet
+ */
+// creationData.addChildrenInfo(new VpeChildrenInfo(rootSpan));
+ }
+ if (!isToggle) {
+ rootSpan.appendChild(visualDocument.createTextNode(getValue(attrs)));
+ } else {
+ innerInput1.setAttribute(HTML.ATTR_VALUE, getValue(attrs));
+ }
+ return creationData;
}
/**
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java 2009-07-07 14:37:35 UTC (rev 16462)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java 2009-07-07 14:40:58 UTC (rev 16463)
@@ -18,6 +18,7 @@
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
@@ -29,17 +30,23 @@
* @author Eugene Stherbin
*/
public class RichFacesInplaceSelectTemplate extends RichFacesAbstractInplaceTemplate {
+
+ /*
+ * Default width and height of the drop down select list.
+ */
+ private static final String SOURCE_LIST_DEFAULT_HEIGHT = "24px"; //$NON-NLS-1$
+ private static final String SOURCE_LIST_DEFAULT_WIDTH = "198px"; //$NON-NLS-1$
- private static final String SOURCE_LIST_HEIGHT = "24px"; //$NON-NLS-1$
-
/** The Constant INPLACE_SELECT_CSS. */
private static final String INPLACE_SELECT_CSS = "inplaceSelect/inplaceSelect.css"; //$NON-NLS-1$
/** The Constant INPLACE_SELECT_EXT. */
private static final String INPLACE_SELECT_EXT = "inplaceSelect"; //$NON-NLS-1$
+ /*
+ * Width and height of the drop down select list.
+ */
protected String sourceListHeight;
-
protected String sourceListWidth;
/**
@@ -55,23 +62,19 @@
* @return The information on the created node of the visual tree.
*/
public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
- VpeCreationData data = null;
- // <span id="j_id5" class="rich-inplace rich-inplace-view" style="">
ComponentUtil.setCSSLink(pageContext, getCssStyle(), getCssExtension());
- // cast to Element
final Element sourceElement = (Element) sourceNode;
final Attributes attrs = new Attributes(sourceElement);
-
- // prepare images
- prepareImages(sourceElement);
-
+ /*
+ * Prepare data
+ */
+ prepareData(pageContext, sourceElement);
final nsIDOMElement rootSpan = createRootSpanTemplateMethod(sourceElement, visualDocument, attrs);
- data = new VpeCreationData(rootSpan, true);
-
+ VpeCreationData creationData = VisualDomUtil.createTemplateWithTextContainer(
+ sourceElement, rootSpan, HTML.TAG_SPAN, visualDocument);
if (isToggle) {
final nsIDOMElement innerInput1 = visualDocument.createElement(HTML.TAG_INPUT);
final nsIDOMElement innerInput2 = visualDocument.createElement(HTML.TAG_INPUT);
-
preapareInputBase(innerInput1);
preapareInputBase(innerInput2);
innerInput1.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
@@ -88,19 +91,19 @@
rootSpan.appendChild(innerInput1);
rootSpan.appendChild(innerInput2);
- if (ComponentUtil.getSelectItems(sourceElement.getChildNodes()).size() > 0) {
- final nsIDOMElement selectList = createSelectedList(sourceElement, visualDocument);
+ List<Element> elements = ComponentUtil.getSelectItems(sourceElement.getChildNodes());
+ if ((elements != null) && (elements.size() > 0)) {
+ final nsIDOMElement selectList = createSelectedList(elements, visualDocument);
rootSpan.appendChild(selectList);
}
if (attrs.isShowControls()) {
- rootSpan.appendChild(createControlsDiv(pageContext, sourceNode, visualDocument, data, attrs));
+ rootSpan.appendChild(createControlsDiv(pageContext, sourceNode,
+ visualDocument, creationData, attrs));
}
} else {
rootSpan.appendChild(visualDocument.createTextNode(getValue(attrs)));
}
-// DOMTreeDumper d = new DOMTreeDumper();
-// d.dumpToStream(System.err, rootSpan);
- return data;
+ return creationData;
}
/**
@@ -110,7 +113,7 @@
* @param source the source
* @return the ns IDOM element
*/
- private nsIDOMElement createSelectedList(Element source, nsIDOMDocument visualDocument) {
+ private nsIDOMElement createSelectedList(List<Element> elements, nsIDOMDocument visualDocument) {
// rich-inplace-select-width-list
final nsIDOMElement div = visualDocument.createElement(HTML.TAG_DIV);
@@ -155,20 +158,28 @@
listDecarationDiv.setAttribute(HTML.ATTR_CLASS, "rich-inplace-select-list-decoration"); //$NON-NLS-1$
final nsIDOMElement listScrollDiv = visualDocument.createElement(HTML.TAG_DIV);
- final List<Element> elements = ComponentUtil.getSelectItems(source.getChildNodes());
// added by estherbin
// fix http://jira.jboss.com/jira/browse/JBIDE-2196
// tramanovich comment.
- if (this.sourceListHeight == SOURCE_LIST_HEIGHT) {
+ if (this.sourceListHeight == SOURCE_LIST_DEFAULT_HEIGHT) {
int height = 24;
- if ((elements != null) && (elements.size() > 1)) {
+ if (elements.size() > 1) {
height += ((elements.size() - 2) * 24)+1;
}
- this.sourceListHeight = String.valueOf(height) + String.valueOf(Constants.PIXEL);
+ this.sourceListHeight = String.valueOf(height) + Constants.PIXEL;
}
-
+ String dropDownListSizesStyle = HTML.ATTR_HEIGHT + Constants.COLON
+ + this.sourceListHeight + Constants.SEMICOLON
+ + Constants.WHITE_SPACE + HTML.ATTR_WIDTH + Constants.COLON
+ +this.sourceListWidth + Constants.SEMICOLON;
+
+ System.out.println(" dropDownListSizesStyle = "
+ + dropDownListSizesStyle);
+
+ table.setAttribute(HTML.ATTR_STYLE, dropDownListSizesStyle);
listScrollDiv.setAttribute(HTML.ATTR_CLASS, "rich-inplace-select-list-scroll"); //$NON-NLS-1$
- listScrollDiv.setAttribute(HTML.ATTR_STYLE, "height:" + this.sourceListHeight + "; width: " + this.sourceListWidth); //$NON-NLS-1$ //$NON-NLS-2$
+ listScrollDiv.setAttribute(HTML.ATTR_STYLE, dropDownListSizesStyle);
+// listScrollDiv.setAttribute(HTML.ATTR_STYLE, "height:" + this.sourceListHeight + "; width: " + this.sourceListWidth); //$NON-NLS-1$ //$NON-NLS-2$
if (elements.size() > 0) {
for (Element e : elements) {
@@ -289,11 +300,11 @@
this.sourceListHeight = ComponentUtil.getAttribute(source, "listHeight"); //$NON-NLS-1$
this.sourceListWidth = ComponentUtil.getAttribute(source, "listWidth"); //$NON-NLS-1$
if (ComponentUtil.isBlank(this.sourceListHeight)) {
- this.sourceListHeight = SOURCE_LIST_HEIGHT;
+ this.sourceListHeight = SOURCE_LIST_DEFAULT_HEIGHT;
}
if (ComponentUtil.isBlank(this.sourceListWidth)) {
- this.sourceListWidth = String.valueOf("198px"); //$NON-NLS-1$
+ this.sourceListWidth = SOURCE_LIST_DEFAULT_WIDTH;
}
super.prepareImages(source);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSpinnerTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSpinnerTemplate.java 2009-07-07 14:37:35 UTC (rev 16462)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSpinnerTemplate.java 2009-07-07 14:40:58 UTC (rev 16463)
@@ -22,6 +22,7 @@
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
@@ -145,31 +146,13 @@
append(RICH_SPINNER_C_STYLE).append(Constants.WHITE_SPACE).append(tmp).toString();
table.setAttribute(HTML.ATTR_CLASS, tmp);
- // ================================================================================
- // Check if template component has children elements
- // ================================================================================
- List<Node> list = ComponentUtil.getChildren(sourceElement, true);
- VpeCreationData creationData = null;
- if (list != null && list.size() > 0) {
- nsIDOMElement rootDiv = visualDocument.createElement(HTML.TAG_DIV);
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-3225
+ * Component should render its children.
+ */
+ VpeCreationData creationData = VisualDomUtil.createTemplateWithTextContainer(
+ sourceElement, table, HTML.TAG_DIV, visualDocument);
- // this element is used to contains template children
- nsIDOMElement childDiv = visualDocument.createElement(HTML.TAG_DIV);
-
- rootDiv.appendChild(childDiv);
- rootDiv.appendChild(table);
-
- // Create return variable contains template
- creationData = new VpeCreationData(rootDiv);
- VpeChildrenInfo divInfo = new VpeChildrenInfo(childDiv);
- creationData.addChildrenInfo(divInfo);
- for (Node child : list) {
- divInfo.addSourceChild(child);
- }
- } else {
- creationData = new VpeCreationData(table);
- }
-
return creationData;
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesLayoutPanelTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesLayoutPanelTemplate.java 2009-07-07 14:37:35 UTC (rev 16462)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesLayoutPanelTemplate.java 2009-07-07 14:40:58 UTC (rev 16463)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 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
+ ******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesLayoutTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesLayoutTemplate.java 2009-07-07 14:37:35 UTC (rev 16462)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesLayoutTemplate.java 2009-07-07 14:40:58 UTC (rev 16463)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 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
+ ******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
import java.math.BigDecimal;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPageTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPageTemplate.java 2009-07-07 14:37:35 UTC (rev 16462)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPageTemplate.java 2009-07-07 14:40:58 UTC (rev 16463)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 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
+ ******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPaint2DTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPaint2DTemplate.java 2009-07-07 14:37:35 UTC (rev 16462)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPaint2DTemplate.java 2009-07-07 14:40:58 UTC (rev 16463)
@@ -20,6 +20,7 @@
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
@@ -89,31 +90,13 @@
String bgColor = ComponentUtil.getAttribute(sourceElement, HTML.ATTR_BGCOLOR, ATTR_TRANSPARENT_VALUE);
img.setAttribute(HTML.ATTR_BGCOLOR, bgColor);
- // ================================================================================
- // Check if template component has children elements
- // ================================================================================
- List<Node> list = ComponentUtil.getChildren(sourceElement, true);
- VpeCreationData creationData = null;
- if (list != null && list.size() > 0) {
- nsIDOMElement rootDiv = visualDocument.createElement(HTML.TAG_SPAN);
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-3225
+ * Component should render its children.
+ */
+ VpeCreationData creationData = VisualDomUtil.createTemplateWithTextContainer(
+ sourceElement, img, HTML.TAG_SPAN, visualDocument);
- // this element is used to contains template children
- nsIDOMElement childDiv = visualDocument.createElement(HTML.TAG_SPAN);
-
- rootDiv.appendChild(childDiv);
- rootDiv.appendChild(img);
-
- // Create return variable contains template
- creationData = new VpeCreationData(rootDiv);
- VpeChildrenInfo divInfo = new VpeChildrenInfo(childDiv);
- creationData.addChildrenInfo(divInfo);
- for (Node child : list) {
- divInfo.addSourceChild(child);
- }
- } else {
- creationData = new VpeCreationData(img);
- }
-
return creationData;
}
}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSpacerTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSpacerTemplate.java 2009-07-07 14:37:35 UTC (rev 16462)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSpacerTemplate.java 2009-07-07 14:40:58 UTC (rev 16463)
@@ -20,6 +20,7 @@
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
@@ -82,31 +83,13 @@
String height = ComponentUtil.getAttribute(sourceElement, HTML.ATTR_HEIGHT, DEFAULT_SIZE);
img.setAttribute(HTML.ATTR_HEIGHT, height);
- // ================================================================================
- // Check if template component has children elements
- // ================================================================================
- List<Node> list = ComponentUtil.getChildren(sourceElement, true);
- VpeCreationData creationData = null;
- if (list != null && list.size() > 0) {
- nsIDOMElement rootDiv = visualDocument.createElement(HTML.TAG_SPAN);
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-3225
+ * Component should render its children.
+ */
+ VpeCreationData creationData = VisualDomUtil.createTemplateWithTextContainer(
+ sourceElement, img, HTML.TAG_SPAN, visualDocument);
- // this element is used to contains template children
- nsIDOMElement childDiv = visualDocument.createElement(HTML.TAG_SPAN);
-
- rootDiv.appendChild(childDiv);
- rootDiv.appendChild(img);
-
- // Create return variable contains template
- creationData = new VpeCreationData(rootDiv);
- VpeChildrenInfo divInfo = new VpeChildrenInfo(childDiv);
- creationData.addChildrenInfo(divInfo);
- for (Node child : list) {
- divInfo.addSourceChild(child);
- }
- } else {
- creationData = new VpeCreationData(img);
- }
-
return creationData;
}
}
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataTable&Spacer&DataScroller.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataTable&Spacer&DataScroller.xhtml.xml 2009-07-07 14:37:35 UTC (rev 16462)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataTable&Spacer&DataScroller.xhtml.xml 2009-07-07 14:40:58 UTC (rev 16463)
@@ -1,40 +1,46 @@
<tests>
<test id="dataTable">
+
<DIV CLASS="dr-pnl rich-panel" STYLE="width: 780px; height: 702px;">
<DIV CLASS="dr-pnl-h rich-panel-header"
STYLE="/background-image: url\(.*resources/common/background.gif\);/">
<SPAN CLASS="vpe-text">
Data Table & Spacer & DataScroller
- </SPAN>
+</SPAN>
</DIV>
<DIV CLASS="dr-pnl-b rich-panel-body">
- <DIV ALIGN="right" CLASS="rich-datascr evenRow" STYLE="text-align: center; color: Orchid; font-style: italic; font-size: small; background-color: Turquoise; text-decoration: line-through; font-weight: bolder;">
-<TABLE CELLSPACING="1" CELLPADDING="0" BORDER="0" CLASS="rich-dtascroller-table">
-<TBODY>
-<TR>
-<TD ALIGN="center" CLASS="rich-datascr-button rich-datascr-button-dsbld">
-«
+ <DIV ALIGN="right" CLASS="rich-datascr evenRow"
+ STYLE="text-align: center; color: Orchid; font-style: italic; font-size: small; background-color: Turquoise; text-decoration: line-through; font-weight: bolder;">
+ <TABLE CELLSPACING="1" CELLPADDING="0" BORDER="0"
+ CLASS="rich-dtascroller-table">
+ <TBODY>
+ <TR>
+ <TD ALIGN="center" CLASS="rich-datascr-button rich-datascr-button-dsbld">
+ «
</TD>
-<TD ALIGN="center" CLASS="rich-datascr-button rich-datascr-button-dsbld">
+ <TD ALIGN="center" CLASS="rich-datascr-button rich-datascr-button-dsbld">
+ </TD>
+ <TD ALIGN="center" CLASS="rich-datascr-act"
+ STYLE="text-align: right; color: Navy; font-style: italic; background-color: PaleVioletRed; text-decoration: overline; font-weight: bolder;">
+ 1
</TD>
-<TD ALIGN="center" CLASS="rich-datascr-act" STYLE="text-align: right; color: Navy; font-style: italic; background-color: PaleVioletRed; text-decoration: overline; font-weight: bolder;">
-1
+ <TD ALIGN="center" CLASS="rich-datascr-inact"
+ STYLE="border-style: none; text-align: center; color: red; font-style: italic; background-color: green; text-decoration: overline; font-weight: bolder;">
+ 2
</TD>
-<TD ALIGN="center" CLASS="rich-datascr-inact" STYLE="border-style: none; text-align: center; color: red; font-style: italic; background-color: green; text-decoration: overline; font-weight: bolder;">
-2
+ <TD ALIGN="center" CLASS="rich-datascr-inact"
+ STYLE="border-style: none; text-align: center; color: red; font-style: italic; background-color: green; text-decoration: overline; font-weight: bolder;">
+ 3
</TD>
-<TD ALIGN="center" CLASS="rich-datascr-inact" STYLE="border-style: none; text-align: center; color: red; font-style: italic; background-color: green; text-decoration: overline; font-weight: bolder;">
-3
+ <TD ALIGN="center" CLASS="rich-datascr-button">
+ </TD>
+ <TD ALIGN="center" CLASS="rich-datascr-button">
+ »
</TD>
-<TD ALIGN="center" CLASS="rich-datascr-button">
-</TD>
-<TD ALIGN="center" CLASS="rich-datascr-button">
-»
-</TD>
-</TR>
-</TBODY>
-</TABLE>
-</DIV>
+ </TR>
+ </TBODY>
+ </TABLE>
+ </DIV>
<IMG WIDTH="700" HEIGHT="30"
SRC="/.*resources/spacer/spacer.gif/"
STYLE="background-color: red; width: 748px;" CLASS="rich-spacer btn" />
@@ -55,7 +61,7 @@
COLSPAN="100" SCOPE="colgroup">
<SPAN CLASS="vpe-text">
Header of the table
- </SPAN>
+</SPAN>
</TD>
</TR>
<TR CLASS="dr-table-subheader rich-table-subheader btn">
@@ -64,7 +70,7 @@
<SPAN>
<SPAN CLASS="vpe-text">
Description
- </SPAN>
+</SPAN>
</SPAN>
<IMG
SRC="/.*ve/unresolved_image.gif/"
@@ -76,7 +82,7 @@
<SPAN>
<SPAN CLASS="vpe-text">
Highest Bid
- </SPAN>
+</SPAN>
</SPAN>
</TD>
<TD CLASS="dr-table-subheadercell rich-table-subheadercell btn"
@@ -84,7 +90,7 @@
<SPAN>
<SPAN CLASS="vpe-text">
Your Bid
- </SPAN>
+</SPAN>
</SPAN>
</TD>
<TD CLASS="dr-table-subheadercell rich-table-subheadercell btn"
@@ -92,7 +98,7 @@
<SPAN>
<SPAN CLASS="vpe-text">
Amount
- </SPAN>
+</SPAN>
</SPAN>
</TD>
</TR>
@@ -104,7 +110,7 @@
COLSPAN="100" SCOPE="colgroup">
<SPAN CLASS="vpe-text">
Footer of the table
- </SPAN>
+</SPAN>
</TD>
</TR>
</TFOOT>
@@ -113,12 +119,12 @@
CLASS="dr-table-cell rich-table-cell col1">
<SPAN CLASS="vpe-text">
#{item.description}
- </SPAN>
+</SPAN>
</TD>
<TD CLASS="dr-table-cell rich-table-cell col2">
<SPAN>
#{item.highestBid}
- </SPAN>
+</SPAN>
</TD>
<TD CLASS="dr-table-cell rich-table-cell col3">
<SPAN>
@@ -129,15 +135,20 @@
</SPAN>
<BR STYLE="-moz-user-modify: read-write;" />
- <INPUT VALUE="#{item.bid}" />
- <A STYLE="-moz-user-modify: read-write;">
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text">
+ </SPAN>
+ <INPUT VALUE="#{item.bid}" />
+
+ </SPAN>
+ <A STYLE="-moz-user-modify: read-write;" CLASS="">
<SPAN CLASS="vpe-text">Place a bid!</SPAN>
</A>
</TD>
<TD CLASS="dr-table-cell rich-table-cell col4">
<SPAN>
#{item.amount}
- </SPAN>
+</SPAN>
</TD>
</TR>
</TABLE>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/JBIDE4309.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/JBIDE4309.xhtml.xml 2009-07-07 14:37:35 UTC (rev 16462)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/JBIDE4309.xhtml.xml 2009-07-07 14:40:58 UTC (rev 16463)
@@ -1,7 +1,12 @@
<tests>
<test id="inplaceSelect">
- <SPAN VPE-USER-TOGGLE-ID="false" CLASS="rich-inplace-select rich-inplace-select-view btn" STYLE="display: inline;">
- Click here to edit
- </SPAN>
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text">
+ </SPAN>
+ <SPAN VPE-USER-TOGGLE-ID="false"
+ CLASS="rich-inplace-select rich-inplace-select-view btn" STYLE="display: inline;">
+ Click here to edit
+ </SPAN>
+ </SPAN>
</test>
</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect.xhtml
===================================================================
(Binary files differ)
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect.xhtml.xml 2009-07-07 14:37:35 UTC (rev 16462)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect.xhtml.xml 2009-07-07 14:40:58 UTC (rev 16463)
@@ -1,6 +1,12 @@
<tests>
- <test id="inplaceSelect">
- <SPAN VPE-USER-TOGGLE-ID="false" CLASS="rich-inplace-select rich-inplace-select-view"
- STYLE="display: inline;"> Click here to edit</SPAN>
- </test>
+ <test id="inplaceSelect">
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text">
+ </SPAN>
+ <SPAN VPE-USER-TOGGLE-ID="false"
+ CLASS="rich-inplace-select rich-inplace-select-view" STYLE="display: inline;">
+ label
+ </SPAN>
+ </SPAN>
+ </test>
</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesInplaceInputTemplateTestCase.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesInplaceInputTemplateTestCase.java 2009-07-07 14:37:35 UTC (rev 16462)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesInplaceInputTemplateTestCase.java 2009-07-07 14:40:58 UTC (rev 16463)
@@ -39,9 +39,6 @@
/** The Constant MY_STYLE_CLASS. */
private static final String MY_STYLE_CLASS = "myStyleClass"; //$NON-NLS-1$
- /** The Constant NULL. */
- private static final String NULL = "null"; //$NON-NLS-1$
-
/** The Constant RICH_INPLACE_VIEW. */
private static final String RICH_INPLACE_VIEW = "rich-inplace rich-inplace-view"; //$NON-NLS-1$
@@ -53,6 +50,8 @@
/** The Constant TEMPLATE_WITH_VALUE_ATTR. */
private static final String TEMPLATE_WITH_VALUE_ATTR = "components/inplaceInput/inplaceInputWithValueAttribute.xhtml"; //$NON-NLS-1$
+
+ private static final String EMPTY_INPUT_STRING = "���"; //$NON-NLS-1$
/**
* The Constructor.
@@ -108,7 +107,7 @@
* @throws Throwable the throwable
*/
public void testInplaceInputWithoutAttributes() throws CoreException, Throwable {
- baseCheck(TEMPLATE_WITH_EMPTY_TAG, Constants.EMPTY, RICH_INPLACE_VIEW);
+ baseCheck(TEMPLATE_WITH_EMPTY_TAG, EMPTY_INPUT_STRING, RICH_INPLACE_VIEW);
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java 2009-07-07 14:37:35 UTC (rev 16462)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java 2009-07-07 14:40:58 UTC (rev 16463)
@@ -12,7 +12,10 @@
import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
+import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
@@ -46,25 +49,30 @@
public static String A4J_URI = "http://richfaces.org/a4j"; //$NON-NLS-1$
public static String FACELETS_URI = "http://java.sun.com/jsf/facelets"; //$NON-NLS-1$
- private static final String ACCESSIBILITY_SERVICE_CONTRACT_ID = "@mozilla.org/accessibilityService;1";
+ private static final String ACCESSIBILITY_SERVICE_CONTRACT_ID = "@mozilla.org/accessibilityService;1"; //$NON-NLS-1$
private static Reference<nsIAccessibilityService> accessibilityServiceCache = null;
+
+ private static Set<String> escapedTags;
+
+ static {
+ escapedTags = new HashSet<String>();
+ escapedTags.add("f:facet"); //$NON-NLS-1$
+ escapedTags.add("f:selectItem"); //$NON-NLS-1$
+ escapedTags.add("f:selectItems"); //$NON-NLS-1$
+ }
static public nsIDOMNode getAncestorNode(nsIDOMNode visualNode, String tagName){
if (tagName == null) return null;
nsIDOMNode element = visualNode;
-
while (true){
if (tagName.equalsIgnoreCase(element.getNodeName())) {
return element;
}
-
element = element.getParentNode();
-
if (element == null) {
break;
}
}
-
return null;
}
@@ -179,8 +187,6 @@
/**
* Copies all attributes from source node to visual node.
*
- * @param visualNode *
- * param sourceNode the source node
* @param sourceNode the source node
* @param visualElement the visual element
*/
@@ -205,12 +211,10 @@
}
/**
- * Copies attributes from source node to visual node.
+ * Copies all attributes from source node to visual node.
*
* @param sourceElement the source element
- * @param attributes - list names of attributes which will copy
- * @param visualNode *
- * param sourceNode * @param visualElement the visual element
+ * @param attributes list names of attributes which will copy
* @param visualElement the visual element
*/
public static void copyAttributes(Element sourceElement, List<String> attributes, nsIDOMElement visualElement) {
@@ -281,15 +285,31 @@
* <P>
* It can be used to wrap visual HTML elements and text nodes without
* changing of their view in VPE.
- *
+ * <P>
+ * Tag <code>span</code> is used as a default container.
+ *
* @param visualDocument the visual document. It is used to create the container.
- * @return created borderless container
- *
+ * @return created borderless container
* @author yradtsevich
+ * @see #createBorderlessContainer(nsIDOMDocument, String)
*/
public static nsIDOMElement createBorderlessContainer(
nsIDOMDocument visualDocument) {
- nsIDOMElement element = visualDocument.createElement(HTML.TAG_SPAN);
+ return createBorderlessContainer(visualDocument, HTML.TAG_SPAN);
+ }
+
+ /**
+ * Creates a HTML tag that is used as a borderless container
+ * for other elements.
+ *
+ * @param visualDocument the visual document.
+ * @param containerName the name of the tag, that will be used as a container.
+ *
+ * @return created borderless container
+ */
+ public static nsIDOMElement createBorderlessContainer(
+ nsIDOMDocument visualDocument, String containerName) {
+ nsIDOMElement element = visualDocument.createElement(containerName);
element.setAttribute(HTML.ATTR_CLASS, HTML.CLASS_VPE_TEXT);
return element;
}
@@ -317,4 +337,52 @@
creationData.addChildrenInfo(childrenInfo);
}
+
+ /**
+ * Creates visual tag with additional text container
+ *
+ * @param sourceElement
+ * the source element
+ * @param templateContainer
+ * visual tag that contains template element
+ * @param borderlessContainerName
+ * the name of the borderless container
+ * @param visualDocument
+ * the visual document
+ * @return created {@code VpeCreationData} based on specified container name
+ * or template container.
+ */
+ public static VpeCreationData createTemplateWithTextContainer(
+ Element sourceElement, nsIDOMElement templateContainer,
+ String borderlessContainerName, nsIDOMDocument visualDocument) {
+ List<Node> children = new ArrayList<Node>();
+ VpeCreationData creationData = null;
+ NodeList nodeList = sourceElement.getChildNodes();
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node child = nodeList.item(i);
+ /*
+ * Do not display escaped tags.
+ * These tags are correct and should be processed
+ * by templates themselves.
+ */
+ if (!escapedTags.contains(child.getNodeName()) ) {
+ children.add(child);
+ }
+ }
+ if (children != null && children.size() > 0) {
+ nsIDOMElement topContainer = createBorderlessContainer(visualDocument, borderlessContainerName);
+ nsIDOMElement textContainer = createBorderlessContainer(visualDocument, borderlessContainerName);
+ topContainer.appendChild(textContainer);
+ topContainer.appendChild(templateContainer);
+ creationData = new VpeCreationData(topContainer);
+ VpeChildrenInfo textInfo = new VpeChildrenInfo(textContainer);
+ creationData.addChildrenInfo(textInfo);
+ for (Node child : children) {
+ textInfo.addSourceChild(child);
+ }
+ } else {
+ creationData = new VpeCreationData(templateContainer);
+ }
+ return creationData;
+ }
}
16 years, 9 months
JBoss Tools SVN: r16462 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor: template and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-07-07 10:37:35 -0400 (Tue, 07 Jul 2009)
New Revision: 16462
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeLoadBundleCreator.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4552, fixed, VpeLoadBundleCreator.removeElement(..) was changed.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java 2009-07-07 11:56:15 UTC (rev 16461)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java 2009-07-07 14:37:35 UTC (rev 16462)
@@ -95,7 +95,7 @@
}
}
- public void clearAll(){
+ public void clearAll() {
bundles = new BundleEntry[0];
usedKeys = new HashMap<String,UsedKey>();
}
@@ -230,7 +230,9 @@
}
private void removeBundle(int hashCode, boolean refresh) {
- if (bundles.length == 0) return;
+ if (bundles.length == 0) {
+ return;
+ }
int index = -1;
for (int i = 0; i < bundles.length; i++) {
if (hashCode == bundles[i].hashCode){
@@ -238,7 +240,9 @@
break;
}
}
- if (index == -1) return;
+ if (index == -1) {
+ return;
+ }
if (bundles.length == 1) {
bundles = new BundleEntry[0];
return;
@@ -247,7 +251,9 @@
System.arraycopy(bundles, 0, newBundles, 0, index);
System.arraycopy(bundles, index + 1, newBundles, index, bundles.length - index - 1);
bundles = newBundles;
- if(refresh)refreshUsedKeys();
+ if (refresh) {
+ refreshUsedKeys();
+ }
}
public void removeBundle(int hashCode) {
@@ -257,13 +263,15 @@
private void addBundle(int hashCode, String prefix, String uri,boolean refresh) {
ResourceBundle bundle = getBundleByUrl(uri);
BundleEntry entry = new BundleEntry(bundle, uri, prefix, hashCode);
- if(bundle!=null) {
+ if (bundle != null) {
BundleEntry[] newBundles = new BundleEntry[bundles.length + 1];
System.arraycopy(bundles, 0, newBundles, 0, bundles.length);
bundles = newBundles;
bundles[bundles.length - 1] = entry;
}
- if(refresh)refreshUsedKeys();
+ if (refresh) {
+ refreshUsedKeys();
+ }
}
public void changeBundle(int hashCode, String prefix, String uri){
@@ -277,10 +285,12 @@
}
private BundleEntry getBundle(String prefix) {
- if(prefix == null) return null;
+ if (prefix == null) {
+ return null;
+ }
BundleEntry lastBundle = null;
for (int i = 0; i < bundles.length; i++) {
- if (prefix.equals(bundles[i].prefix)){
+ if (prefix.equals(bundles[i].prefix)) {
lastBundle = bundles[i];
}
}
@@ -398,19 +408,22 @@
}
private String getBundleValue(String prefix, String propertyName) {
+ String bundleValue = null;
BundleEntry entry = getBundle(prefix);
- if(entry != null) {
+ if (entry != null) {
String name = prefix + "." + propertyName;
- try{
- String value = (String)entry.bundle.getObject(propertyName);
- if(!usedKeys.containsKey(name))
- usedKeys.put(name, new UsedKey(entry.uri, prefix, propertyName, value, entry.hashCode));
- return value;
- }catch(MissingResourceException ex){
- return null;
+ try {
+ bundleValue = (String) entry.bundle.getObject(propertyName);
+ if (!usedKeys.containsKey(name))
+ usedKeys.put(name, new UsedKey(entry.uri, prefix,
+ propertyName, bundleValue, entry.hashCode));
+ } catch (MissingResourceException ex) {
+ /*
+ * Null string will be returned.
+ */
}
- }
- return null;
+ }
+ return bundleValue;
}
public void addBundleMapListener(BundleMapListener listener) {
@@ -448,33 +461,36 @@
}
}
-static class Expression{
+
+ static class Expression {
public String prefix;
public String propertyName;
}
-
-static class BundleEntry{
+
+ static class BundleEntry {
public ResourceBundle bundle;
public String uri;
public String prefix;
public int hashCode;
-
- public BundleEntry(ResourceBundle bundle, String uri, String prefix, int hashCode){
+
+ public BundleEntry(ResourceBundle bundle, String uri, String prefix,
+ int hashCode) {
this.bundle = bundle;
this.uri = uri;
this.prefix = prefix;
this.hashCode = hashCode;
- }
+ }
}
-
-static class UsedKey{
+
+ static class UsedKey {
public int hashCode;
public String uri;
public String prefix;
public String key;
public String value;
-
- public UsedKey(String uri, String prefix, String key, String value, int hashCode){
+
+ public UsedKey(String uri, String prefix, String key, String value,
+ int hashCode) {
this.uri = uri;
this.prefix = prefix;
this.key = key;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeLoadBundleCreator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeLoadBundleCreator.java 2009-07-07 11:56:15 UTC (rev 16461)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeLoadBundleCreator.java 2009-07-07 14:37:35 UTC (rev 16462)
@@ -24,8 +24,8 @@
import org.mozilla.interfaces.nsIDOMElement;
public class VpeLoadBundleCreator extends VpeAbstractCreator {
- private static final String ATTR_BASENAME = "basename";
- private static final String ATTR_VAR = "var";
+ private static final String ATTR_BASENAME = "basename"; //$NON-NLS-1$
+ private static final String ATTR_VAR = "var"; //$NON-NLS-1$
VpeLoadBundleCreator(Element bundleElement, VpeDependencyMap dependencyMap) {
build(bundleElement, dependencyMap);
@@ -40,10 +40,18 @@
setBundle(pageContext, (Element)sourceNode);
return null;
}
-
+
+
public void removeElement(VpePageContext pageContext, Element sourceElement, Map visualNodeMap) {
- BundleMap bundle = pageContext.getBundle();
- bundle.removeBundle(sourceElement.hashCode());
+ /*
+ * Was commented to fix https://jira.jboss.org/jira/browse/JBIDE-4552
+ * Because after text formatting on Ctrl+Shift+F bundle gets unnecessary deleted
+ * from bundle map, that caused message displaying error.
+ * All necessary bundle refreshing job is done by VpeController,
+ * and there is no need to perform any additional work on removing a bundle.
+ */
+// BundleMap bundle = pageContext.getBundle();
+// bundle.removeBundle(sourceElement.hashCode());
}
public void setAttribute(VpePageContext pageContext, Element sourceElement, Map visualNodeMap, String name, String value) {
16 years, 9 months