Author: dmaliarevich
Date: 2008-02-13 03:44:47 -0500 (Wed, 13 Feb 2008)
New Revision: 6289
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1682, source selection corrected
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java 2008-02-12
22:09:22 UTC (rev 6288)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java 2008-02-13
08:44:47 UTC (rev 6289)
@@ -23,6 +23,7 @@
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.vpe.editor.VpeSourceDomBuilder;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
@@ -202,7 +203,21 @@
ComponentUtil.setCSSLink(pageContext, STYLE_PATH, "calendar");
nsIDOMElement div = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_DIV);
- VpeCreationData creationData = new VpeCreationData(div);
+
+ nsIDOMElement resultTable = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+ nsIDOMElement resultTD = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ nsIDOMElement resultTR = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TR);
+
+ resultTD.appendChild(div);
+ resultTR.appendChild(resultTD);
+ resultTable.appendChild(resultTR);
+
+ VpeCreationData creationData = new VpeCreationData(resultTable);
+
+
nsIDOMElement calendar;
nsIDOMElement calendarWithPopup;
if ("false".equalsIgnoreCase(popup)) {
@@ -977,4 +992,12 @@
String toggleId) {
showPopupCalendar = !showPopupCalendar;
}
+
+ @Override
+ public void setSourceAttributeSelection(VpePageContext pageContext,
+ Element sourceElement, int offset, int length, Object data) {
+ VpeSourceDomBuilder sourceBuilder = pageContext.getSourceBuilder();
+ sourceBuilder.setSelection(sourceElement, 0, 0);
+ }
+
}