JBoss Tools SVN: r11772 - in trunk/jsf: tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2008-11-13 13:54:45 -0500 (Thu, 13 Nov 2008)
New Revision: 11772
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/commandButton.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/outputPanel.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/toolBar.xhtml.xml
Log:
RESOLVED - JDIDE-3012
https://jira.jboss.org/jira/browse/JBIDE-3012
- also fixed in a4j:commandButton
- tests have been rewritten
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml 2008-11-13 18:44:32 UTC (rev 11771)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml 2008-11-13 18:54:45 UTC (rev 11772)
@@ -73,51 +73,107 @@
</vpe:tag>
<vpe:tag name="a4j:commandButton" case-sensitive="yes">
- <vpe:if test="not(attrpresent('image'))">
- <vpe:if test="(@type='')">
+ <!-- This is a very big if-statement.
+ Its goal is to add support of 'disabled property'
+ DO NOT FORGET TO EDIT 'ELSE' PART IN FUTURE MODIFICATIONS -->
+ <vpe:if test="(@disabled='true')">
+ <vpe:if test="not(attrpresent('image'))">
+ <vpe:if test="(@type='')">
+ <vpe:template children="no" modify="no">
+ <input type="button" value="{jsfvalue(@value)}"
+ class="{@styleClass}" style="{@style}"
+ title="{tagstring()}" dir="{@dir}"
+ disabled="disabled"/>
+ <vpe:resize>
+ <vpe:width width-attr="style.width" />
+ <vpe:height height-attr="style.height" />
+ </vpe:resize>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes"/>
+ </vpe:dnd>
+ <vpe:textFormatting use-default-formats="yes">
+ </vpe:textFormatting>
+ </vpe:template>
+ </vpe:if>
+ <vpe:if test="not(@type='')">
+ <vpe:template children="no" modify="no">
+ <input type="{@type}" value="{jsfvalue(@value)}"
+ class="{@styleClass}" style="{@style}"
+ title="{tagstring()}" dir="{@dir}"
+ disabled="disabled"/>
+ <vpe:resize>
+ <vpe:width width-attr="style.width" />
+ <vpe:height height-attr="style.height" />
+ </vpe:resize>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes"/>
+ </vpe:dnd>
+ <vpe:textFormatting use-default-formats="yes">
+ </vpe:textFormatting>
+ </vpe:template>
+ </vpe:if>
+ </vpe:if>
+ <vpe:if test="attrpresent('image')">
<vpe:template children="no" modify="no">
- <input type="button" value="{jsfvalue(@value)}"
- class="{@styleClass}" style="{@style}"
- title="{tagstring()}" dir="{@dir}"/>
+ <input type="image" src="{src(@image)}"
+ class="{@styleClass}" style="{@style}" title="{tagstring()}"
+ disabled="disabled"/>
<vpe:resize>
<vpe:width width-attr="style.width" />
<vpe:height height-attr="style.height" />
</vpe:resize>
- <vpe:dnd>
- <vpe:drag start-enable="yes"/>
- </vpe:dnd>
<vpe:textFormatting use-default-formats="yes">
</vpe:textFormatting>
</vpe:template>
</vpe:if>
- <vpe:if test="not(@type='')">
+ </vpe:if>
+ <!--else-->
+ <vpe:if test="not(attrpresent('image'))">
+ <vpe:if test="(@type='')">
+ <vpe:template children="no" modify="no">
+ <input type="button" value="{jsfvalue(@value)}"
+ class="{@styleClass}" style="{@style}"
+ title="{tagstring()}" dir="{@dir}"/>
+ <vpe:resize>
+ <vpe:width width-attr="style.width" />
+ <vpe:height height-attr="style.height" />
+ </vpe:resize>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes"/>
+ </vpe:dnd>
+ <vpe:textFormatting use-default-formats="yes">
+ </vpe:textFormatting>
+ </vpe:template>
+ </vpe:if>
+ <vpe:if test="not(@type='')">
+ <vpe:template children="no" modify="no">
+ <input type="{@type}" value="{jsfvalue(@value)}"
+ class="{@styleClass}" style="{@style}"
+ title="{tagstring()}" dir="{@dir}"/>
+ <vpe:resize>
+ <vpe:width width-attr="style.width" />
+ <vpe:height height-attr="style.height" />
+ </vpe:resize>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes"/>
+ </vpe:dnd>
+ <vpe:textFormatting use-default-formats="yes">
+ </vpe:textFormatting>
+ </vpe:template>
+ </vpe:if>
+ </vpe:if>
+ <vpe:if test="attrpresent('image')">
<vpe:template children="no" modify="no">
- <input type="{@type}" value="{jsfvalue(@value)}"
- class="{@styleClass}" style="{@style}"
- title="{tagstring()}" dir="{@dir}"/>
+ <input type="image" src="{src(@image)}" class="{@styleClass}" style="{@style}" title="{tagstring()}"/>
<vpe:resize>
<vpe:width width-attr="style.width" />
<vpe:height height-attr="style.height" />
</vpe:resize>
- <vpe:dnd>
- <vpe:drag start-enable="yes"/>
- </vpe:dnd>
<vpe:textFormatting use-default-formats="yes">
</vpe:textFormatting>
</vpe:template>
</vpe:if>
- </vpe:if>
- <vpe:if test="attrpresent('image')">
- <vpe:template children="no" modify="no">
- <input type="image" src="{src(@image)}" class="{@styleClass}" style="{@style}" title="{tagstring()}"/>
- <vpe:resize>
- <vpe:width width-attr="style.width" />
- <vpe:height height-attr="style.height" />
- </vpe:resize>
- <vpe:textFormatting use-default-formats="yes">
- </vpe:textFormatting>
- </vpe:template>
- </vpe:if>
+ <!--end-of-else-->
</vpe:tag>
<vpe:tag name="a4j:outputPanel" case-sensitive="yes">
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/commandButton.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/commandButton.xhtml.xml 2008-11-13 18:44:32 UTC (rev 11771)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/commandButton.xhtml.xml 2008-11-13 18:54:45 UTC (rev 11772)
@@ -1,6 +1,5 @@
<tests>
<test id="commandButton">
- <INPUT TYPE="button" VALUE="commandButton" STYLE="-moz-user-modify: read-only;"
- READONLY="" />
+ <INPUT TYPE="button" VALUE="commandButton" STYLE="-moz-user-modify: read-only;" />
</test>
</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/outputPanel.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/outputPanel.xhtml.xml 2008-11-13 18:44:32 UTC (rev 11771)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/resources/ajax4jsfTests/WebContent/pages/components/outputPanel.xhtml.xml 2008-11-13 18:54:45 UTC (rev 11772)
@@ -7,7 +7,7 @@
<TD>
<DIV>
<SPAN> Some text </SPAN>
- <INPUT VALUE="#{rsBean.text1}" READONLY=""/>
+ <INPUT VALUE="#{rsBean.text1}"/>
</DIV>
</TD>
</TR>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/toolBar.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/toolBar.xhtml.xml 2008-11-13 18:44:32 UTC (rev 11771)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/toolBar.xhtml.xml 2008-11-13 18:54:45 UTC (rev 11772)
@@ -65,11 +65,11 @@
<TBODY>
<TR VALIGN="middle">
<TD CLASS="dr-toolbar-int rich-toolbar-item" STYLE="">
- <INPUT CLASS="barsearch" READONLY=""/>
+ <INPUT CLASS="barsearch"/>
</TD>
<TD CLASS="dr-toolbar-int rich-toolbar-item" STYLE="">
<INPUT TYPE="button" CLASS="barsearchbutton" VALUE="Search"
- STYLE="-moz-user-modify: read-only;" READONLY=""/>
+ STYLE="-moz-user-modify: read-only;"/>
</TD>
</TR>
</TBODY>
17 years, 5 months
JBoss Tools SVN: r11771 - in trunk: vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-11-13 13:44:32 -0500 (Thu, 13 Nov 2008)
New Revision: 11771
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractOutputJsfTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/template/HtmlTextTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
JBIDE-3163
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractOutputJsfTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractOutputJsfTemplate.java 2008-11-13 18:37:20 UTC (rev 11770)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractOutputJsfTemplate.java 2008-11-13 18:44:32 UTC (rev 11771)
@@ -42,6 +42,7 @@
* @param element
* @return
*/
+ @Override
public Attr getOutputAttributeNode(Element element) {
if (element.hasAttribute(JSF.ATTR_VALUE))
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-11-13 18:37:20 UTC (rev 11770)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-11-13 18:44:32 UTC (rev 11771)
@@ -524,15 +524,18 @@
&& (data.getNodesData() != null)
&& (data.getNodesData().size() > 0)) {
- Element sourceElement = (Element) sourceNode;
-
for (org.jboss.tools.vpe.editor.mapping.NodeData nodeData : data
.getNodesData()) {
if (nodeData.getSourceNode() != null) {
-
- Attr attr = sourceElement.getAttributeNode(nodeData
+ Node attr = null;
+ if(sourceNode.getAttributes()!=null) {
+ attr = sourceNode.getAttributes().getNamedItem(nodeData
.getSourceNode().getNodeName());
+ } else {
+ //Text node haven't child nodes, but it's node.
+ attr = sourceNode;
+ }
nodeData.setSourceNode(attr);
nodeData.setEditable(false);
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/template/HtmlTextTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/template/HtmlTextTemplate.java 2008-11-13 18:37:20 UTC (rev 11770)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/template/HtmlTextTemplate.java 2008-11-13 18:44:32 UTC (rev 11771)
@@ -13,9 +13,7 @@
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.NodeData;
-import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
import org.jboss.tools.vpe.editor.mapping.VpeElementData;
-import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.HTML;
@@ -48,30 +46,12 @@
//TODO Max Areshkau think may be we shouldn't use span
nsIDOMElement element = visualDocument.createElement(HTML.TAG_SPAN);
element.appendChild(visualNewTextNode);
-
- return new VpeCreationData(element);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.tools.vpe.editor.template.VpeAbstractTemplate#getNodeData(org.mozilla.interfaces.nsIDOMNode, org.jboss.tools.vpe.editor.mapping.VpeElementData, org.jboss.tools.vpe.editor.mapping.VpeDomMapping)
- */
- @Override
- public NodeData getNodeData(nsIDOMNode node, VpeElementData elementData,
- VpeDomMapping domMapping) {
-
- NodeData result;
- VpeNodeMapping nodeMapping = domMapping.getNearNodeMapping(node);
-
- nsIDOMNode textNode;
- if(node.getNodeType()==nsIDOMNode.ELEMENT_NODE) {
- textNode = node.getFirstChild();
- } else {
- textNode = node;
- }
-
- result = new NodeData(nodeMapping.getSourceNode(),textNode,true);
- return result;
- }
-
-
+
+ VpeElementData textElementData = new VpeElementData();
+ NodeData nodeData = new NodeData(sourceNode, visualNewTextNode);
+ textElementData.addNodeData(nodeData);
+ VpeCreationData result = new VpeCreationData(element);
+ result.setElementData(textElementData);
+ return result;
+ }
}
17 years, 5 months
JBoss Tools SVN: r11769 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2008-11-13 12:42:56 -0500 (Thu, 13 Nov 2008)
New Revision: 11769
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractEditableJsfTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractOutputJsfTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfInputTextAreaTemplate.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.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/ComponentUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
RESOLVED - JBIDE-3012
https://jira.jboss.org/jira/browse/JBIDE-3012
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractEditableJsfTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractEditableJsfTemplate.java 2008-11-13 17:24:38 UTC (rev 11768)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractEditableJsfTemplate.java 2008-11-13 17:42:56 UTC (rev 11769)
@@ -44,8 +44,11 @@
}
// general jsf attributes
- /** The attributes. */
- static private Map<String, String> attributes = new HashMap<String, String>();
+ /**
+ * Contains JSF attributes and appropriate HTML attributes
+ * content of that does not have to be modified in templates.
+ */
+ static final private Map<String, String> attributes = new HashMap<String, String>();
static {
attributes.put("style", HTML.ATTR_STYLE); //$NON-NLS-1$
@@ -53,20 +56,21 @@
}
/**
- * copy general.
+ * Renames and copies most general JSF attributes from the
+ * {@code sourceElement} to the {@code visualElement}.
*
* @param sourceElement the source element
* @param visualElement the visual element
+ * @see AbstractEditableJsfTemplate#attributes attributes
*/
- protected void copyGeneralJsfAttributes(nsIDOMElement visualElement,
- Element sourceElement) {
-
- Set<String> jsfAttributes = attributes.keySet();
-
- for (String key : jsfAttributes) {
-
- copyAttribute(visualElement, sourceElement, key, attributes
- .get(key));
+ protected void copyGeneralJsfAttributes(Element sourceElement,
+ nsIDOMElement visualElement) {
+
+ Set<Map.Entry<String, String>> jsfAttrEntries = attributes.entrySet();
+
+ for (Map.Entry<String, String> attrEntry : jsfAttrEntries) {
+ copyAttribute(visualElement, sourceElement, attrEntry.getKey(),
+ attrEntry.getValue());
}
}
@@ -88,7 +92,4 @@
.getAttribute(sourceAttributeName));
}
-
-
-
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractOutputJsfTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractOutputJsfTemplate.java 2008-11-13 17:24:38 UTC (rev 11768)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractOutputJsfTemplate.java 2008-11-13 17:42:56 UTC (rev 11769)
@@ -61,7 +61,7 @@
*/
protected void copyOutputJsfAttributes(nsIDOMElement visualElement,
Element sourceElement) {
- copyGeneralJsfAttributes(visualElement, sourceElement);
+ copyGeneralJsfAttributes(sourceElement, visualElement);
copyAttribute(visualElement, sourceElement, JSF.ATTR_DIR, HTML.ATTR_DIR);
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfInputTextAreaTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfInputTextAreaTemplate.java 2008-11-13 17:24:38 UTC (rev 11768)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfInputTextAreaTemplate.java 2008-11-13 17:42:56 UTC (rev 11769)
@@ -11,6 +11,7 @@
package org.jboss.tools.jsf.vpe.jsf.template;
+import org.jboss.tools.jsf.vpe.jsf.template.util.ComponentUtil;
import org.jboss.tools.jsf.vpe.jsf.template.util.JSF;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.AttributeData;
@@ -34,13 +35,16 @@
nsIDOMElement textArea = visualDocument
.createElement(HTML.TAG_TEXTAREA);
- ((nsIDOMHTMLTextAreaElement) textArea
- .queryInterface(nsIDOMHTMLTextAreaElement.NS_IDOMHTMLTEXTAREAELEMENT_IID))
- .setReadOnly(true);
+
+// Commented as fix for JBIDE-3012.
+// ((nsIDOMHTMLTextAreaElement) textArea
+// .queryInterface(nsIDOMHTMLTextAreaElement.NS_IDOMHTMLTEXTAREAELEMENT_IID))
+// .setReadOnly(true);
VpeCreationData creationData = new VpeCreationData(textArea);
- copyGeneralJsfAttributes(textArea, sourceElement);
+ copyGeneralJsfAttributes(sourceElement, textArea);
+ ComponentUtil.copyDisabled(sourceElement, textArea);
copyAttribute(textArea, sourceElement, JSF.ATTR_DIR, HTML.ATTR_DIR);
copyAttribute(textArea, sourceElement, JSF.ATTR_ROWS, HTML.ATTR_ROWS);
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 2008-11-13 17:24:38 UTC (rev 11768)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfInputTextTemplate.java 2008-11-13 17:42:56 UTC (rev 11769)
@@ -11,6 +11,7 @@
package org.jboss.tools.jsf.vpe.jsf.template;
+import org.jboss.tools.jsf.vpe.jsf.template.util.ComponentUtil;
import org.jboss.tools.jsf.vpe.jsf.template.util.JSF;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.AttributeData;
@@ -34,7 +35,8 @@
VpeCreationData creationData = new VpeCreationData(input);
- copyGeneralJsfAttributes(input, sourceElement);
+ copyGeneralJsfAttributes(sourceElement, input);
+ ComponentUtil.copyDisabled(sourceElement, input);
copyAttribute(input, sourceElement, JSF.ATTR_VALUE, HTML.ATTR_VALUE);
copyAttribute(input, sourceElement, JSF.ATTR_SIZE, HTML.ATTR_SIZE);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/ComponentUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/ComponentUtil.java 2008-11-13 17:24:38 UTC (rev 11768)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/ComponentUtil.java 2008-11-13 17:42:56 UTC (rev 11769)
@@ -18,6 +18,7 @@
import org.jboss.tools.jsf.vpe.jsf.JsfTemplatePlugin;
import org.jboss.tools.vpe.editor.bundle.BundleMap;
import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
@@ -61,26 +62,56 @@
}
return attribute;
}
+
+ /**
+ * Returns {@code true} if the {@code element} has attribute
+ * {@code disabled} and its value is {@link #string2boolean(String) true}
+ */
+ public static boolean isDisabled(Element element) {
+ return ComponentUtil.string2boolean(
+ ComponentUtil.getAttribute(element, JSF.ATTR_DISABLED));
+ }
+
+ /**
+ * Sets attribute {@code "disabled"} of the {@code element} to {@code "disabled"}
+ * if the parameter {@code disabled} is {@code true},
+ * <br/>
+ * otherwise removes attribute {@code "disabled"} from the {@code element}
+ * if it is present.
+ */
+ public static void setDisabled(nsIDOMElement element, boolean disabled) {
+ if (disabled) {
+ element.setAttribute(HTML.ATTR_DISABLED, HTML.ATTR_DISABLED);
+ } else {
+ element.removeAttribute(HTML.ATTR_DISABLED);
+ }
+ }
+
+ /**
+ * Copies {@code "disabled"} attribute from JSF {@code sourceElement} to
+ * HTML {@code targetElement}.
+ *
+ * @see #isDisabled(Element)
+ * @see #setDisabled(nsIDOMElement, boolean)
+ */
+ public static void copyDisabled(Element sourceElement, nsIDOMElement targetElement) {
+ boolean disabled = ComponentUtil.isDisabled(sourceElement);
+ ComponentUtil.setDisabled(targetElement, disabled);
+ }
/**
* 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.
+ * <code>true</code> is returned only if it specified explicitly,
+ * otherwise <code>false</code> is returned.
*
* @param str
* the string to parse
* @return boolean value from string
*/
public static boolean string2boolean(String str) {
- if ((str == null) || ("".equals(str))) {
- return false;
- } else if (("true".equalsIgnoreCase(str))
- || ("false".equalsIgnoreCase(str))) {
- return new Boolean(str).booleanValue();
- }
- return false;
+ return Boolean.parseBoolean(str);
}
/**
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-11-13 17:24:38 UTC (rev 11768)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-11-13 17:42:56 UTC (rev 11769)
@@ -180,52 +180,108 @@
<!-- Проблема с адресацией от приложения (30 of 4) -->
<vpe:tag name="h:commandButton" case-sensitive="yes">
- <vpe:if test="not(attrpresent('image'))">
- <vpe:if test="(@type='')">
+ <!-- This is a very big if-statement.
+ Its goal is to add support of 'disabled property'
+ DO NOT FORGET TO EDIT 'ELSE' PART IN FUTURE MODIFICATIONS -->
+ <vpe:if test="(@disabled='true')">
+ <vpe:if test="not(attrpresent('image'))">
+ <vpe:if test="(@type='')">
+ <vpe:template children="no" modify="no">z
+ <input type="button" value="{iif(@value='',' ',jsfvalue(@value))}"
+ class="{@styleClass}" style="{@style}"
+ title="{tagstring()}" dir="{@dir}"
+ disabled='disabled'/>
+ <vpe:resize>
+ <vpe:width width-attr="style.width" />
+ <vpe:height height-attr="style.height" />
+ </vpe:resize>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ </vpe:dnd>
+ <vpe:textFormatting use-default-formats="yes">
+ </vpe:textFormatting>
+ </vpe:template>
+ </vpe:if>
+ <vpe:if test="not(@type='')">
+ <vpe:template children="no" modify="no">
+ <input type="{@type}" value="{iif(@value='',' ',jsfvalue(@value))}"
+ class="{@styleClass}" style="{@style}"
+ title="{tagstring()}" dir="{@dir}"
+ disabled='disabled'/>
+ <vpe:resize>
+ <vpe:width width-attr="style.width" />
+ <vpe:height height-attr="style.height" />
+ </vpe:resize>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ </vpe:dnd>
+ <vpe:textFormatting use-default-formats="yes">
+ </vpe:textFormatting>
+ </vpe:template>
+ </vpe:if>
+ </vpe:if>
+ <vpe:if test="attrpresent('image')">
<vpe:template children="no" modify="no">
- <input type="button" value="{iif(@value='',' ',jsfvalue(@value))}"
- class="{@styleClass}" style="{@style}"
- title="{tagstring()}" dir="{@dir}"/>
+ <input type="image" src="{src(@image)}"
+ class="{@styleClass}" style="{@style}" title="{tagstring()}"
+ disabled='disabled'/>
<vpe:resize>
<vpe:width width-attr="style.width" />
<vpe:height height-attr="style.height" />
</vpe:resize>
- <vpe:dnd>
- <vpe:drag start-enable="yes" />
- </vpe:dnd>
<vpe:textFormatting use-default-formats="yes">
</vpe:textFormatting>
</vpe:template>
</vpe:if>
- <vpe:if test="not(@type='')">
+ </vpe:if>
+ <!--else-->
+ <vpe:if test="not(attrpresent('image'))">
+ <vpe:if test="(@type='')">
+ <vpe:template children="no" modify="no">z
+ <input type="button" value="{iif(@value='',' ',jsfvalue(@value))}"
+ class="{@styleClass}" style="{@style}"
+ title="{tagstring()}" dir="{@dir}"/>
+ <vpe:resize>
+ <vpe:width width-attr="style.width" />
+ <vpe:height height-attr="style.height" />
+ </vpe:resize>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ </vpe:dnd>
+ <vpe:textFormatting use-default-formats="yes">
+ </vpe:textFormatting>
+ </vpe:template>
+ </vpe:if>
+ <vpe:if test="not(@type='')">
+ <vpe:template children="no" modify="no">
+ <input type="{@type}" value="{iif(@value='',' ',jsfvalue(@value))}"
+ class="{@styleClass}" style="{@style}"
+ title="{tagstring()}" dir="{@dir}"/>
+ <vpe:resize>
+ <vpe:width width-attr="style.width" />
+ <vpe:height height-attr="style.height" />
+ </vpe:resize>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ </vpe:dnd>
+ <vpe:textFormatting use-default-formats="yes">
+ </vpe:textFormatting>
+ </vpe:template>
+ </vpe:if>
+ </vpe:if>
+ <vpe:if test="attrpresent('image')">
<vpe:template children="no" modify="no">
- <input type="{@type}" value="{iif(@value='',' ',jsfvalue(@value))}"
- class="{@styleClass}" style="{@style}"
- title="{tagstring()}" dir="{@dir}"/>
+ <input type="image" src="{src(@image)}"
+ class="{@styleClass}" style="{@style}" title="{tagstring()}" />
<vpe:resize>
<vpe:width width-attr="style.width" />
<vpe:height height-attr="style.height" />
</vpe:resize>
- <vpe:dnd>
- <vpe:drag start-enable="yes" />
- </vpe:dnd>
<vpe:textFormatting use-default-formats="yes">
</vpe:textFormatting>
</vpe:template>
</vpe:if>
- </vpe:if>
- <vpe:if test="attrpresent('image')">
- <vpe:template children="no" modify="no">
- <input type="image" src="{src(@image)}"
- class="{@styleClass}" style="{@style}" title="{tagstring()}" />
- <vpe:resize>
- <vpe:width width-attr="style.width" />
- <vpe:height height-attr="style.height" />
- </vpe:resize>
- <vpe:textFormatting use-default-formats="yes">
- </vpe:textFormatting>
- </vpe:template>
- </vpe:if>
+ <!--end-of-else-->
</vpe:tag>
<!-- Проблема с вложенным параметром (31 of 4) -->
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-11-13 17:24:38 UTC (rev 11768)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-11-13 17:42:56 UTC (rev 11769)
@@ -265,17 +265,17 @@
nsIDOMNode visualContainer) {
nsIDOMNode visualNewNode = createNode(sourceNode, visualContainer);
-
- // Fix for JBIDE-1097
- try {
- if (visualNewNode != null) {
- nsIDOMHTMLInputElement iDOMInputElement = (nsIDOMHTMLInputElement) visualNewNode
- .queryInterface(nsIDOMHTMLInputElement.NS_IDOMHTMLINPUTELEMENT_IID);
- iDOMInputElement.setReadOnly(true);
- }
- } catch (XPCOMException ex) {
- // just ignore this exception
- }
+// Commented as fix for JBIDE-3012.
+// // Fix for JBIDE-1097
+// try {
+// if (visualNewNode != null) {
+// nsIDOMHTMLInputElement iDOMInputElement = (nsIDOMHTMLInputElement) visualNewNode
+// .queryInterface(nsIDOMHTMLInputElement.NS_IDOMHTMLINPUTELEMENT_IID);
+// iDOMInputElement.setReadOnly(true);
+// }
+// } catch (XPCOMException ex) {
+// // just ignore this exception
+// }
if (visualNewNode != null) {
if (visualNextNode == null) {
visualContainer.appendChild(visualNewNode);
17 years, 5 months
JBoss Tools SVN: r11768 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor: template and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-11-13 12:24:38 -0500 (Thu, 13 Nov 2008)
New Revision: 11768
Removed:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/IVpeTemplateAdvice.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpePreviewDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java
Log:
JBIDE-3144
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpePreviewDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpePreviewDomBuilder.java 2008-11-13 16:54:24 UTC (rev 11767)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpePreviewDomBuilder.java 2008-11-13 17:24:38 UTC (rev 11768)
@@ -18,6 +18,7 @@
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
+import org.jboss.tools.vpe.editor.proxy.VpeProxyUtil;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeTemplate;
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
@@ -58,17 +59,9 @@
*/
@Override
protected nsIDOMNode createNode(Node sourceNode, nsIDOMNode visualOldContainer) {
-// boolean registerFlag = isCurrentMainDocument();
-// switch (sourceNode.getNodeType()) {
-// case Node.ELEMENT_NODE:
-// Map xmlnsMap = createXmlns((Element)sourceNode);
- Set ifDependencySet = new HashSet();
+
+ Set<?> ifDependencySet = new HashSet();
- /*
- * Setting current visual node was added
- * to fix h:dataTable content visibility on Preview tab.
- * http://jira.jboss.com/jira/browse/JBIDE-2059
- */
if(sourceNode==null||(
sourceNode.getNodeType()!=Node.TEXT_NODE
&&sourceNode.getNodeType()!=Node.ELEMENT_NODE
@@ -82,8 +75,8 @@
//FIX FOR JBIDE-1568, added by Max Areshkau
try {
if (ElService.getInstance().isCloneableNode(getPageContext(), sourceNode)) {
- final Node sourceNodeClone = sourceNode.cloneNode(true);
- template.beforeTemplateCreated(getPageContext(), sourceNodeClone, getVisualDocument());
+ final Node sourceNodeClone = VpeProxyUtil.createProxyForELExpressionNode(getPageContext(),
+ sourceNode);
creationData = template.create(getPageContext(), sourceNodeClone, getVisualDocument());
} else {
creationData = template.create(getPageContext(), sourceNode, getVisualDocument());
@@ -101,9 +94,7 @@
setTooltip((Element)sourceNode, (nsIDOMElement)visualNewNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID));
}
-// if (!isCurrentMainDocument() && visualNewElement != null) {
-// setReadOnlyElement(visualNewElement);
-// }
+
if (template.isChildren()) {
List<?> childrenInfoList = creationData.getChildrenInfoList();
@@ -124,19 +115,6 @@
getPageContext().setCurrentVisualNode(null);
return visualNewNode;
-// case Node.TEXT_NODE:
-// return createTextNode(sourceNode, registerFlag);
-// case Node.COMMENT_NODE:
-// if(!YES_STRING.equals(VpePreference.SHOW_COMMENTS.getValue())) {
-// return null;
-// }
-// nsIDOMElement visualNewComment = createComment(sourceNode);
-// if (registerFlag) {
-// registerNodes(new VpeNodeMapping(sourceNode, visualNewComment));
-// }
-// return visualNewComment;
-// }
-// return null;
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java 2008-11-13 16:54:24 UTC (rev 11767)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java 2008-11-13 17:24:38 UTC (rev 11768)
@@ -14,14 +14,12 @@
import java.util.HashSet;
import java.util.List;
-import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
import org.eclipse.wst.xml.core.internal.document.ElementImpl;
-import org.eclipse.wst.xml.core.internal.document.TextImpl;
import org.jboss.tools.jst.jsp.editor.ITextFormatter;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.VpeSourceInnerDragInfo;
@@ -37,17 +35,14 @@
import org.jboss.tools.vpe.editor.template.resize.VpeResizer;
import org.jboss.tools.vpe.editor.template.textformating.TextFormatingData;
import org.jboss.tools.vpe.editor.util.Constants;
-import org.jboss.tools.vpe.editor.util.ElService;
import org.jboss.tools.vpe.editor.util.NodesManagingUtil;
import org.jboss.tools.vpe.editor.util.SelectionUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
import org.mozilla.interfaces.nsIDOMText;
-import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
@@ -1452,49 +1447,6 @@
return false;
}
-
- /**
- * After template created.
- *
- * @param visualDocument the visual document
- * @param sourceNode the source node
- * @param pageContext the page context
- */
- public void afterTemplateCreated(VpePageContext pageContext, nsIDOMElement source, nsIDOMDocument visualDocument) {
-
- }
-
- public void beforeTemplateCreated(VpePageContext pageContext, Node sourceNode, nsIDOMDocument domDocument) {
- IFile file = null;
- //Fix for JBIDE-3030
- if(pageContext.getVisualBuilder().getCurrentIncludeInfo()!=null) {
- file = pageContext.getVisualBuilder().getCurrentIncludeInfo().getFile();
- }
- if ((file != null)) {
- // Node first((Element
- if (sourceNode.getNodeType() == Node.TEXT_NODE) {
- sourceNode.setNodeValue(
- ElService.getInstance().replaceElAndResources(pageContext, sourceNode));
- }
- final NamedNodeMap nodeMap = sourceNode.getAttributes();
-
- if ((nodeMap != null) && (nodeMap.getLength() > 0)) {
- for (int i = 0; i < nodeMap.getLength(); i++) {
- final Attr n = (Attr) nodeMap.item(i);
-
- n.setValue(ElService.getInstance().replaceElAndResources(pageContext,n));
-
- }
- if ((sourceNode.getChildNodes() != null) && (sourceNode.getChildNodes().getLength() > 0)) {
- for (int j = 0; j < sourceNode.getChildNodes().getLength(); j++) {
- beforeTemplateCreated(pageContext, sourceNode.getChildNodes().item(j), domDocument);
- }
- }
- }
-
- }
- }
-
public boolean isInvisible() {
return invisible;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java 2008-11-13 16:54:24 UTC (rev 11767)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java 2008-11-13 17:24:38 UTC (rev 11768)
@@ -20,7 +20,6 @@
import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
import org.jboss.tools.vpe.editor.selection.VpeSourceSelection;
import org.jboss.tools.vpe.editor.template.textformating.TextFormatingData;
-import org.jboss.tools.vpe.editor.util.IVpeTemplateAdvice;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -30,7 +29,7 @@
import org.w3c.dom.Node;
-public interface VpeTemplate extends IVpeTemplateAdvice {
+public interface VpeTemplate {
/**
* Initiates template after its creating
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/IVpeTemplateAdvice.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/IVpeTemplateAdvice.java 2008-11-13 16:54:24 UTC (rev 11767)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/IVpeTemplateAdvice.java 2008-11-13 17:24:38 UTC (rev 11768)
@@ -1,26 +0,0 @@
-package org.jboss.tools.vpe.editor.util;
-
-import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.mozilla.interfaces.nsIDOMDocument;
-import org.mozilla.interfaces.nsIDOMElement;
-import org.w3c.dom.Node;
-
-/**
- * The Interface IVpeTemplateAdvice.
- */
-public interface IVpeTemplateAdvice {
-
-
- /**
- * After template created.
- *
- * @param visualDocument the visual document
- * @param sourceNode the source node
- * @param pageContext the page context
- */
- void afterTemplateCreated(VpePageContext pageContext, nsIDOMElement sourceNode,
- nsIDOMDocument visualDocument);
-
-
- void beforeTemplateCreated(VpePageContext pageContext,Node sourceNode,nsIDOMDocument domDocument);
-}
17 years, 5 months
JBoss Tools SVN: r11767 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-11-13 11:54:24 -0500 (Thu, 13 Nov 2008)
New Revision: 11767
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java
Log:
JBIDE-3144
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java 2008-11-13 16:18:04 UTC (rev 11766)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java 2008-11-13 16:54:24 UTC (rev 11767)
@@ -62,7 +62,7 @@
return result;
}
final IFile file = pageContext.getVisualBuilder().getCurrentIncludeInfo().getFile();
- return ElService.getInstance().replaceEl(file, toReplace);
+ return ElService.getInstance().replaceEl(file, result);
}
}
17 years, 5 months
JBoss Tools SVN: r11766 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-11-13 11:18:04 -0500 (Thu, 13 Nov 2008)
New Revision: 11766
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java
Log:
JBIDE-2575
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java 2008-11-13 16:18:04 UTC (rev 11766)
@@ -0,0 +1,145 @@
+package org.jboss.tools.seam.ui.views.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.fieldassist.ContentProposalAdapter;
+import org.eclipse.jface.fieldassist.IContentProposal;
+import org.eclipse.jface.fieldassist.IContentProposalProvider;
+import org.eclipse.jface.text.BadLocationException;
+import org.jboss.tools.common.el.core.model.ELInstance;
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
+import org.jboss.tools.common.el.core.model.ELModel;
+import org.jboss.tools.common.el.core.model.ELUtil;
+import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.ui.attribute.IAttributeContentProposalProvider;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
+import org.jboss.tools.seam.ui.SeamGuiPlugin;
+
+public class SeamELAttributeContentProposalProvider implements
+ IAttributeContentProposalProvider {
+ XModelObject object;
+ XAttribute attribute;
+ IFile file;
+ SeamELCompletionEngine engine;
+
+ public void dispose() {
+ object = null;
+ attribute = null;
+ file = null;
+ engine = null;
+ }
+
+ public IContentProposalProvider getContentProposalProvider() {
+ if(file == null) return null;
+ return new ContentProposalProvider();
+ }
+
+ public int getProposalAcceptanceStyle() {
+ return ContentProposalAdapter.PROPOSAL_INSERT;
+ }
+
+ public void init(XModelObject object, XAttribute attribute) {
+ this.object = object;
+ this.attribute = attribute;
+ while(object != null && object.getFileType() != XModelObject.FILE) object = object.getParent();
+ if(object != null) {
+ IResource r = (IResource)object.getAdapter(IResource.class);
+ if(r instanceof IFile) {
+ file = (IFile)r;
+ }
+ }
+ if(file != null) {
+ IProject project = file.getProject();
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
+ if(seamProject != null) {
+ engine = new SeamELCompletionEngine(seamProject);
+ }
+ }
+
+ }
+
+ static IContentProposal[] EMPTY = new IContentProposal[0];
+
+ class ContentProposalProvider implements IContentProposalProvider {
+
+ public IContentProposal[] getProposals(String contents, int position) {
+ ELModel model = engine.getParserFactory().createParser().parse(contents);
+ ELInstance is = ELUtil.findInstance(model, position);
+ if(is == null) {
+ return EMPTY;
+ }
+
+ String prefix = getPrefix(contents, position, 0, contents.length());
+ if(prefix == null || prefix.length() == 0) {
+ if(!isExpressionAllowed(contents, position)) {
+ return EMPTY;
+ }
+ }
+
+ if(prefix == null) prefix = "";
+
+ List<String> suggestions = null;
+ try {
+ suggestions = engine.getCompletions(file, null, prefix, position, true, null, 0, contents.length());
+ } catch (BadLocationException e) {
+ SeamGuiPlugin.getPluginLog().logError(e);
+ }
+ if(suggestions == null) {
+ return EMPTY;
+ }
+ List<String> uniqueSuggestions = engine.makeUnique(suggestions);
+
+ List<IContentProposal> list = new ArrayList<IContentProposal>();
+ for (String p: uniqueSuggestions) {
+ String label = prefix + p;
+ IContentProposal cp = makeContentProposal(p, label);
+ list.add(cp);
+ }
+ return list.toArray(new IContentProposal[0]);
+ }
+
+ }
+
+ private IContentProposal makeContentProposal(final String proposal, final String label) {
+ return new IContentProposal() {
+ public String getContent() {
+ return proposal;
+ }
+
+ public String getDescription() {
+ return null;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public int getCursorPosition() {
+ return proposal.length();
+ }
+ };
+ }
+
+ public String getPrefix(String content, int offset, int start, int end) throws StringIndexOutOfBoundsException {
+ if (content == null || offset > content.length())
+ return null;
+ ELInvocationExpression expr = engine.findExpressionAtOffset(content, offset, start, end);
+ if (expr == null)
+ return null;
+ return content.substring(expr.getStartPosition(), offset);
+ }
+
+ private boolean isExpressionAllowed(String contents, int position) {
+ String el = contents.substring(0, position) + "a";
+ ELModel model1 = engine.getParserFactory().createParser().parse(el);
+ ELInvocationExpression expr = ELUtil.findExpression(model1, el.length());
+ return (expr != null);
+ }
+}
17 years, 5 months
JBoss Tools SVN: r11765 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-11-13 11:16:56 -0500 (Thu, 13 Nov 2008)
New Revision: 11765
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
Log:
JBIDE-2575
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2008-11-13 16:15:33 UTC (rev 11764)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2008-11-13 16:16:56 UTC (rev 11765)
@@ -924,8 +924,11 @@
* @return
*/
public ELInvocationExpression findExpressionAtOffset(IDocument document, int offset, int start, int end) {
- String content = document.get();
-
+ return findExpressionAtOffset(document.get(), offset, start, end);
+ }
+
+ public ELInvocationExpression findExpressionAtOffset(String content, int offset, int start, int end) {
+
//TODO this naive calculations should be removed;
// this method should be called with reasonable start and end.
if(start <= 0) start = guessStart(content, offset);
17 years, 5 months
JBoss Tools SVN: r11764 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-11-13 11:15:33 -0500 (Thu, 13 Nov 2008)
New Revision: 11764
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/AttributeContentProposalProviderFactory.java
Log:
JBIDE-2575
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/AttributeContentProposalProviderFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/AttributeContentProposalProviderFactory.java 2008-11-13 16:00:54 UTC (rev 11763)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/AttributeContentProposalProviderFactory.java 2008-11-13 16:15:33 UTC (rev 11764)
@@ -71,7 +71,6 @@
if (!ps.isEmpty()) {
control.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
- System.out.println("dispose");
for (IAttributeContentProposalProvider p : ps) {
p.dispose();
}
@@ -81,6 +80,7 @@
}
public List<IAttributeContentProposalProvider> getContentProposalProviders(XModelObject object, XAttribute attribute) {
+ //TODO
if(true) {
List<IAttributeContentProposalProvider> list = new ArrayList<IAttributeContentProposalProvider>();
list.add(new TestAttributeContentProposalProvider());
17 years, 5 months
JBoss Tools SVN: r11763 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template and 10 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-11-13 11:00:54 -0500 (Thu, 13 Nov 2008)
New Revision: 11763
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeProxyUtil.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineContainerTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfRadioSelectItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/ComponentUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/home.xhtml
trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/template/HtmlTextTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
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/VpeAbstractTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionJsfValue.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ResourceUtil.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SourceDomUtil.java
Log:
JBIDE-3144
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineContainerTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineContainerTemplate.java 2008-11-13 15:16:39 UTC (rev 11762)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineContainerTemplate.java 2008-11-13 16:00:54 UTC (rev 11763)
@@ -58,11 +58,9 @@
public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
- String fileName = null;
- Attr attr = ((Element)sourceNode).getAttributeNode(ATTR_TEMPLATE);
- if (attr != null && attr.getNodeValue().trim().length() > 0) {
- fileName = attr.getNodeValue().trim();
- IFile file = VpeCreatorUtil.getFile(fileName, pageContext);
+ String fileName = ((Element)sourceNode).getAttribute(ATTR_TEMPLATE);
+ if (fileName != null && fileName.trim().length() > 0) {
+ IFile file = VpeCreatorUtil.getFile(fileName, pageContext);
if (file != null) {
if (!pageContext.getVisualBuilder().isFileInIncludeStack(file)) {
registerDefine(pageContext, sourceNode);
@@ -80,7 +78,11 @@
pageContext.getVisualBuilder().pushIncludeStack(
new VpeIncludeInfo((Element) sourceNode, file,
document));
- defineContainer.add(sourceNode);
+ //we should add only real nodem, sourceNode can be a proxy
+ //so
+ if(sourceNode.getFirstChild()!=null) {
+ defineContainer.add(sourceNode.getFirstChild().getParentNode());
+ }
return creationData;
}
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineTemplate.java 2008-11-13 15:16:39 UTC (rev 11762)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineTemplate.java 2008-11-13 16:00:54 UTC (rev 11763)
@@ -13,11 +13,10 @@
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
- import org.jboss.tools.vpe.editor.util.HTML;
+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.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfRadioSelectItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfRadioSelectItemTemplate.java 2008-11-13 15:16:39 UTC (rev 11762)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfRadioSelectItemTemplate.java 2008-11-13 16:00:54 UTC (rev 11763)
@@ -142,10 +142,10 @@
// get parent element
Node parent = sourceNode.getParentNode();
- if ((parent == null) && (sourceNode instanceof Element)
- && (((Element) sourceNode).getAttribute(VpeVisualDomBuilder.PARENT) != null)) {
- parent = (Node) ((Element) sourceNode).getAttributeNode(VpeVisualDomBuilder.PARENT).getUserData(VpeVisualDomBuilder.PARENT);
- }
+// if ((parent == null) && (sourceNode instanceof Element)
+// && (((Element) sourceNode).getAttribute(VpeVisualDomBuilder.PARENT) != null)) {
+// parent = (Node) ((Element) sourceNode).getAttributeNode(VpeVisualDomBuilder.PARENT).getUserData(VpeVisualDomBuilder.PARENT);
+// }
if ((parent != null) && (parent.getNodeType() == Node.ELEMENT_NODE)) {
ElementImpl element = (ElementImpl) parent;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/ComponentUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/ComponentUtil.java 2008-11-13 15:16:39 UTC (rev 11762)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/ComponentUtil.java 2008-11-13 16:00:54 UTC (rev 11763)
@@ -109,7 +109,7 @@
BundleMap bundle = pageContext.getBundle();
- return bundle.getBundleValue(value, offfset);
+ return bundle.getBundleValue(value);
}
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2008-11-13 15:16:39 UTC (rev 11762)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2008-11-13 16:00:54 UTC (rev 11763)
@@ -158,10 +158,10 @@
Element groupSourceElement = (Element) sourceNode;
Element srcNode = null;
- if ((groupSourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE) != null)
- && (groupSourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE) instanceof Element)) {
- srcNode = (Element) groupSourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE);
- }
+// if ((groupSourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE) != null)
+// && (groupSourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE) instanceof Element)) {
+// srcNode = (Element) groupSourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE);
+// }
nsIDOMElement creationDataDiv = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_DIV);
VpeCreationData creationData = new VpeCreationData(creationDataDiv);
@@ -204,11 +204,11 @@
List<Node> children = null;
- if (srcNode != null) {
- children = ComponentUtil.getChildren((Element) groupSourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE));
- } else {
+// if (srcNode != null) {
+// children = ComponentUtil.getChildren((Element) groupSourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE));
+// } else {
children = ComponentUtil.getChildren(groupSourceElement);
- }
+// }
if (expanded) {
for (Node child : children) {
boolean isGroup = child.getNodeName().endsWith(
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2008-11-13 15:16:39 UTC (rev 11762)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2008-11-13 16:00:54 UTC (rev 11763)
@@ -130,10 +130,10 @@
Element itemSourceElement = (Element) sourceNode;
Element srcElement = null;
//added by estherbin fixed https://jira.jboss.org/jira/browse/JBIDE-1605
- if ((itemSourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE) != null)
- && (itemSourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE) instanceof Element)) {
- srcElement = (Element) itemSourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE);
- }
+// if ((itemSourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE) != null)
+// && (itemSourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE) instanceof Element)) {
+// srcElement = (Element) itemSourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE);
+// }
ComponentUtil.setCSSLink(pageContext, STYLE_PATH, COMPONENT_NAME);
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/home.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/home.xhtml 2008-11-13 15:16:39 UTC (rev 11762)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/home.xhtml 2008-11-13 16:00:54 UTC (rev 11763)
@@ -30,5 +30,4 @@
<li><h:outputText value="Test Test" /></li>
</ul>
</rich:panel>
-</ui:define>
-</ui:composition>
+</ui:define></ui:composition>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-11-13 15:16:39 UTC (rev 11762)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-11-13 16:00:54 UTC (rev 11763)
@@ -55,7 +55,7 @@
import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
-import org.jboss.tools.vpe.editor.template.IEditableTemplate;
+import org.jboss.tools.vpe.editor.proxy.VpeProxyUtil;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeCreatorUtil;
@@ -413,7 +413,8 @@
boolean registerFlag = isCurrentMainDocument();
- // reads and dispatch events
+ // reads and dispatch events, this code prevent eclipse
+ //from sleeping during processing big pages
getPageContext().processDisplayEvents();
// JBIDE-675, checks if editor was disposed or not
if (getPageContext().getSourceBuilder() == null
@@ -421,8 +422,6 @@
throw new VpeDisposeException();
}
- //getPageContext().processDisplayEvents();
-
// check source node can be changed and link can be a null in this case
// we shouldn't process this node
if (sourceNode == null
@@ -444,18 +443,20 @@
if (ElService.getInstance().isCloneableNode(getPageContext(),
sourceNode)) {
- sourceNodeClone = (sourceNode).cloneNode(true);
- if(sourceNodeClone instanceof Element){
- ((Element)sourceNodeClone).setAttribute(PARENT,""); //$NON-NLS-1$
- Attr a = ((Element)sourceNodeClone).getAttributeNode(PARENT);
- a.setUserData(PARENT, sourceNode.getParentNode(),null);
-
- //added by estherbin fix https://jira.jboss.org/jira/browse/JBIDE-1605 issue.
- sourceNodeClone.setUserData(SRC_NODE, sourceNode,null);
-
- }
- template.beforeTemplateCreated(getPageContext(),
- sourceNodeClone, getVisualDocument());
+
+ sourceNodeClone = VpeProxyUtil.createProxyForELExpressionNode(getPageContext(),
+ sourceNode);
+// if(sourceNodeClone instanceof Element){
+// ((Element)sourceNodeClone).setAttribute(PARENT,""); //$NON-NLS-1$
+// Attr a = ((Element)sourceNodeClone).getAttributeNode(PARENT);
+// a.setUserData(PARENT, sourceNode.getParentNode(),null);
+//
+// //added by estherbin fix https://jira.jboss.org/jira/browse/JBIDE-1605 issue.
+// sourceNodeClone.setUserData(SRC_NODE, sourceNode,null);
+//
+// }
+// template.beforeTemplateCreated(getPageContext(),
+// sourceNodeClone, getVisualDocument());
creationData = template.create(getPageContext(),
sourceNodeClone, getVisualDocument());
} else {
@@ -518,7 +519,7 @@
if (registerFlag) {
final VpeElementData data = creationData.getElementData();
-
+
if ((sourceNodeClone != null) && (data != null)
&& (data.getNodesData() != null)
&& (data.getNodesData().size() > 0)) {
@@ -971,19 +972,6 @@
return sourceNode;
}
- // private void updateComment(Node sourceNode) {
- // VpeNodeMapping mapping = domMapping.getNodeMapping(sourceNode);
- // if (mapping != null
- // && mapping.getType() == VpeNodeMapping.COMMENT_MAPPING) {
- // nsIDOMNodeList visualNodes = mapping.getVisualNode()
- // .getChildNodes();
- //
- // if (visualNodes.getLength() > 0) {
- // visualNodes.item(0).setNodeValue(sourceNode.getNodeValue());
- // }
- // }
- // }
-
private void updateElement(Node sourceNode) {
VpeElementMapping elementMapping = null;
VpeNodeMapping nodeMapping = domMapping.getNodeMapping(sourceNode);
@@ -1075,31 +1063,6 @@
return null;
}
- // public void setText(Node sourceText) {
- // Node sourceParent = sourceText.getParentNode();
- // if (sourceParent != null && sourceParent.getLocalName() != null) {
- // String sourceParentName = sourceParent.getLocalName();
- // if (HTML.TAG_TEXTAREA.equalsIgnoreCase(sourceParentName)
- // || HTML.TAG_OPTION.equalsIgnoreCase(sourceParentName)) {
- // updateNode(sourceText.getParentNode());
- // return;
- // }
- // }
- // nsIDOMNode visualText = domMapping.getVisualNode(sourceText);
- // if (visualText != null) {
- // String visualValue = TextUtil.visualText(sourceText.getNodeValue());
- // visualText.setNodeValue(visualValue);
- // }else {
- // VpeNodeMapping nodeMapping = domMapping
- // .getNodeMapping(sourceParent);
- // if (nodeMapping != null
- // && nodeMapping.getType() == VpeNodeMapping.ELEMENT_MAPPING) {
- // VpeTemplate template = ((VpeElementMapping) nodeMapping)
- // .getTemplate();
- // if (template != null) {
- // if (!template.containsText()) {
- // return;
- // }
public boolean setText(Node sourceText) {
Node sourceParent = sourceText.getParentNode();
if (sourceParent != null && sourceParent.getLocalName() != null) {
@@ -2244,60 +2207,6 @@
includeDocuments.clear();
}
- // protected Map createXmlns(Element sourceNode) {
- // NamedNodeMap attrs = ((Element) sourceNode).getAttributes();
- // if (attrs != null) {
- // Map xmlnsMap = new HashMap();
- // for (int i = 0; i < attrs.getLength(); i++) {
- // addTaglib(sourceNode, xmlnsMap, attrs.item(i).getNodeName(),
- // true);
- // }
- // if (xmlnsMap.size() > 0) {
- // return xmlnsMap;
- // }
- // }
- // return null;
- // }
-
- // private void setXmlnsAttribute(VpeElementMapping elementMapping,
- // String name, String value) {
- // Element sourceElement = (Element) elementMapping.getSourceNode();
- // if (sourceElement != null) {
- // Map xmlnsMap = elementMapping.getXmlnsMap();
- // if (xmlnsMap == null)
- // xmlnsMap = new HashMap();
- // addTaglib(sourceElement, xmlnsMap, name, true);
- // elementMapping.setXmlnsMap(xmlnsMap.size() > 0 ? xmlnsMap : null);
- // }
- // }
-
- // private void removeXmlnsAttribute(VpeElementMapping elementMapping,
- // String name) {
- // Element sourceElement = (Element) elementMapping.getSourceNode();
- // if (sourceElement != null) {
- // Map xmlnsMap = elementMapping.getXmlnsMap();
- // if (xmlnsMap != null) {
- // Object id = xmlnsMap.remove(name);
- // if (id != null) {
- // pageContext.setTaglib(((Integer) id).intValue(), null,
- // null, true);
- // elementMapping.setXmlnsMap(xmlnsMap.size() > 0 ? xmlnsMap
- // : null);
- // }
- // }
- // }
- // }
- //
- // private void addTaglib(Element sourceElement, Map xmlnsMap,
- // String attrName, boolean ns) {
- // Attr attr = sourceElement.getAttributeNode(attrName);
- // if (ATTR_XMLNS.equals(attr.getPrefix())) {
- // xmlnsMap.put(attr.getNodeName(), Integer.valueOf(attr.hashCode()));
- // pageContext.setTaglib(attr.hashCode(), attr.getNodeValue(), attr
- // .getLocalName(), ns);
- // }
- // }
-
/**
* @return the dnd
*/
@@ -2380,64 +2289,6 @@
}
/**
- * Create a visual element for text node
- *
- * @param sourceNode
- * @param registerFlag
- * @return a visual element for text node
- */
-
- // protected nsIDOMNode createTextNode(Node sourceNode, boolean
- // registerFlag) {
- // String sourceText = sourceNode.getNodeValue();
- // if(sourceText!=null){
- // final IFile file =
- // getPageContext().getVisualBuilder().getCurrentIncludeInfo().getFile();
- //
- // sourceText = ElService.getInstance().replaceEl(file, sourceText);
- // }
- // /*
- // * Max Areshkau this code causes very slow work of visual editor
- // * when we editing in big files txt nodes.For example exmployee.xhtml
- // * from JBIDE1105
- // *
- // * Denis Maliarevich:
- // * To fix JBIDE-2003 and JBIDE-2042
- // * this code should be uncommented.
- // */
- // if (sourceText.trim().length() <= 0) {
- // if (registerFlag) {
- // registerNodes(new VpeNodeMapping(sourceNode, null));
- // }
- // return null;
- // }
- //
- // if (faceletFile) {
- // Matcher matcher_EL = REGEX_EL.matcher(sourceText);
- // if (matcher_EL.find()) {
- // BundleMap bundle = pageContext.getBundle();
- // int offset = pageContext.getVisualBuilder()
- // .getCurrentMainIncludeOffset();
- // if (offset == -1)
- // offset = ((IndexedRegion) sourceNode).getStartOffset();
- // String jsfValue = bundle.getBundleValue(sourceText, offset);
- // sourceText = jsfValue;
- // }
- // }
- // String visualText = TextUtil.visualText(sourceText);
- //
- // nsIDOMNode visualNewTextNode = visualDocument
- // .createTextNode(visualText);
- // nsIDOMElement element = visualDocument.createElement(HTML.TAG_SPAN);
- // element.setAttribute(HTML.ATTR_STYLE, ""); //$NON-NLS-1$
- // element.appendChild(visualNewTextNode);
- // if (registerFlag) {
- // registerNodes(new VpeNodeMapping(sourceNode, element));
- // }
- //
- // return element;
- // }
- /**
* @return the xulRunnerEditor
*/
public XulRunnerEditor getXulRunnerEditor() {
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 2008-11-13 15:16:39 UTC (rev 11762)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java 2008-11-13 16:00:54 UTC (rev 11763)
@@ -353,7 +353,7 @@
return is;
}
- public String getBundleValue(String name, int offset){
+ public String getBundleValue(String name){
if(isShowBundleUsageAsEL) return name;
List<ELInstance> is = parseJSFExpression(name);
if(is == null) return null;
@@ -367,7 +367,7 @@
ELInvocationExpression expr = (ELInvocationExpression)i.getExpression();
String[] values = getCall(expr);
if(values != null) {
- String value = (values == null) ? null : getBundleValue(values[0], values[1], offset);
+ String value = (values == null) ? null : getBundleValue(values[0], values[1]);
if(value != null) {
sb.append(value);
index = i.getEndPosition();
@@ -405,11 +405,9 @@
return null;
}
- private String getBundleValue(String prefix, String propertyName, int offset) {
+ private String getBundleValue(String prefix, String propertyName) {
BundleEntry entry = getBundle(prefix);
if(entry != null) {
- //Added by estherbin fix JBIDE-2010 (issue with resources).
- if(offset!=0 && (entry.offset > offset))return null;
String name = prefix + "." + propertyName;
try{
String value = (String)entry.bundle.getObject(propertyName);
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java 2008-11-13 16:00:54 UTC (rev 11763)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor.proxy;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.util.ElService;
+import org.jboss.tools.vpe.editor.util.ResourceUtil;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Node;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class VpeNodeInvocationHandler implements InvocationHandler {
+
+ /**
+ * Node for which we process events
+ */
+ private Node node;
+
+ private VpePageContext pageContext;
+
+ /**
+ * @param node
+ */
+ public VpeNodeInvocationHandler(VpePageContext pageContext,Node node) {
+ this.node = node;
+ this.pageContext = pageContext;
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable {
+ Object result = method.invoke(node, args);
+ if(result instanceof String) {
+ String processedStr = (String) result;
+ result = replaceEL(processedStr);
+ } else if(result instanceof Attr) {
+ result = VpeProxyUtil.createProxyForELExpressionNode(pageContext,
+ (Node)result);
+ }
+ return result;
+ }
+
+ protected String replaceEL(String toReplace) {
+ String result = toReplace;
+
+ //fix for JBIDE-3030
+ result = ResourceUtil.getBundleValue(pageContext, toReplace);
+ if(pageContext.getVisualBuilder().getCurrentIncludeInfo()==null) {
+ return result;
+ }
+ final IFile file = pageContext.getVisualBuilder().getCurrentIncludeInfo().getFile();
+ return ElService.getInstance().replaceEl(file, toReplace);
+ }
+
+}
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeProxyUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeProxyUtil.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeProxyUtil.java 2008-11-13 16:00:54 UTC (rev 11763)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor.proxy;
+
+import java.lang.reflect.Proxy;
+import java.util.ArrayList;
+import java.util.List;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Utill Class created for creating proxis for vpe
+ * and manipulation them
+ *
+ * @author mareshkau
+ */
+public class VpeProxyUtil {
+
+ /**
+ * Create proxy for source nodes. This function should be called for nodes,
+ * in which used el expressions which should be replaced
+ * @param sourceNode
+ * @return proxy for node
+ */
+ public static Node createProxyForELExpressionNode(VpePageContext pageContext,
+ Node sourceNode) {
+
+ Node proxy = null;
+ List<Class<?>> interfaceses = new ArrayList<Class<?>>();
+ interfaceses.add(Node.class);
+ if(sourceNode instanceof Element) {
+ interfaceses.add(Element.class);
+ } else if(sourceNode instanceof Attr) {
+ interfaceses.add(Attr.class);
+ }
+ proxy = (Node) Proxy.newProxyInstance(Node.class.getClassLoader(),
+ interfaceses.toArray(new Class[0]),
+ new VpeNodeInvocationHandler(pageContext,sourceNode));
+
+ return proxy;
+ }
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java 2008-11-13 15:16:39 UTC (rev 11762)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java 2008-11-13 16:00:54 UTC (rev 11763)
@@ -1462,30 +1462,6 @@
*/
public void afterTemplateCreated(VpePageContext pageContext, nsIDOMElement source, nsIDOMDocument visualDocument) {
-// final IFile file = pageContext.getVisualBuilder().getCurrentIncludeInfo().getFile();
-//
-// if ((file != null) && ElService.getInstance().isAvailable(file)) {
-// final nsIDOMNamedNodeMap nodeMap = source.getAttributes();
-// for (int i = 0; i < nodeMap.getLength(); i++) {
-// nsIDOMNode n = nodeMap.item(i);
-//
-// source.setAttribute(n.getNodeName(), ElService.getInstance().replaceEl(file, n.getNodeValue()));
-//
-// }
-//// if(source.getNodeName().equalsIgnoreCase("img")){
-//// source.setAttribute("src", ElService.getInstance().replaceEl(file, source.getAttribute("src")));
-//// }
-// if ((source.getChildNodes() != null) && source.getChildNodes().getLength() > 0) {
-// for (int j = 0; j < source.getChildNodes().getLength(); j++) {
-// if (source.getChildNodes().item(j).getNodeType() == nsIDOMNode.ELEMENT_NODE) {
-// afterTemplateCreated(pageContext, (nsIDOMElement) source.getChildNodes().item(j).queryInterface(
-// nsIDOMElement.NS_IDOMELEMENT_IID), visualDocument);
-// }
-// }
-// }
-// }
-//
-// System.err.println("Hello world4");
}
public void beforeTemplateCreated(VpePageContext pageContext, Node sourceNode, nsIDOMDocument domDocument) {
@@ -1500,13 +1476,6 @@
sourceNode.setNodeValue(
ElService.getInstance().replaceElAndResources(pageContext, sourceNode));
}
- /*
- else if (sourceNode.getFirstChild() instanceof Text) {
- sourceNode.getFirstChild().setNodeValue(ElService.getInstance().replaceElAndResources(pageContext, sourceNode.getFirstChild()));
- } else if ((sourceNode.getFirstChild() != null) && (sourceNode.getFirstChild().getFirstChild() instanceof Text)) {
- sourceNode.getFirstChild().getFirstChild().setNodeValue(ElService.getInstance().replaceElAndResources(pageContext,sourceNode.getFirstChild().getFirstChild()));
- }
- */
final NamedNodeMap nodeMap = sourceNode.getAttributes();
if ((nodeMap != null) && (nodeMap.getLength() > 0)) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionJsfValue.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionJsfValue.java 2008-11-13 15:16:39 UTC (rev 11762)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionJsfValue.java 2008-11-13 16:00:54 UTC (rev 11763)
@@ -10,20 +10,16 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.template.expression;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.w3c.dom.Node;
-
import org.jboss.tools.vpe.editor.bundle.BundleMap;
import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.w3c.dom.Node;
public class VpeFunctionJsfValue extends VpeFunction {
public VpeValue exec(VpePageContext pageContext, Node sourceNode) throws VpeExpressionException {
String value = getParameter(0).exec(pageContext, sourceNode).stringValue();
BundleMap bundle = pageContext.getBundle();
- int offset = pageContext.getVisualBuilder().getCurrentMainIncludeOffset();
- if (offset == -1) offset = ((IndexedRegion)sourceNode).getStartOffset();
- String jsfValue = bundle.getBundleValue(value, offset);
+ String jsfValue = bundle.getBundleValue(value);
return new VpeValue(jsfValue != null ? jsfValue : value);
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java 2008-11-13 15:16:39 UTC (rev 11762)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java 2008-11-13 16:00:54 UTC (rev 11763)
@@ -85,9 +85,8 @@
*
* @return the string
*
- * @see IELService#getReplacedElValue(IFile, String)
+ * @see IELService#replaceEl(IFile, String)
*/
- //@Deprecated
public String replaceEl(IFile resourceFile, String resourceString) {
// Assert.isNotNull(resourceString);
if ((resourceString == null) || (resourceFile == null)) {
@@ -161,22 +160,6 @@
*/
public boolean isInResourcesBundle(VpePageContext pageContext, Node sourceNode) {
boolean rst = findInResourcesBundle(pageContext, sourceNode);
-
-// if (!rst && (sourceNode.getChildNodes() != null) && (sourceNode.getChildNodes().getLength() > 0)) {
-// for (int i = 0; i < sourceNode.getChildNodes().getLength(); i++) {
-// final Node node = sourceNode.getChildNodes().item(i);
-//
-// if (node.getNodeType() == Node.ELEMENT_NODE) {
-// if((rst = findInResourcesBundle(pageContext, node))){
-// break;
-// }
-//
-//
-// }
-//
-// }
-// }
-
return rst;
}
@@ -197,7 +180,7 @@
textValue = sourceNode.getNodeValue();
if ((textValue != null) && TextUtil.isContainsEl(textValue)) {
- final String newValue = bundleMap.getBundleValue(textValue, 0);
+ final String newValue = bundleMap.getBundleValue(textValue);
if (!textValue.equals(newValue)) {
rst = true;
@@ -217,7 +200,7 @@
final String value = attr.getValue();
if (value != null && TextUtil.isContainsEl(value)) {
- final String value2 = bundleMap.getBundleValue(value, 0);
+ final String value2 = bundleMap.getBundleValue(value);
if (!value2.equals(value)) {
rst = true;
@@ -243,20 +226,6 @@
*/
private boolean isAvailableForNode(Node sourceNode, IFile resourceFile) {
boolean rst = findForNode(sourceNode, resourceFile);
-
-// if (!rst && (sourceNode.getChildNodes() != null) && (sourceNode.getChildNodes().getLength() > 0)) {
-// for (int i = 0; i < sourceNode.getChildNodes().getLength(); i++) {
-// final Node node = sourceNode.getChildNodes().item(i);
-//
-// if (node.getNodeType() == Node.ELEMENT_NODE) {
-// if((rst = findForNode((Element) node, resourceFile))){
-// break;
-// }
-// }
-//
-// }
-// }
-
return rst;
}
@@ -379,7 +348,7 @@
return rst;
}
-
+
public String replaceElAndResources(VpePageContext pageContext, Node attributeNode) {
@@ -401,12 +370,9 @@
return rst;
}
+
-// private String replaceResourceBundle(VpePageContext context,Attr attributeNode){
-//
-// }
-
private boolean equalsExppression(String value, String expression) {
final String dollarEl = String.valueOf(DOLLAR_PREFIX) + expression
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ResourceUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ResourceUtil.java 2008-11-13 15:16:39 UTC (rev 11762)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ResourceUtil.java 2008-11-13 16:00:54 UTC (rev 11763)
@@ -11,17 +11,15 @@
package org.jboss.tools.vpe.editor.util;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
import org.jboss.tools.vpe.editor.bundle.BundleMap;
import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.w3c.dom.Attr;
import org.w3c.dom.Node;
/**
* @author Evgenij Stherbin
*
*/
-@SuppressWarnings("restriction")
+
public class ResourceUtil {
/**
* Gets the bundle value.
@@ -34,12 +32,11 @@
*
* @return the bundle value
*/
- public static String getBundleValue(VpePageContext pageContext, String value, int offset) {
+ public static String getBundleValue(VpePageContext pageContext, String value) {
BundleMap bundle = pageContext.getBundle();
- return bundle.getBundleValue(value, offset);
+ return bundle.getBundleValue(value);
}
-
/**
* get bundle.
*
@@ -48,26 +45,8 @@
*
* @return the bundle value
*/
- public static String getBundleValue(VpePageContext pageContext, Attr attr) {
- return getBundleValue(pageContext, attr.getNodeValue(), ((IDOMAttr) attr).getValueRegionStartOffset());
- }
-
-
-
- /**
- * get bundle.
- *
- * @param pageContext the page context
- * @param attr the attr
- *
- * @return the bundle value
- */
public static String getBundleValue(VpePageContext pageContext, Node attr) {
- if(attr instanceof IDOMAttr){
- return getBundleValue(pageContext, attr.getNodeValue(), ((IDOMAttr) attr).getValueRegionStartOffset());
- }else{
- return getBundleValue(pageContext,attr.getNodeValue(),0);
- }
+ return getBundleValue(pageContext,attr.getNodeValue());
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SourceDomUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SourceDomUtil.java 2008-11-13 15:16:39 UTC (rev 11762)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SourceDomUtil.java 2008-11-13 16:00:54 UTC (rev 11763)
@@ -10,10 +10,8 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.util;
-import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
-import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Node;
public class SourceDomUtil {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/template/HtmlTextTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/template/HtmlTextTemplate.java 2008-11-13 15:16:39 UTC (rev 11762)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/template/HtmlTextTemplate.java 2008-11-13 16:00:54 UTC (rev 11763)
@@ -68,24 +68,8 @@
} else {
textNode = node;
}
-
- String sourceNodeValue=null;
- if((nodeMapping.getSourceNode()!=null) &&
- (nodeMapping.getSourceNode().getNodeType()==Node.TEXT_NODE)) {
- sourceNodeValue=nodeMapping.getSourceNode().getNodeValue();
- }
- String visualNodeValue=null;
- if((textNode!=null)&&
- (textNode.getNodeType()==nsIDOMNode.TEXT_NODE)) {
- visualNodeValue = textNode.getNodeValue();
- }
-
- boolean editable =false;
- if(sourceNodeValue!=null && visualNodeValue!=null) {
- editable =sourceNodeValue.trim().equals(visualNodeValue.trim());
- }
- result = new NodeData(nodeMapping.getSourceNode(),textNode,editable);
+ result = new NodeData(nodeMapping.getSourceNode(),textNode,true);
return result;
}
17 years, 5 months
JBoss Tools SVN: r11762 - trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-11-13 10:16:39 -0500 (Thu, 13 Nov 2008)
New Revision: 11762
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-2734
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2008-11-13 15:03:24 UTC (rev 11761)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2008-11-13 15:16:39 UTC (rev 11762)
@@ -33,7 +33,8 @@
org.jboss.tools.hibernate.ui.view,
org.eclipse.ui.editors,
org.eclipse.debug.core,
- org.jboss.tools.tests;bundle-version="2.0.0"
+ org.jboss.tools.tests;bundle-version="2.0.0",
+ org.eclipse.debug.ui;bundle-version="3.4.0"
Eclipse-LazyStart: true
Bundle-Activator: org.hibernate.eclipse.console.test.HibernateConsoleTestPlugin
Eclipse-RegisterBuddy: org.hibernate.eclipse
17 years, 5 months