Author: estherbin
Date: 2008-07-28 11:46:34 -0400 (Mon, 28 Jul 2008)
New Revision: 9368
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/inplaceSelect.css
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/RichFacesFileUploadTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java
Log:
Fix bugs
https://jira.jboss.org/jira/browse/JBIDE-2564
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/inplaceSelect.css
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/inplaceSelect.css 2008-07-28
15:33:48 UTC (rev 9367)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/inplaceSelect.css 2008-07-28
15:46:34 UTC (rev 9368)
@@ -183,4 +183,8 @@
background-color: #E3DED5;
background-image: url(button_bg.gif);
border-color: #C4C0B9;
+}
+
+.rich-inplace-select-list-scroll {
+ overflow: auto;
}
\ No newline at end of file
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-28
15:33:48 UTC (rev 9367)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java 2008-07-28
15:46:34 UTC (rev 9368)
@@ -124,8 +124,8 @@
protected String sourceApplyButtonIcon;
protected String sourceLayout;
-
-
+
+
/**
* The Constructor.
*/
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesFileUploadTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesFileUploadTemplate.java 2008-07-28
15:33:48 UTC (rev 9367)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesFileUploadTemplate.java 2008-07-28
15:46:34 UTC (rev 9368)
@@ -12,6 +12,7 @@
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
+import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
@@ -51,6 +52,10 @@
/** The list width. */
private String listWidth;
+
+ private String uploadControlLabel;
+
+ private String uploadControlClass;
/**
* The Constructor.
@@ -97,6 +102,8 @@
final nsIDOMElement labelDiv = visualDocument.createElement(HTML.TAG_DIV);
labelDiv.setAttribute(HTML.ATTR_CLASS,
defaultStyleClasses.get("addButtonClassDiv2"));
+ labelDiv.appendChild(visualDocument.createTextNode(this.addControlLabel));
+ fileuploadButtonDiv.appendChild(labelDiv);
rootDiv.appendChild(table);
rootDiv.appendChild(createPanelDiv(pageContext, source, visualDocument));
@@ -104,11 +111,10 @@
tr.appendChild(td);
td.appendChild(buttonBorderDiv);
buttonBorderDiv.appendChild(fileuploadButtonDiv);
- fileuploadButtonDiv.appendChild(labelDiv);
- labelDiv.appendChild(visualDocument.createTextNode(this.addControlLabel));
+
-// DOMTreeDumper dumper = new DOMTreeDumper();
-// dumper.dumpToStream(System.err, rootDiv);
+ DOMTreeDumper dumper = new DOMTreeDumper();
+ dumper.dumpToStream(System.err, rootDiv);
data = new VpeCreationData(rootDiv);
return data;
@@ -196,6 +202,10 @@
if (ComponentUtil.isNotBlank(uploadListClass)) {
defaultStyleClasses.put("uploadListClass",
defaultStyleClasses.get("uploadListClass") + " " + uploadListClass);
}
+
+ this.uploadControlClass = ComponentUtil.getAttribute(sourceElement,
"uploadControlClass");
+ this.uploadControlLabel = ComponentUtil.getAttribute(sourceElement,
"uploadControlLabel");
+
}
}
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-28
15:33:48 UTC (rev 9367)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java 2008-07-28
15:46:34 UTC (rev 9368)
@@ -20,6 +20,7 @@
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
@@ -33,6 +34,8 @@
*/
public class RichFacesInplaceSelectTemplate extends RichFacesAbstractInplaceTemplate {
+ private static final String _24PX = "24px";
+
/** The Constant INPLACE_SELECT_CSS. */
private static final String INPLACE_SELECT_CSS =
"inplaceSelect/inplaceSelect.css";
@@ -41,6 +44,10 @@
/** The select width. */
private String selectWidth;
+
+ protected String sourceListHeight;
+
+ protected String sourceListWidth;
/**
* Create.
@@ -93,8 +100,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;
}
@@ -157,14 +164,18 @@
// added by estherbin
// fix
http://jira.jboss.com/jira/browse/JBIDE-2196
// tramanovich comment.
- int height = 72;
- if ((elements != null) && (elements.size() > 3)) {
- height += ((elements.size() - 4) * 24);
+ if (this.sourceListHeight == _24PX) {
+ int height = 24;
+
+ if ((elements != null) && (elements.size() > 1)) {
+ height += ((elements.size() - 2) * 24)+1;
+ }
+ this.sourceListHeight = String.valueOf(height) +
String.valueOf("px");
}
listScrollDiv.setAttribute(HTML.ATTR_CLASS,
"rich-inplace-select-list-scroll");
- listScrollDiv.setAttribute(HTML.ATTR_STYLE, "height:"+height+"px;
width: 151px;");
+ listScrollDiv.setAttribute(HTML.ATTR_STYLE, "height:" +
this.sourceListHeight + "; width: " + this.sourceListWidth);
if (elements.size() > 0) {
for (Element e : elements) {
@@ -291,6 +302,18 @@
*/
@Override
protected void prepareData(VpePageContext pageContext,Element source) {
+
+ this.sourceListHeight =
ComponentUtil.getAttribute(source,"listHeight");
+ this.sourceListWidth = ComponentUtil.getAttribute(source,
"listWidth");
+
+ if (ComponentUtil.isBlank(this.sourceListHeight)) {
+ this.sourceListHeight = _24PX;
+ }
+
+ if (ComponentUtil.isBlank(this.sourceListWidth)) {
+ this.sourceListWidth = String.valueOf("198px");
+ }
+
super.prepareData(pageContext,source);
}