Author: mareshkau
Date: 2008-09-18 13:25:53 -0400 (Thu, 18 Sep 2008)
New Revision: 10364
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/META-INF/MANIFEST.MF
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesTableProvider.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAnyCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAnyData.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
trunk/vpe/plugins/org.jboss.tools.vpe/ve/init.html
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/template/VpeTemplateManagerTest.java
Log:
JBIDE-2521
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/META-INF/MANIFEST.MF 2008-09-18 17:12:06 UTC
(rev 10363)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/META-INF/MANIFEST.MF 2008-09-18 17:25:53 UTC
(rev 10364)
@@ -14,7 +14,8 @@
org.jboss.tools.jst.jsp.editor,
org.jboss.tools.jst.jsp.jspeditor,
org.jboss.tools.jst.jsp.outline,
- org.jboss.tools.jst.jsp.outline.cssdialog.common,
+ org.jboss.tools.jst.jsp.outline.cssdialog,
+ org.jboss.tools.jst.jsp.outline.common,
org.jboss.tools.jst.jsp.preferences,
org.jboss.tools.jst.jsp.support.kb,
org.jboss.tools.jst.jsp.text,
@@ -59,5 +60,6 @@
org.eclipse.core.runtime,
org.eclipse.ui.views
Bundle-Version: 2.0.0
-Export-Package: org.jboss.tools.jst.jsp.outline.cssdialog.parsers
+Export-Package: org.jboss.tools.jst.jsp.outline.cssdialog.common,
+ org.jboss.tools.jst.jsp.outline.cssdialog.parsers
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesTableProvider.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesTableProvider.java 2008-09-18
17:12:06 UTC (rev 10363)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesTableProvider.java 2008-09-18
17:25:53 UTC (rev 10364)
@@ -48,8 +48,6 @@
return data.getTagForDisplay();
case 2:
return data.getName();
- case 3:
- return data.getDisplay();
case 4:
if(data.isChildren()) return "yes";
else return "no";
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAnyCreator.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAnyCreator.java 2008-09-18
17:12:06 UTC (rev 10363)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAnyCreator.java 2008-09-18
17:25:53 UTC (rev 10364)
@@ -14,7 +14,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.jboss.tools.jst.jsp.preferences.VpePreference;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.expression.VpeExpression;
@@ -22,7 +21,6 @@
import org.jboss.tools.vpe.editor.template.expression.VpeExpressionBuilderException;
import org.jboss.tools.vpe.editor.template.expression.VpeExpressionException;
import org.jboss.tools.vpe.editor.template.expression.VpeExpressionInfo;
-import org.jboss.tools.vpe.editor.template.expression.VpeValue;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMAttr;
import org.mozilla.interfaces.nsIDOMDocument;
@@ -31,43 +29,35 @@
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-
+/**
+ * Creator for any attribute
+ * @author mareshkau
+ *
+ */
public class VpeAnyCreator extends VpeAbstractCreator {
- static final String CLASS_TAG_BLOCK = "__any__tag__block";
- static final String CLASS_TAG_INLINE = "__any__tag__inline";
- static final String CLASS_TAG_NONE = "__any__tag__none";
- static final String CLASS_TAG_CAPTION = "__any__tag__caption";
+
+ private static final String DEFAULT_TAG_FOR_DISPLAY=HTML.TAG_DIV;
+
+ static final String CLASS_TAG_BLOCK = "__any__tag__block"; //$NON-NLS-1$
+ static final String CLASS_TAG_INLINE = "__any__tag__inline"; //$NON-NLS-1$
+ static final String CLASS_TAG_NONE = "__any__tag__none"; //$NON-NLS-1$
+ static final String CLASS_TAG_CAPTION = "__any__tag__caption"; //$NON-NLS-1$
- static final String VAL_DISPLAY_BLOCK = "block";
- static final String VAL_DISPLAY_INLINE = "inline";
- static final String VAL_DISPLAY_NONE = "none";
- private boolean caseSensitive;
- private VpeExpression tagForDisplayExpr;
- private VpeExpression displayExpr;
private VpeExpression valueExpr;
- private VpeExpression borderExpr;
- private VpeExpression valueColorExpr;
- private VpeExpression valueBackgroundColorExpr;
- private VpeExpression backgroundColorExpr;
- private VpeExpression borderColorExpr;
- private VpeExpression showIconExpr;
-
+ private VpeExpression tagForDisplayExpr;
+ private VpeExpression styleExpr;
+
private List propertyCreators;
private Set dependencySet;
private String tagForDisplayStr;
- private String displayStr;
private String valueStr;
- private String borderStr;
- private String valueColorStr;
- private String valueBackgroundColorStr;
- private String backgroundColorStr;
- private String borderColorStr;
+ private String styleStr;
private boolean showIconBool;
+ private boolean children;
VpeAnyCreator(Element element, VpeDependencyMap dependencyMap, boolean caseSensitive) {
- this.caseSensitive = caseSensitive;
build(element, dependencyMap);
}
@@ -76,33 +66,31 @@
if (tagForDisplay != null) {
try {
tagForDisplayStr = tagForDisplay.getNodeValue();
- VpeExpressionInfo info =
VpeExpressionBuilder.buildCompletedExpression(tagForDisplayStr,caseSensitive);
+ VpeExpressionInfo info =
VpeExpressionBuilder.buildCompletedExpression(tagForDisplayStr,true);
tagForDisplayExpr = info.getExpression();
- dependencySet = info.getDependencySet();
dependencyMap.setCreator(this, info.getDependencySet());
} catch(VpeExpressionBuilderException ex) {
VpePlugin.reportProblem(ex);
}
}
- Attr displayAttr = element.getAttributeNode(VpeTemplateManager.ATTR_ANY_DISPLAY);
- if (displayAttr != null) {
+ Attr styleAttr = element.getAttributeNode(VpeTemplateManager.ATTR_ANY_STYLE);
+ if (styleAttr!=null) {
try {
- displayStr = displayAttr.getValue();
- VpeExpressionInfo info = VpeExpressionBuilder.buildCompletedExpression(displayStr,
caseSensitive);
- displayExpr = info.getExpression();
- dependencySet = info.getDependencySet();
+ styleStr = styleAttr.getValue();
+ VpeExpressionInfo info = VpeExpressionBuilder.buildCompletedExpression(styleStr,
true);
+ styleExpr = info.getExpression();
dependencyMap.setCreator(this, info.getDependencySet());
} catch(VpeExpressionBuilderException e) {
VpePlugin.reportProblem(e);
}
}
-
+
Attr valueAttr = element.getAttributeNode(VpeTemplateManager.ATTR_ANY_VALUE);
if (valueAttr != null) {
try {
valueStr = valueAttr.getValue();
- VpeExpressionInfo info = VpeExpressionBuilder.buildCompletedExpression(valueStr,
caseSensitive);
+ VpeExpressionInfo info = VpeExpressionBuilder.buildCompletedExpression(valueStr,
true);
valueExpr = info.getExpression();
dependencyMap.setCreator(this, info.getDependencySet());
} catch(VpeExpressionBuilderException e) {
@@ -115,189 +103,134 @@
try {
if("yes".equals(showIconAttr.getValue())) showIconBool = true;
else showIconBool = false;
- VpeExpressionInfo info =
VpeExpressionBuilder.buildCompletedExpression(showIconAttr.getValue(), caseSensitive);
- showIconExpr = info.getExpression();
+ VpeExpressionInfo info =
VpeExpressionBuilder.buildCompletedExpression(showIconAttr.getValue(), true);
dependencyMap.setCreator(this, info.getDependencySet());
} catch(VpeExpressionBuilderException e) {
VpePlugin.reportProblem(e);
}
}
- Attr borderAttr = element.getAttributeNode(VpeTemplateManager.ATTR_ANY_BORDER);
- if (borderAttr != null) {
- try {
- borderStr = borderAttr.getValue();
- VpeExpressionInfo info = VpeExpressionBuilder.buildCompletedExpression(borderStr,
caseSensitive);
- borderExpr = info.getExpression();
- dependencyMap.setCreator(this, info.getDependencySet());
- } catch(VpeExpressionBuilderException e) {
- VpePlugin.reportProblem(e);
- }
- }
- Attr valueColorAttr =
element.getAttributeNode(VpeTemplateManager.ATTR_ANY_VALUE_COLOR);
- if (valueColorAttr != null) {
- try {
- valueColorStr = valueColorAttr.getValue();
- VpeExpressionInfo info = VpeExpressionBuilder.buildCompletedExpression(valueColorStr,
caseSensitive);
- valueColorExpr = info.getExpression();
- dependencyMap.setCreator(this, info.getDependencySet());
- } catch(VpeExpressionBuilderException e) {
- VpePlugin.reportProblem(e);
- }
- }
- Attr valueBackgroundColorAttr =
element.getAttributeNode(VpeTemplateManager.ATTR_ANY_VALUE_BACKGROUND_COLOR);
- if (valueBackgroundColorAttr != null) {
- try {
- valueBackgroundColorStr = valueBackgroundColorAttr.getValue();
- VpeExpressionInfo info =
VpeExpressionBuilder.buildCompletedExpression(valueBackgroundColorStr, caseSensitive);
- valueBackgroundColorExpr = info.getExpression();
- dependencyMap.setCreator(this, info.getDependencySet());
- } catch(VpeExpressionBuilderException e) {
- VpePlugin.reportProblem(e);
- }
- }
-
- Attr backgroundColorAttr =
element.getAttributeNode(VpeTemplateManager.ATTR_ANY_BACKGROUND_COLOR);
- if (backgroundColorAttr != null) {
- try {
- backgroundColorStr = backgroundColorAttr.getValue();
- VpeExpressionInfo info =
VpeExpressionBuilder.buildCompletedExpression(backgroundColorStr, caseSensitive);
- backgroundColorExpr = info.getExpression();
- dependencyMap.setCreator(this, info.getDependencySet());
- } catch(VpeExpressionBuilderException e) {
- VpePlugin.reportProblem(e);
- }
- }
-
- Attr borderColorAttr =
element.getAttributeNode(VpeTemplateManager.ATTR_ANY_BORDER_COLOR);
- if (borderColorAttr != null) {
- try {
- borderColorStr = borderColorAttr.getValue();
- VpeExpressionInfo info =
VpeExpressionBuilder.buildCompletedExpression(borderColorStr, caseSensitive);
- borderColorExpr = info.getExpression();
- dependencyMap.setCreator(this, info.getDependencySet());
- } catch(VpeExpressionBuilderException e) {
- VpePlugin.reportProblem(e);
- }
- }
-
if (VpeTemplateManager.ATTR_ANY_PROPERTIES != null) {
for (int i = 0; i < VpeTemplateManager.ATTR_ANY_PROPERTIES.length; i++) {
String attrName = VpeTemplateManager.ATTR_ANY_PROPERTIES[i];
Attr attr = element.getAttributeNode(attrName);
if (attr != null) {
if (propertyCreators == null) propertyCreators = new ArrayList();
- propertyCreators.add(new VpeAttributeCreator(attrName, attr.getValue(),
dependencyMap, caseSensitive));
+ propertyCreators.add(new VpeAttributeCreator(attrName, attr.getValue(),
dependencyMap, true));
}
}
}
Attr attr = element.getAttributeNode("title");
if (attr == null) {
if (propertyCreators == null) propertyCreators = new ArrayList();
- propertyCreators.add(new VpeAttributeCreator("title",
"{tagstring()}", dependencyMap, caseSensitive));
+ propertyCreators.add(new VpeAttributeCreator("title",
"{tagstring()}", dependencyMap, true));
}
}
-
+ @Override
public VpeCreatorInfo create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument
visualDocument, nsIDOMElement visualElement, Map visualNodeMap) throws
VpeExpressionException {
- nsIDOMElement div = visualDocument.createElement(HTML.TAG_DIV);
- VpeCreatorInfo creatorInfo = new VpeCreatorInfo(div);
+
+ String tagForDisplay =getExprValue(pageContext, tagForDisplayExpr, sourceNode);
+
+ if(tagForDisplay == null||tagForDisplay.length()==0) {
+ tagForDisplay = DEFAULT_TAG_FOR_DISPLAY;
+ }
+
+ nsIDOMElement anyElement = visualDocument.createElement(tagForDisplay);
+
+ VpeCreatorInfo creatorInfo = new VpeCreatorInfo(anyElement);
- nsIDOMElement span = visualDocument.createElement(HTML.TAG_SPAN);
- div.appendChild(span);
if(showIconBool){
nsIDOMElement img = visualDocument.createElement(HTML.TAG_IMG);
- img.setAttribute("src","any.gif");
- img.setAttribute("width","16");
- img.setAttribute("height","16");
- span.appendChild(img);
+ img.setAttribute("src","any.gif"); //$NON-NLS-1$//$NON-NLS-2$
+ img.setAttribute("width","16"); //$NON-NLS-1$ //$NON-NLS-2$
+ img.setAttribute("height","16"); //$NON-NLS-1$ //$NON-NLS-2$
+ anyElement.appendChild(img);
}
-
- visualNodeMap.put(this, new VisualElements(div, span));
-
+ anyElement.setAttribute(HTML.ATTR_CLASS, CLASS_TAG_CAPTION);
+
+ String styleString = getExprValue(pageContext, styleExpr, sourceNode);
+
+ anyElement.setAttribute(HTML.ATTR_STYLE, styleString);
+
if (propertyCreators != null) {
for (int i = 0; i < propertyCreators.size(); i++) {
VpeCreator creator = (VpeCreator)propertyCreators.get(i);
if (creator != null) {
- VpeCreatorInfo info = creator.create(pageContext, (Element) sourceNode,
visualDocument, div, visualNodeMap);
+ VpeCreatorInfo info = creator.create(pageContext, (Element) sourceNode,
visualDocument, anyElement, visualNodeMap);
if (info != null && info.getVisualNode() != null) {
nsIDOMAttr attr = (nsIDOMAttr)info.getVisualNode();
- div.setAttributeNode(attr);
+ anyElement.setAttributeNode(attr);
}
}
}
}
- setStyles(pageContext, sourceNode, div, span);
+// setStyles(pageContext, sourceNode, div, span);
String valueStr = getExprValue(pageContext, valueExpr, sourceNode);
nsIDOMNode valueNode = visualDocument.createTextNode(valueStr);
- span.appendChild(valueNode);
+ anyElement.appendChild(valueNode);
creatorInfo.addDependencySet(dependencySet);
return creatorInfo;
}
- private void setStyles(VpePageContext pageContext, Node sourceNode, nsIDOMElement div,
nsIDOMElement span) throws VpeExpressionException {
- boolean display = true;
- boolean displayBlock = true;
+// private void setStyles(VpePageContext pageContext, Node sourceNode, nsIDOMElement div,
nsIDOMElement span) throws VpeExpressionException {
+// boolean display = true;
+// boolean displayBlock = true;
+//
+// if (displayExpr != null) {
+// VpeValue vpeValue = displayExpr.exec(pageContext, sourceNode);
+// if (vpeValue != null) {
+// String displayStr = vpeValue.stringValue();
+// if (caseSensitive) {
+// display = !VAL_DISPLAY_NONE.equals(displayStr);
+// displayBlock = display && !VAL_DISPLAY_INLINE.equals(displayStr);
+// } else {
+// display = !VAL_DISPLAY_NONE.equalsIgnoreCase(displayStr);
+// displayBlock = display &&
!VAL_DISPLAY_INLINE.equalsIgnoreCase(displayStr);
+// }
+// }
+// }
+//
+// if (display) {
+// div.setAttribute("class", displayBlock ? CLASS_TAG_BLOCK :
CLASS_TAG_INLINE);
+//
+// String styleStr = "";
+// String borderStr = getExprValue(pageContext, borderExpr, sourceNode);
+//
+// if
("yes".equalsIgnoreCase(VpePreference.SHOW_BORDER_FOR_UNKNOWN_TAGS.getValue()))
{
+// styleStr += borderStr.length() > 0 ? "border-width:" + borderStr +
";" : "";
+// } else {
+// styleStr += "border-width:0px;";
+// }
+//
+// String borderColorStr = getExprValue(pageContext, borderColorExpr, sourceNode);
+// styleStr += borderColorStr.length() > 0 ? "border-color:" +
borderColorStr + ";" : "";
+// String backgroundColorStr = getExprValue(pageContext, backgroundColorExpr,
sourceNode);
+// styleStr += backgroundColorStr.length() > 0 ? "background-color:" +
backgroundColorStr : "";
+// if (styleStr.trim().length() > 0) div.setAttribute("style", styleStr);
+// } else {
+// div.setAttribute("class", CLASS_TAG_NONE);
+// }
+//
+// span.setAttribute("class", CLASS_TAG_CAPTION);
+//
+// String styleStr = "";
+// String valueColorStr = getExprValue(pageContext, valueColorExpr, sourceNode);
+// styleStr += valueColorStr.length() > 0 ? "color:" + valueColorStr +
";" : "";
+// String valueBackgroundColorStr = getExprValue(pageContext, valueBackgroundColorExpr,
sourceNode);
+// styleStr += valueBackgroundColorStr.length() > 0 ? "background-color:" +
valueBackgroundColorStr : "";
+// if (styleStr.trim().length() > 0) span.setAttribute("style", styleStr);
+// }
- if (displayExpr != null) {
- VpeValue vpeValue = displayExpr.exec(pageContext, sourceNode);
- if (vpeValue != null) {
- String displayStr = vpeValue.stringValue();
- if (caseSensitive) {
- display = !VAL_DISPLAY_NONE.equals(displayStr);
- displayBlock = display && !VAL_DISPLAY_INLINE.equals(displayStr);
- } else {
- display = !VAL_DISPLAY_NONE.equalsIgnoreCase(displayStr);
- displayBlock = display && !VAL_DISPLAY_INLINE.equalsIgnoreCase(displayStr);
- }
- }
- }
-
- if (display) {
- div.setAttribute("class", displayBlock ? CLASS_TAG_BLOCK :
CLASS_TAG_INLINE);
-
- String styleStr = "";
- String borderStr = getExprValue(pageContext, borderExpr, sourceNode);
-
- if
("yes".equalsIgnoreCase(VpePreference.SHOW_BORDER_FOR_UNKNOWN_TAGS.getValue()))
{
- styleStr += borderStr.length() > 0 ? "border-width:" + borderStr +
";" : "";
- } else {
- styleStr += "border-width:0px;";
- }
-
- String borderColorStr = getExprValue(pageContext, borderColorExpr, sourceNode);
- styleStr += borderColorStr.length() > 0 ? "border-color:" +
borderColorStr + ";" : "";
- String backgroundColorStr = getExprValue(pageContext, backgroundColorExpr,
sourceNode);
- styleStr += backgroundColorStr.length() > 0 ? "background-color:" +
backgroundColorStr : "";
- if (styleStr.trim().length() > 0) div.setAttribute("style", styleStr);
- } else {
- div.setAttribute("class", CLASS_TAG_NONE);
- }
-
- span.setAttribute("class", CLASS_TAG_CAPTION);
-
- String styleStr = "";
- String valueColorStr = getExprValue(pageContext, valueColorExpr, sourceNode);
- styleStr += valueColorStr.length() > 0 ? "color:" + valueColorStr +
";" : "";
- String valueBackgroundColorStr = getExprValue(pageContext, valueBackgroundColorExpr,
sourceNode);
- styleStr += valueBackgroundColorStr.length() > 0 ? "background-color:" +
valueBackgroundColorStr : "";
- if (styleStr.trim().length() > 0) span.setAttribute("style", styleStr);
- }
-
public VpeAnyData getAnyData() {
return new VpeAnyData(
- displayStr,
tagForDisplayStr,
valueStr,
- borderStr,
- valueColorStr,
- valueBackgroundColorStr,
- backgroundColorStr,
- borderColorStr,
+ styleStr,
showIconBool
);
}
@@ -319,39 +252,39 @@
return value;
}
- public void setAttribute(VpePageContext pageContext, Element sourceElement, Map
visualNodeMap, String name, String value) {
- Object elements = visualNodeMap.get(this);
- if (elements != null && elements instanceof VisualElements) {
- VisualElements o = (VisualElements)elements;
- try {
- setStyles(pageContext, sourceElement, o.div, o.span);
- } catch (VpeExpressionException e) {
- VpeExpressionException exception = new
VpeExpressionException(sourceElement.toString()+" "+name+" "+value,e);
//$NON-NLS-1$ //$NON-NLS-2$
- VpePlugin.reportProblem(exception) ;
- }
- }
- }
+// public void setAttribute(VpePageContext pageContext, Element sourceElement, Map
visualNodeMap, String name, String value) {
+// Object elements = visualNodeMap.get(this);
+// if (elements != null && elements instanceof VisualElements) {
+// VisualElements o = (VisualElements)elements;
+// try {
+// setStyles(pageContext, sourceElement, o.div, o.span);
+// } catch (VpeExpressionException e) {
+// VpeExpressionException exception = new
VpeExpressionException(sourceElement.toString()+" "+name+" "+value,e);
//$NON-NLS-1$ //$NON-NLS-2$
+// VpePlugin.reportProblem(exception) ;
+// }
+// }
+// }
- public void removeAttribute(VpePageContext pageContext, Element sourceElement, Map
visualNodeMap, String name) {
- Object elements = visualNodeMap.get(this);
- if (elements != null && elements instanceof VisualElements) {
- VisualElements o = (VisualElements)elements;
- try {
- setStyles(pageContext, sourceElement, o.div, o.span);
- } catch (VpeExpressionException e) {
- VpeExpressionException exception = new
VpeExpressionException(sourceElement.toString()+" "+name,e); //$NON-NLS-1$
- VpePlugin.reportProblem(exception);
- }
- }
- }
+// public void removeAttribute(VpePageContext pageContext, Element sourceElement, Map
visualNodeMap, String name) {
+// Object elements = visualNodeMap.get(this);
+// if (elements != null && elements instanceof VisualElements) {
+// VisualElements o = (VisualElements)elements;
+// try {
+// setStyles(pageContext, sourceElement, o.div, o.span);
+// } catch (VpeExpressionException e) {
+// VpeExpressionException exception = new
VpeExpressionException(sourceElement.toString()+" "+name,e); //$NON-NLS-1$
+// VpePlugin.reportProblem(exception);
+// }
+// }
+// }
- private class VisualElements {
- private nsIDOMElement div;
- private nsIDOMElement span;
-
- private VisualElements(nsIDOMElement div, nsIDOMElement span) {
- this.div = div;
- this.span = span;
- }
- }
+// private class VisualElements {
+// private nsIDOMElement div;
+// private nsIDOMElement span;
+//
+// private VisualElements(nsIDOMElement div, nsIDOMElement span) {
+// this.div = div;
+// this.span = span;
+// }
+// }
}
\ No newline at end of file
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAnyData.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAnyData.java 2008-09-18
17:12:06 UTC (rev 10363)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAnyData.java 2008-09-18
17:25:53 UTC (rev 10364)
@@ -9,73 +9,49 @@
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.jboss.tools.vpe.editor.template;
-
+/**
+ * Class which store properties for any template
+ *
+ * @author mareshkau
+ *
+ */
public class VpeAnyData extends VpeTemplateData {
private String uri;
private String tagForDisplay;
private boolean showIcon;
-
- private String display;
private String value;
- private String border;
- private String valueColor;
- private String valueBackgroundColor;
- private String backgroundColor;
- private String borderColor;
+ private String style;
-
public VpeAnyData(String name) {
super(name);
}
-
+/**
+ *
+ * @param tagForDisplay
+ * @param value
+ * @param style
+ * @param showIcon
+ */
public VpeAnyData(
- String display,
- String value,
- String border,
- String valueColor,
- String valueBackgroundColor,
- String backgroundColor,
- String borderColor,
- boolean showIcon
- ) {
- this(display,
- null,
- value,
- border,
- valueColor,
- valueBackgroundColor,
- backgroundColor,
- borderColor,
- showIcon);
- }
- public VpeAnyData(
- String display,
String tagForDisplay,
String value,
- String border,
- String valueColor,
- String valueBackgroundColor,
- String backgroundColor,
- String borderColor,
+ String style,
boolean showIcon
) {
- this.display = display;
this.value = value;
- this.border = border;
- this.valueColor = valueColor;
- this.valueBackgroundColor = valueBackgroundColor;
- this.backgroundColor = backgroundColor;
- this.borderColor = borderColor;
this.showIcon = showIcon;
this.tagForDisplay = tagForDisplay;
+ this.style=style;
}
public String getUri() {
+
return uri;
}
public void setUri(String uri) {
+
this.uri = uri;
}
@@ -87,62 +63,38 @@
showIcon = flag;
}
- public String getBackgroundColor() {
- return backgroundColor;
- }
-
- public void setBackgroundColor(String backgroundColor) {
- this.backgroundColor = backgroundColor;
- }
-
- public String getBorder() {
- return border;
- }
-
- public void setBorder(String border) {
- this.border = border;
- }
-
- public String getBorderColor() {
- return borderColor;
- }
-
- public void setBorderColor(String borderColor) {
- this.borderColor = borderColor;
- }
-
- public String getDisplay() {
- return display;
- }
-
- public void setDisplay(String display) {
- this.display = display;
- }
-
public String getValue() {
+
return value;
}
public void setValue(String value) {
+
this.value = value;
}
- public String getValueBackgroundColor() {
- return valueBackgroundColor;
- }
- public void setValueBackgroundColor(String valueBackgroundColor) {
- this.valueBackgroundColor = valueBackgroundColor;
- }
-
- public String getValueColor() {
- return valueColor;
- }
- public void setValueColor(String valueColor) {
- this.valueColor = valueColor;
- }
public String getTagForDisplay() {
- return tagForDisplay;
+
+ return tagForDisplay;
}
+
public void setTagForDisplay(String tagForDisplay) {
- this.tagForDisplay = tagForDisplay;
+
+ this.tagForDisplay = tagForDisplay;
}
+
+ /**
+ * @return the style
+ */
+ public String getStyle() {
+
+ return style;
+ }
+
+ /**
+ * @param style the style to set
+ */
+ public void setStyle(String style) {
+
+ this.style = style;
+ }
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java 2008-09-18
17:12:06 UTC (rev 10363)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java 2008-09-18
17:25:53 UTC (rev 10364)
@@ -10,85 +10,48 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.template;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.ColorDialog;
-import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-
import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.outline.cssdialog.CSSDialog;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
-import org.jboss.tools.jst.jsp.outline.cssdialog.common.ImageCombo;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.MessageUtil;
-import org.jboss.tools.jst.jsp.outline.cssdialog.common.Util;
-import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParser;
import org.jboss.tools.vpe.messages.VpeUIMessages;
-
+/**
+ * Class which presents dialog for any template
+ * @author mareshkau
+ *
+ */
public class VpeEditAnyDialog extends TitleAreaDialog {
+
private VpeAnyData data;
- private CheckControl ctlCaseSensitive;
private CheckControl ctlChildren;
- private CheckControl ctlModify;
- private Combo cbDisplay;
- private Combo cbTagForDisplay;
- private int displayIndexMem;
- private int tagNameItemIndex;
+ private Text txtTagForDisplay;
private Text txtValue;
- private Text txtBorder;
- private ColorControl ctlValueColor;
- private ColorControl ctlValueBackgroundColor;
- private ColorControl ctlBackgroundColor;
- private ColorControl ctlBorderColor;
+ private Text txtStyle;
private CheckControl ctlShowIcon;
- private static String[] displayItems = new String[3];
-
- private static List<String> displayTags = new ArrayList<String>();
-
- static {
- displayItems[0] = VpeAnyCreator.VAL_DISPLAY_BLOCK;
- displayItems[1] = VpeAnyCreator.VAL_DISPLAY_INLINE;
- displayItems[2] = VpeAnyCreator.VAL_DISPLAY_NONE;
- }
- static{
- displayTags.add(VpeUIMessages.TAG_DIV);
- displayTags.add(VpeUIMessages.TAG_SPAN);
- displayTags.add(VpeUIMessages.TAG_B);
- displayTags.add(VpeUIMessages.TAG_P);
- displayTags.add(VpeUIMessages.TAG_TABLE);
- }
-
-
-
public VpeEditAnyDialog(Shell shell, VpeAnyData data) {
super(shell);
this.data = data;
}
+ @Override
protected Control createDialogArea(Composite parent) {
getShell().setText(VpeUIMessages.TEMPLATE);
setTitle(VpeUIMessages.TAG_ATTRIBUTES);
@@ -97,7 +60,7 @@
Composite topComposite = (Composite)super.createDialogArea(parent);
((GridData)topComposite.getLayoutData()).widthHint = 300;
- Composite composite = new Composite(topComposite, SWT.NONE);
+ final Composite composite = new Composite(topComposite, SWT.NONE);
GridLayout gridLayout = new GridLayout(3, false);
gridLayout.marginWidth = 50;
gridLayout.marginHeight = 20;
@@ -114,37 +77,20 @@
Label tagFDisplayLabel = makeLabel(composite, VpeUIMessages.TAG_FOR_DISPLAY);
tagFDisplayLabel.setLayoutData(new
GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- cbTagForDisplay = new Combo(composite,SWT.DROP_DOWN | SWT.READ_ONLY);
+ txtTagForDisplay = new Text(composite,SWT.BORDER);
gd.horizontalSpan=2;
- cbTagForDisplay.setLayoutData(gd);
- cbTagForDisplay.setItems(displayTags.toArray(new String[displayTags.size()]));
- tagNameItemIndex = displayTags.indexOf(data.getTagForDisplay());
- if(tagNameItemIndex==-1) {
- tagNameItemIndex=0;
- }
- cbTagForDisplay.select(tagNameItemIndex);
+ txtTagForDisplay.setLayoutData(gd);
+ txtTagForDisplay.setText(data.getTagForDisplay() != null ?
data.getTagForDisplay() : ""); //$NON-NLS-1$
+// txtTagForDisplay.select(tagNameItemIndex);
// ctlCaseSensitive = new CheckControl(composite, "Case sensitive",
data.isCaseSensitive());
ctlChildren = new CheckControl(composite, VpeUIMessages.CHILDREN, data.isChildren());
// ctlModify = new CheckControl(composite, "Modify", data.isModify());
-
-
-
- gd = new GridData(GridData.FILL_HORIZONTAL);
- Label lblDisplay = makeLabel(composite, VpeUIMessages.DISPLAY);
- lblDisplay.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- cbDisplay = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
-
- gd.horizontalSpan = 2;
- cbDisplay.setLayoutData(gd);
- cbDisplay.setItems(displayItems);
- displayIndexMem = getDisplayItemIndex(data.getDisplay());
- cbDisplay.select(displayIndexMem);
-
ctlShowIcon = new CheckControl(composite, VpeUIMessages.ICON, data.isShowIcon());
-
+
+ //value control
Label lblValue = makeLabel(composite, VpeUIMessages.VALUE);
lblValue.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
txtValue = new Text(composite, SWT.BORDER);
@@ -153,20 +99,40 @@
txtValue.setLayoutData(gd);
txtValue.setText(data.getValue() != null ? data.getValue() : "");
//$NON-NLS-1$
- ctlValueColor = new ColorControl(composite, VpeUIMessages.VALUE_COLOR,
data.getValueColor());
- ctlValueBackgroundColor = new ColorControl(composite,
VpeUIMessages.VALUE_BACKGROUND_COLOR, data.getValueBackgroundColor());
- ctlBackgroundColor = new ColorControl(composite, VpeUIMessages.BACKGROUND_COLOR,
data.getBackgroundColor());
-
- Label lblBorder = makeLabel(composite, VpeUIMessages.BORDER);
- lblBorder.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- txtBorder = new Text(composite, SWT.BORDER);
+ //style control
+ Label lbStyle = makeLabel(composite, VpeUIMessages.STYLE);
+ lbStyle.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
+ txtStyle = new Text(composite, SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- txtBorder.setLayoutData(gd);
- txtBorder.setText(data.getBorder() != null ? data.getBorder() : "");
//$NON-NLS-1$
+ gd.horizontalSpan = 1;
+ gd.grabExcessHorizontalSpace = true;
+ txtStyle.setLayoutData(gd);
+ txtStyle.setText(data.getStyle() !=null ? data.getStyle() : "");
//$NON-NLS-1$
+
+ Button button = new Button(composite, SWT.PUSH);
+ button.setLayoutData(new GridData());
+ button.setToolTipText(MessageUtil.getString("BACKGROUND_COLOR_TIP"));
//$NON-NLS-1$
+ ImageDescriptor colorDesc = JspEditorPlugin
+ .getImageDescriptor(Constants.IMAGE_COLORLARGE_FILE_LOCATION);
+ Image im = colorDesc.createImage();
+ button.setImage(im);
+
+ button.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ Button button = (Button) e.getSource();
+ button.getImage().dispose();
+ }
+ });
+ button.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ CSSDialog cssDialog = new CSSDialog(composite.getShell(),txtStyle.getText());
+ if (cssDialog.open() == Window.OK) {
+ txtStyle.setText(cssDialog.getNewStyle());
+ }
+ }
+ });
- ctlBorderColor = new ColorControl(composite, VpeUIMessages.BORDER_COLOR,
data.getBorderColor());
-
return composite;
}
@@ -177,60 +143,24 @@
return lbl;
}
- private int getDisplayItemIndex(String text) {
- int index = 0;
- if (text != null) {
- for (int i = 0; i < displayItems.length; i++) {
- if ((data.isCaseSensitive() && text.equals(displayItems[i])) ||
- (!data.isCaseSensitive() && text.equalsIgnoreCase(displayItems[i]))) {
- index = i;
- break;
- }
- }
- }
- return index;
- }
-
+ @Override
protected void okPressed() {
-// data.setChanged(data.isChanged() || (data.isCaseSensitive() ==
ctlCaseSensitive.getSelection()));
-// data.setCaseSensitive(ctlCaseSensitive.getSelection());
data.setChanged(data.isChanged() || (data.isChildren() !=
ctlChildren.getSelection()));
data.setChildren(ctlChildren.getSelection());
-// data.setChanged(data.isChanged() || (data.isModify() ==
ctlChildren.getSelection()));
-// data.setModify(ctlModify.getSelection());
-
- int index = cbDisplay.getSelectionIndex();
- String display = (index >= 1 && index<= 2) ? displayItems[index] :
""; //$NON-NLS-1$
- if (displayIndexMem != index) {
- data.setChanged(true);
- data.setDisplay(display);
- }
- if(tagNameItemIndex!=cbTagForDisplay.getSelectionIndex()) {
- data.setChanged(true);
- data.setTagForDisplay(displayTags.get(cbTagForDisplay.getSelectionIndex()));
- }
+ data.setChanged(isChanged(data,data.getTagForDisplay(),txtTagForDisplay.getText()));
+ data.setTagForDisplay(txtTagForDisplay.getText().trim());
+
data.setChanged(isChanged(data, data.getValue(), txtValue.getText()));
data.setValue(txtValue.getText().trim());
- data.setChanged(isChanged(data, data.getValueColor(), ctlValueColor.getText()));
- data.setValueColor(ctlValueColor.getText());
-
- data.setChanged(isChanged(data, data.getValueBackgroundColor(),
ctlValueBackgroundColor.getText()));
- data.setValueBackgroundColor(ctlValueBackgroundColor.getText());
-
- data.setChanged(isChanged(data, data.getBackgroundColor(),
ctlBackgroundColor.getText()));
- data.setBackgroundColor(ctlBackgroundColor.getText());
-
- data.setChanged(isChanged(data, data.getBorder(), txtBorder.getText()));
- data.setBorder(txtBorder.getText().trim());
-
- data.setChanged(isChanged(data, data.getBorderColor(), ctlBorderColor.getText()));
- data.setBorderColor(ctlBorderColor.getText());
-
data.setChanged(isChanged(data, data.isShowIcon(), ctlShowIcon.getSelection()));
data.setShowIcon(ctlShowIcon.getSelection());
+
+ data.setChanged(isChanged(data, data.getStyle(), txtStyle.getText()));
+ data.setStyle(txtStyle.getText());
+
super.okPressed();
}
@@ -250,7 +180,7 @@
return data.isChanged() || (oldValue != newValue);
}
- public class CheckControl {
+ private class CheckControl {
private Label label;
private Button button;
@@ -274,67 +204,4 @@
return button.getSelection();
}
}
-
- public class ColorControl {
- private Composite parent;
- private Label label;
- private ImageCombo colorCombo;
-
- public ColorControl(Composite parent, String labelText, String value) {
- label = new Label(parent, SWT.NONE);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- label.setText(labelText);
- colorCombo = new ImageCombo(parent, SWT.BORDER);
- GridData gd =new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.grabExcessHorizontalSpace =true;
- colorCombo.setLayoutData(gd);
- colorCombo.setText(value != null ? value : ""); //$NON-NLS-1$
-
- Set<Entry<String, String>> set = ColorParser.getInstance().getMap()
- .entrySet();
-
- for (Map.Entry<String, String> me : set) {
- RGB rgb = Util.getColor(me.getKey());
- colorCombo.add(me.getValue(), rgb);
- }
- Button button = new Button(parent, SWT.PUSH);
- button.setLayoutData(new GridData());
- button.setToolTipText(MessageUtil.getString("BACKGROUND_COLOR_TIP"));
//$NON-NLS-1$
- ImageDescriptor colorDesc = JspEditorPlugin
- .getImageDescriptor(Constants.IMAGE_COLORLARGE_FILE_LOCATION);
- Image im = colorDesc.createImage();
- button.setImage(im);
- button.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- Button button = (Button) e.getSource();
- button.getImage().dispose();
- }
- });
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- ColorDialog dlg = new ColorDialog(getShell());
-
- dlg
- .setRGB(Util.getColor((colorCombo.getText().trim())) == null ? new RGB(
- 0, 0, 0)
- : Util.getColor((colorCombo.getText().trim())));
- dlg.setText(MessageUtil.getString("COLOR_DIALOG_TITLE")); //$NON-NLS-1$
- RGB rgb = dlg.open();
- if (rgb != null) {
- String colorStr = Util.createColorString(rgb);
- colorCombo.setText(colorStr);
- }
- }
- });
- }
-
- public void selectColor(Shell shell) {
- ColorDialog dialog = new ColorDialog(shell);
- dialog.open();
- }
-
- public String getText() {
- return colorCombo.getText().trim();
- }
- }
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-09-18
17:12:06 UTC (rev 10363)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-09-18
17:25:53 UTC (rev 10364)
@@ -31,7 +31,6 @@
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.textformating.TextFormatingData;
-import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.editor.util.XmlUtil;
import org.osgi.framework.Bundle;
@@ -182,16 +181,36 @@
"title", //$NON-NLS-1$
"dir" //$NON-NLS-1$
};
-
- static final String ATTR_ANY_DISPLAY = "display"; //$NON-NLS-1$
+ @Deprecated
+ //used just for conversion old configuration to new configuration
+ //should be deleted from some time
+ private static final String ATTR_ANY_DISPLAY = "display"; //$NON-NLS-1$
+
static final String ATTR_ANY_TAG_FOR_DISPLAY="tag-for-display"; //$NON-NLS-1$
static final String ATTR_ANY_ICON = "icon"; //$NON-NLS-1$
static final String ATTR_ANY_VALUE = "value"; //$NON-NLS-1$
- static final String ATTR_ANY_BORDER = "border"; //$NON-NLS-1$
- static final String ATTR_ANY_VALUE_COLOR = "value-color"; //$NON-NLS-1$
- static final String ATTR_ANY_VALUE_BACKGROUND_COLOR =
"value-background-color"; //$NON-NLS-1$
- static final String ATTR_ANY_BACKGROUND_COLOR = "background-color";
//$NON-NLS-1$
- static final String ATTR_ANY_BORDER_COLOR = "border-color"; //$NON-NLS-1$
+ static final String ATTR_ANY_STYLE = "style"; //$NON-NLS-1$
+ @Deprecated
+ //used just for conversion old configuration to new configuration
+ //should be deleted from some time
+ private static final String ATTR_ANY_BORDER = "border"; //$NON-NLS-1$
+ @Deprecated
+ //used just for conversion old configuration to new configuration
+ //should be deleted from some time
+ private static final String ATTR_ANY_VALUE_COLOR = "value-color";
//$NON-NLS-1$
+ @Deprecated
+ //used just for conversion old configuration to new configuration
+ //should be deleted from some time
+ private static final String ATTR_ANY_VALUE_BACKGROUND_COLOR =
"value-background-color"; //$NON-NLS-1$
+ @Deprecated
+ //used just for conversion old configuration to new configuration
+ //should be deleted from some time
+ private static final String ATTR_ANY_BACKGROUND_COLOR = "background-color";
//$NON-NLS-1$
+ @Deprecated
+ //used just for conversion old configuration to new configuration
+ //should be deleted from some time
+ private static final String ATTR_ANY_BORDER_COLOR = "border-color";
//$NON-NLS-1$
+
static final String[] ATTR_ANY_PROPERTIES = {"title"}; //$NON-NLS-1$
static final String ATTR_DATATABLE_HEADER_CLASS = "headerClass";
//$NON-NLS-1$
@@ -238,6 +257,8 @@
//comment template name
private static final String COMMENT_TEMPLATE_NAME="#comment"; //$NON-NLS-1$
+ private static final String ATTRIBUTE_TEMPLATE_NAME="attribute";
//$NON-NLS-1$
+
/**
* added by Max Areshkau, JBIDE-1494
* Contains default text formating data
@@ -328,6 +349,9 @@
return COMMENT_TEMPLATE_NAME;
+ case Node.ATTRIBUTE_NODE:
+
+ return ATTRIBUTE_TEMPLATE_NAME;
case Node.ELEMENT_NODE:
String sourcePrefix = sourceNode.getPrefix();
@@ -613,10 +637,10 @@
anyData.setChildren(ATTR_VALUE_YES.equalsIgnoreCase(attr.getNodeValue()));
}
- attr = anyNode.getAttributeNode(ATTR_ANY_DISPLAY);
- if (attr != null) {
- anyData.setDisplay(attr.getNodeValue());
- }
+// attr = anyNode.getAttributeNode(ATTR_ANY_DISPLAY);
+// if (attr != null) {
+// anyData.setDisplay(attr.getNodeValue());
+// }
attr = anyNode.getAttributeNode(ATTR_ANY_ICON);
if (attr != null){
@@ -627,31 +651,36 @@
if (attr != null) {
anyData.setValue(attr.getNodeValue());
}
-
- attr = anyNode.getAttributeNode(ATTR_ANY_BORDER);
- if (attr != null) {
- anyData.setBorder(attr.getNodeValue());
+
+ attr = anyNode.getAttributeNode(ATTR_ANY_STYLE);
+ if (attr !=null) {
+ anyData.setValue(attr.getNodeValue());
}
- attr = anyNode.getAttributeNode(ATTR_ANY_VALUE_COLOR);
- if (attr != null) {
- anyData.setValueColor(attr.getNodeValue());
- }
-
- attr = anyNode.getAttributeNode(ATTR_ANY_VALUE_BACKGROUND_COLOR);
- if (attr != null) {
- anyData.setValueBackgroundColor(attr.getNodeValue());
- }
-
- attr = anyNode.getAttributeNode(ATTR_ANY_BACKGROUND_COLOR);
- if (attr != null) {
- anyData.setBackgroundColor(attr.getNodeValue());
- }
-
- attr = anyNode.getAttributeNode(ATTR_ANY_BORDER_COLOR);
- if (attr != null) {
- anyData.setBorderColor(attr.getNodeValue());
- }
+// attr = anyNode.getAttributeNode(ATTR_ANY_BORDER);
+// if (attr != null) {
+// anyData.setBorder(attr.getNodeValue());
+// }
+//
+// attr = anyNode.getAttributeNode(ATTR_ANY_VALUE_COLOR);
+// if (attr != null) {
+// anyData.setValueColor(attr.getNodeValue());
+// }
+//
+// attr = anyNode.getAttributeNode(ATTR_ANY_VALUE_BACKGROUND_COLOR);
+// if (attr != null) {
+// anyData.setValueBackgroundColor(attr.getNodeValue());
+// }
+//
+// attr = anyNode.getAttributeNode(ATTR_ANY_BACKGROUND_COLOR);
+// if (attr != null) {
+// anyData.setBackgroundColor(attr.getNodeValue());
+// }
+//
+// attr = anyNode.getAttributeNode(ATTR_ANY_BORDER_COLOR);
+// if (attr != null) {
+// anyData.setBorderColor(attr.getNodeValue());
+// }
}
}
@@ -738,20 +767,22 @@
if(data.getTagForDisplay()!=null&& data.getTagForDisplay().length() > 0)
newAnyElement.setAttribute(ATTR_ANY_TAG_FOR_DISPLAY, data.getTagForDisplay());
- if (data.getDisplay() != null && data.getDisplay().length() > 0)
- newAnyElement.setAttribute(ATTR_ANY_DISPLAY, data.getDisplay());
+// if (data.getDisplay() != null && data.getDisplay().length() > 0)
+// newAnyElement.setAttribute(ATTR_ANY_DISPLAY, data.getDisplay());
if (data.getValue() != null && data.getValue().length() > 0)
newAnyElement.setAttribute(ATTR_ANY_VALUE, data.getValue());
- if (data.getBorder() != null && data.getBorder().length() > 0)
- newAnyElement.setAttribute(ATTR_ANY_BORDER, data.getBorder());
- if (data.getValueColor() != null && data.getValueColor().length() > 0)
- newAnyElement.setAttribute(ATTR_ANY_VALUE_COLOR, data.getValueColor());
- if (data.getValueBackgroundColor() != null &&
data.getValueBackgroundColor().length() > 0)
- newAnyElement.setAttribute(ATTR_ANY_VALUE_BACKGROUND_COLOR,
data.getValueBackgroundColor());
- if (data.getBackgroundColor() != null && data.getBackgroundColor().length()
> 0)
- newAnyElement.setAttribute(ATTR_ANY_BACKGROUND_COLOR, data.getBackgroundColor());
- if (data.getBorderColor() != null && data.getBorderColor().length() > 0)
- newAnyElement.setAttribute(ATTR_ANY_BORDER_COLOR, data.getBorderColor());
+ if(data.getStyle()!=null && data.getStyle().length()>0)
+ newAnyElement.setAttribute(ATTR_ANY_STYLE, data.getStyle());
+// if (data.getBorder() != null && data.getBorder().length() > 0)
+// newAnyElement.setAttribute(ATTR_ANY_BORDER, data.getBorder());
+// if (data.getValueColor() != null && data.getValueColor().length() > 0)
+// newAnyElement.setAttribute(ATTR_ANY_VALUE_COLOR, data.getValueColor());
+// if (data.getValueBackgroundColor() != null &&
data.getValueBackgroundColor().length() > 0)
+// newAnyElement.setAttribute(ATTR_ANY_VALUE_BACKGROUND_COLOR,
data.getValueBackgroundColor());
+// if (data.getBackgroundColor() != null && data.getBackgroundColor().length()
> 0)
+// newAnyElement.setAttribute(ATTR_ANY_BACKGROUND_COLOR, data.getBackgroundColor());
+// if (data.getBorderColor() != null && data.getBorderColor().length() > 0)
+// newAnyElement.setAttribute(ATTR_ANY_BORDER_COLOR, data.getBorderColor());
newAnyElement.setAttribute(ATTR_ANY_ICON, data.isShowIcon() ? ATTR_VALUE_YES :
ATTR_VALUE_NO);
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2008-09-18
17:12:06 UTC (rev 10363)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2008-09-18
17:25:53 UTC (rev 10364)
@@ -99,13 +99,5 @@
public static String SHOW;
public static String HIDE;
public static String TAG_FOR_DISPLAY;
-
- public static String TAG_B;
- public static String TAG_TABLE;
- public static String TAG_P;
- public static String TAG_A;
- public static String TAG_DIV;
- public static String TAG_SPAN;
-
-
+ public static String STYLE;
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2008-09-18
17:12:06 UTC (rev 10363)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2008-09-18
17:25:53 UTC (rev 10364)
@@ -60,10 +60,5 @@
SHOW=Show
HIDE=Hide
TAG_FOR_DISPLAY=Tag for Display
-TAG_B=B
-TAG_TABLE=TABLE
-TAG_P=P
-TAG_A=A
-TAG_DIV=DIV
-TAG_SPAN=SPAN
+STYLE=Style
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/ve/init.html
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/ve/init.html 2008-09-18 17:12:06 UTC (rev
10363)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/ve/init.html 2008-09-18 17:25:53 UTC (rev
10364)
@@ -16,6 +16,7 @@
padding: 2px 1px 1px 1px;
}
.__any__tag__caption {
+ border: 1px solid black;
color:#006727;
font-size: 12px;
padding: 0px 2px 0px 2px;
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/template/VpeTemplateManagerTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/template/VpeTemplateManagerTest.java 2008-09-18
17:12:06 UTC (rev 10363)
+++
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/template/VpeTemplateManagerTest.java 2008-09-18
17:25:53 UTC (rev 10364)
@@ -12,11 +12,7 @@
VpeAnyData data = new VpeAnyData(
"tag-name1",
"tag-value",
- "yes",
- "red",
- "green",
- "blue",
- "white",
+ "color:red",
true
);
@@ -25,11 +21,7 @@
data = new VpeAnyData(
"tag-name2",
"tag-value",
- "yes",
- "red",
- "green",
- "blue",
- "white",
+ "color:white",
true
);