Author: abelevich
Date: 2011-01-19 08:23:47 -0500 (Wed, 19 Jan 2011)
New Revision: 21080
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPopupPanel.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
trunk/ui/output/ui/src/main/templates/popupPanel.template.xml
Log:
REVERT changes from RF-10097 Inline default values: output components I
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPopupPanel.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPopupPanel.java 2011-01-19
12:39:22 UTC (rev 21079)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPopupPanel.java 2011-01-19
13:23:47 UTC (rev 21080)
@@ -44,34 +44,34 @@
@Attribute
public abstract String getVisualOptions();
- @Attribute
+ @Attribute(defaultValue = "100")
public abstract int getZindex();
- @Attribute
+ @Attribute(defaultValue = "-1")
public abstract int getHeight();
- @Attribute
+ @Attribute(defaultValue = "-1")
public abstract int getWidth();
- @Attribute(defaultValue = "0")
+ @Attribute(defaultValue = "-1")
public abstract int getMinHeight();
- @Attribute(defaultValue = "0")
+ @Attribute(defaultValue = "-1")
public abstract int getMinWidth();
- @Attribute(defaultValue = "0")
+ @Attribute(defaultValue = "" + Integer.MAX_VALUE)
public abstract int getMaxHeight();
- @Attribute(defaultValue = "0")
+ @Attribute(defaultValue = "" + Integer.MAX_VALUE)
public abstract int getMaxWidth();
- @Attribute
+ @Attribute(defaultValue = "auto")
public abstract String getTop();
- @Attribute
+ @Attribute(defaultValue = "auto")
public abstract String getLeft();
- @Attribute
+ @Attribute(defaultValue = "false")
public abstract boolean isShow();
public abstract void setShow(boolean show);
@@ -79,22 +79,22 @@
@Attribute(defaultValue = "true")
public abstract boolean isMoveable();
- @Attribute
+ @Attribute(defaultValue = "false")
public abstract boolean isAutosized();
@Attribute(defaultValue = "true")
public abstract boolean isModal();
- @Attribute
+ @Attribute(defaultValue = "false")
public abstract boolean isKeepVisualState();
- @Attribute
+ @Attribute(defaultValue = "false")
public abstract boolean isOverlapEmbedObjects();
- @Attribute
+ @Attribute(defaultValue = "false")
public abstract boolean isResizeable();
- @Attribute
+ @Attribute(defaultValue = "false")
public abstract boolean isTrimOverlayedElements();
@Attribute
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2011-01-19
12:39:22 UTC (rev 21079)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2011-01-19
13:23:47 UTC (rev 21080)
@@ -37,9 +37,6 @@
private static final int SIZE = 10;
private static final String STATE_OPTION_SUFFIX = "StateOption_";
- private static final String DEFAULT_PROPERTY_LEFT = "auto";
- private static final String DEFAULT_PROPERTY_TOP = "auto";
-
//TODO nick - use enums
private static final Set<String> ALLOWED_ATTACHMENT_OPTIONS = new
HashSet<String>();
static {
@@ -113,16 +110,18 @@
}
}
- if (panel.getMinWidth() != 0) {
- if (panel.getMinWidth() < SIZE) {
- throw new FacesException("Attribbute minHeight should be greater
then 10px");
+ if (panel.getMinHeight() != -1) {
+ if (panel.getMinHeight() < SIZE) {
+ throw new FacesException("Attribbute minWidth should be greater then
10px");
}
+
}
- if (panel.getMinHeight() != 0) {
- if (panel.getMinHeight() < SIZE) {
- throw new FacesException("Attribbute minWidth should be greater then
10px");
+ if (panel.getMinWidth() != -1) {
+ if (panel.getMinWidth() < SIZE) {
+ throw new FacesException("Attribbute minHeight should be greater
then 10px");
}
+
}
}
@@ -186,6 +185,8 @@
return result;
}
+
+
private Map<String, Object> prepareVisualOptions(Object value,
AbstractPopupPanel panel) {
if (null == value) {
return new HashMap<String, Object>();
@@ -206,20 +207,4 @@
+ "] must be instance of Map or String, but its type is " +
value.getClass().getSimpleName());
}
}
-
- protected String getLeftOrDefault(UIComponent component) {
- String leftProperty = ((AbstractPopupPanel) component).getLeft();
- if (leftProperty == null || leftProperty.length() == 0) {
- leftProperty = DEFAULT_PROPERTY_LEFT;
- }
- return leftProperty;
- }
-
- protected String getTopOrDefault(UIComponent component) {
- String topProperty = ((AbstractPopupPanel) component).getTop();
- if (topProperty == null || topProperty.length() == 0) {
- topProperty = DEFAULT_PROPERTY_TOP;
- }
- return topProperty;
- }
}
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2011-01-19
12:39:22 UTC (rev 21079)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2011-01-19
13:23:47 UTC (rev 21080)
@@ -31,10 +31,10 @@
}
var defaultOptions = {
- width:0,
- height:0,
- minWidth:0,
- minHeight:0,
+ width:-1,
+ height:-1,
+ minWidth:-1,
+ minHeight:-1,
modal:true,
moveable:true,
resizeable: false,
@@ -280,35 +280,39 @@
var eContentElt = this.getContentElement();
if (!this.options.autosized) {
- if (options.width && options.width == 0)
+ if (options.width && options.width == -1)
options.width = 300;
- if (options.height && options.height == 0)
+ if (options.height && options.height == -1)
options.height = 200;
}
- if (options.width && options.width != 0) {
+ if (options.width && options.width != -1) {
if (this.currentMinWidth > options.width) {
options.width = this.currentMinWidth;
}
- if (this.maxWidth && options.width > this.maxWidth) {
+ if (options.width > this.maxWidth) {
options.width = this.maxWidth;
}
$(richfaces.getDomElement(eContentElt)).css('width', options.width +
(/px/.test(options.width) ? '' : 'px'));
this.shadowDiv.css('width', options.width + (/px/.test(options.width) ?
'' : 'px'));
this.scrollerDiv.css('width', options.width + (/px/.test(options.width) ?
'' : 'px'));
+
+
}
- if (options.height && options.height != 0) {
+ if (options.height && options.height != -1) {
if (this.currentMinHeight > options.height) {
options.height = this.currentMinHeight;
}
- if (this.maxHeigh && options.height > this.maxHeight) {
+ if (options.height > this.maxHeight) {
options.height = this.maxHeight;
}
$(richfaces.getDomElement(eContentElt)).css('height', options.height +
(/px/.test(options.height) ? '' : 'px'));
this.shadowDiv.css('height', options.height + (/px/.test(options.height) ?
'' : 'px'));
var headerHeight = $(richfaces.getDomElement(this.markerId
+"_header"))[0] ? $(richfaces.getDomElement(this.markerId
+"_header"))[0].clientHeight : 0;
this.scrollerDiv.css('height', options.height - headerHeight +
(/px/.test(options.height) ? '' : 'px'));
+
+
}
var eIframe;
if (this.options.overlapEmbedObjects && !this.iframe) {
Modified: trunk/ui/output/ui/src/main/templates/popupPanel.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/popupPanel.template.xml 2011-01-19 12:39:22 UTC
(rev 21079)
+++ trunk/ui/output/ui/src/main/templates/popupPanel.template.xml 2011-01-19 13:23:47 UTC
(rev 21080)
@@ -73,11 +73,9 @@
</div>
<cdk:scriptObject name="options">
- <cdk:scriptOption name="left"
value="#{getLeftOrDefault(component)}"/>
- <cdk:scriptOption name="top"
value="#{getTopOrDefault(component)}"/>
- <cdk:scriptOption attributes="minHeight minWidth maxHeight maxWidth
width height moveable followByScroll zindex shadowDepth shadowOpacity domElementAttachment
show keepVisualState autosized resizeable modal overlapEmbedObjects visualOptions "
/>
- <cdk:scriptOption attributes="onshow onhide onresize onmove onbeforeshow
onbeforehide" wrapper="eventHandler"/>
- </cdk:scriptObject>
+ <cdk:scriptOption attributes="width height minWidth minHeight
maxWidth maxHeight moveable followByScroll left top zindex shadowDepth shadowOpacity
domElementAttachment show keepVisualState autosized resizeable modal overlapEmbedObjects
visualOptions " />
+ <cdk:scriptOption attributes="onshow onhide onresize onmove
onbeforeshow onbeforehide" wrapper="eventHandler"/>
+ </cdk:scriptObject>
<script type="text/javascript">
new RichFaces.ui.PopupPanel(#{toScriptArgs(clientId, options)});
@@ -87,5 +85,7 @@
</script>
</div>
+
+
</cc:implementation>
</cdk:root>
\ No newline at end of file
Show replies by date