Author: estherbin
Date: 2008-07-08 13:25:32 -0400 (Tue, 08 Jul 2008)
New Revision: 9097
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java
Log:
Fix
bug:http://jira.jboss.com/jira/browse/JBIDE-2464
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java 2008-07-08
16:14:12 UTC (rev 9096)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java 2008-07-08
17:25:32 UTC (rev 9097)
@@ -82,6 +82,8 @@
/** The Constant VPE_USER_TOGGLE_ID_ATTR. */
public static final String VPE_USER_TOGGLE_ID_ATTR = "vpe-user-toggle-id";
+ private static final String DEFAULT_LAYOUT = "inline";
+
/** The button images. */
protected final Map<String, String> buttonImages = new HashMap<String,
String>();
@@ -117,6 +119,13 @@
/** The view class. */
protected String viewClass;
+
+ protected String sourceCancelButtonIcon;
+
+ protected String sourceApplyButtonIcon;
+
+ protected String sourceLayout;
+
/**
* The Constructor.
@@ -149,7 +158,7 @@
if (this.isToggle) {
style = "position: relative;";
}
- rootSpan.setAttribute(HTML.ATTR_STYLE, style);
+ rootSpan.setAttribute(HTML.ATTR_STYLE, style + ";
display:"+this.sourceLayout+"; ");
return rootSpan;
}
@@ -287,6 +296,11 @@
this.editClass = source.getAttribute("editClass");
this.viewClass = source.getAttribute("viewClass");
this.sourceValue = source.getAttribute(RichFaces.ATTR_VALUE);
+ this.sourceLayout = ComponentUtil.getAttribute(source, "layout");
+ if(ComponentUtil.isBlank(this.sourceLayout) ||
(!this.sourceLayout.equalsIgnoreCase(DEFAULT_LAYOUT) &&
+ !this.sourceLayout.equalsIgnoreCase("block")) ){
+ this.sourceLayout = DEFAULT_LAYOUT;
+ }
this.defaultLabel = source.getAttribute("defaultLabel");
if (ComponentUtil.isBlank(this.sourceValue)) {
this.sourceValue = DEFAULT_NULL_VALUE;
@@ -303,7 +317,7 @@
|| !isInKeySet(controlsHorizontalPositions,
this.controlsHorizontalPosition)) {
this.controlsHorizontalPosition =
CONTROLS_HORIZONTAL_POSITION_DEFAULT_VALUE;
}
-
+
prepareImages(source);
}
@@ -316,11 +330,11 @@
protected void prepareImages(Element source) {
for (String key : defaultButtonImages.keySet()) {
String value = ComponentUtil.getAttribute(source, key);
- // if (ComponentUtil.isNotBlank(value)) {
- // this.buttonImages.put(key, value);
- // } else {
- this.buttonImages.put(key, defaultButtonImages.get(key));
- // }
+ if(ComponentUtil.isNotBlank(value)){
+ this.buttonImages.put(key, value);
+ }else{
+ this.buttonImages.put(key, defaultButtonImages.get(key));
+ }
}
}
@@ -464,7 +478,12 @@
applyButtonImg.setAttribute(HTML.ATTR_TYPE, "image");
applyButtonImg.setAttribute(HTML.ATTR_CLASS,
"rich-inplace"+getCssStylesSuffix()+"-control");
- ComponentUtil.setImg(applyButtonImg,
buttonImages.get("saveControlIcon"));
+ final String saveControlIconImg = buttonImages.get("saveControlIcon");
+ if(defaultButtonImages.containsValue(saveControlIconImg)){
+ ComponentUtil.setImg(applyButtonImg, saveControlIconImg);
+ }else{
+ ComponentUtil.setImgFromResources(pageContext, applyButtonImg,
saveControlIconImg,"");
+ }
applyButtonImg.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
final nsIDOMElement cancelButtonImg =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
@@ -472,8 +491,13 @@
cancelButtonImg.setAttribute(HTML.ATTR_TYPE, "image");
cancelButtonImg.setAttribute(HTML.ATTR_CLASS,
"rich-inplace"+getCssStylesSuffix()+"-control");
cancelButtonImg.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
- ComponentUtil.setImg(cancelButtonImg,
buttonImages.get("cancelControlIcon"));
+ final String cancelControlIconImg =
buttonImages.get("cancelControlIcon");
+ if(defaultButtonImages.containsValue(cancelControlIconImg)){
+ ComponentUtil.setImg(cancelButtonImg,cancelControlIconImg);
+ }else{
+ ComponentUtil.setImgFromResources(pageContext, cancelButtonImg,
saveControlIconImg, "");
+ }
cancelButtonImg.setAttribute(HTML.ATTR_TYPE, "image");
element.appendChild(divShadov);
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java 2008-07-08
16:14:12 UTC (rev 9096)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java 2008-07-08
17:25:32 UTC (rev 9097)
@@ -78,24 +78,28 @@
innerInput1.setAttribute(HTML.ATTR_TYPE, "button");
}
data = new VpeCreationData(rootSpan);
- final DOMTreeDumper dumper = new DOMTreeDumper();
+
if (!isToggle) {
final String value = getValue();
-
- if (value.equals(DEFAULT_NULL_VALUE)) {
- final nsIDOMElement pre =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
-
- pre.appendChild(visualDocument.createTextNode("aaaa"));
- pre.setAttribute(HTML.ATTR_STYLE,"width:100px;");
- rootSpan.appendChild(pre);
- } else {
+//
+// if (value.equals(DEFAULT_NULL_VALUE)) {
+// final nsIDOMElement innerSpan =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_SPAN);
+// rootSpan.appendChild(innerSpan);
+// innerSpan.appendChild(visualDocument.createTextNode(value));
+// innerSpan.setAttribute(HTML.ATTR_STYLE, "display: none");
+// inner
+// innerSpan.setAttribute(VPE_USER_TOGGLE_ID_ATTR,
String.valueOf(this.isToggle));
+//// rootSpan.appendChild(visualDocument.createTextNode(value));
+//// rootSpan.setAttribute(HTML.ATTR_STYLE,
rootSpan.getAttribute(HTML.ATTR_STYLE) +" ; display:none");
+// } else {
rootSpan.appendChild(visualDocument.createTextNode(value));
- }
+ // }
} else {
innerInput1.setAttribute(HTML.ATTR_VALUE, this.sourceValue);
}
- dumper.dumpToStream(System.err, rootSpan);
+// final DOMTreeDumper dumper = new DOMTreeDumper();
+// dumper.dumpToStream(System.err, rootSpan);
return data;
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java 2008-07-08
16:14:12 UTC (rev 9096)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java 2008-07-08
17:25:32 UTC (rev 9097)
@@ -94,8 +94,8 @@
rootSpan.appendChild(visualDocument.createTextNode(getValue()));
}
data = new VpeCreationData(rootSpan);
- DOMTreeDumper d = new DOMTreeDumper();
- d.dumpToStream(System.err, rootSpan);
+// DOMTreeDumper d = new DOMTreeDumper();
+// d.dumpToStream(System.err, rootSpan);
return data;
}