Author: nbelaevski
Date: 2009-04-09 17:34:17 -0400 (Thu, 09 Apr 2009)
New Revision: 13478
Modified:
trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java
trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp
trunk/ui/pickList/src/main/config/component/picklist.xml
trunk/ui/pickList/src/main/java/org/richfaces/component/UIPickList.java
trunk/ui/pickList/src/main/java/org/richfaces/renderkit/PickListControlsHelper.java
Log:
https://jira.jboss.org/jira/browse/RF-6622
https://jira.jboss.org/jira/browse/RF-6729
Modified: trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java 2009-04-09
15:58:30 UTC (rev 13477)
+++ trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java 2009-04-09
21:34:17 UTC (rev 13478)
@@ -24,6 +24,10 @@
private boolean disabled;
private boolean moveControlsVisible = true;
private boolean fastMoveControlsVisible = true;
+ private boolean copyAllVisible = true;
+ private boolean copyVisible = true;
+ private boolean removeVisible = true;
+ private boolean removeAllVisible = true;
private List <Animal> listValues = new ArrayList<Animal>();
@@ -222,8 +226,41 @@
public void setFastMoveControlsVisible(boolean fastMoveControlsVisible) {
this.fastMoveControlsVisible = fastMoveControlsVisible;
}
+
+ public boolean isCopyAllVisible() {
+ return copyAllVisible;
+ }
+
+ public void setCopyAllVisible(boolean copyAllVisible) {
+ this.copyAllVisible = copyAllVisible;
+ }
+
+ public boolean isCopyVisible() {
+ return copyVisible;
+ }
+
+ public void setCopyVisible(boolean copyVisible) {
+ this.copyVisible = copyVisible;
+ }
+
+ public boolean isRemoveVisible() {
+ return removeVisible;
+ }
+
+ public void setRemoveVisible(boolean removeVisible) {
+ this.removeVisible = removeVisible;
+ }
+
+ public boolean isRemoveAllVisible() {
+ return removeAllVisible;
+ }
+
+ public void setRemoveAllVisible(boolean removeAllVisible) {
+ this.removeAllVisible = removeAllVisible;
+ }
+
// public List<String> getListValues() {
// return listValues;
Modified: trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp 2009-04-09 15:58:30 UTC
(rev 13477)
+++ trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp 2009-04-09 21:34:17 UTC
(rev 13478)
@@ -15,7 +15,7 @@
<h:form>
- <h:panelGrid columns="6">
+ <h:panelGrid columns="8">
<h:outputText value="set target list width: "></h:outputText>
<h:inputText
value="#{pickBean.targetListWidth}"></h:inputText>
@@ -23,6 +23,9 @@
<h:outputText value="set 'CopyAll' control label:
"></h:outputText>
<h:inputText value="#{pickBean.copyAllLabel}"></h:inputText>
+ <h:outputText value="copyAll control visible"></h:outputText>
+ <h:selectBooleanCheckbox
value="#{pickBean.copyAllVisible}"></h:selectBooleanCheckbox>
+
<h:outputText value="set move controls
visible"></h:outputText>
<h:selectBooleanCheckbox
value="#{pickBean.moveControlsVisible}"></h:selectBooleanCheckbox>
@@ -32,6 +35,9 @@
<h:outputText value="set 'Copy' control label:
"></h:outputText>
<h:inputText value="#{pickBean.copyLabel}"></h:inputText>
+ <h:outputText value="copy control visible"></h:outputText>
+ <h:selectBooleanCheckbox
value="#{pickBean.copyVisible}"></h:selectBooleanCheckbox>
+
<h:outputText value="set fast move controls
visible"></h:outputText>
<h:selectBooleanCheckbox
value="#{pickBean.fastMoveControlsVisible}"></h:selectBooleanCheckbox>
@@ -41,6 +47,9 @@
<h:outputText value="set 'Remove' control label:
"></h:outputText>
<h:inputText value="#{pickBean.removeLabel}"></h:inputText>
+ <h:outputText value="remove control visible"></h:outputText>
+ <h:selectBooleanCheckbox
value="#{pickBean.removeVisible}"></h:selectBooleanCheckbox>
+
<h:outputText value=""></h:outputText>
<h:outputText value=""></h:outputText>
@@ -50,10 +59,12 @@
<h:outputText value="set 'RemoveAll' control label:
"></h:outputText>
<h:inputText
value="#{pickBean.removeAllLabel}"></h:inputText>
+ <h:outputText value="removeAll control
visible"></h:outputText>
+ <h:selectBooleanCheckbox
value="#{pickBean.removeAllVisible}"></h:selectBooleanCheckbox>
+
<h:outputText value=""></h:outputText>
<h:outputText value=""></h:outputText>
-
</h:panelGrid>
<br/>
@@ -77,7 +88,11 @@
showButtonsLabel="true"
moveControlsVisible="#{pickBean.moveControlsVisible}"
fastMoveControlsVisible="#{pickBean.fastMoveControlsVisible}"
- disabled="#{pickBean.disabled}"
+ copyAllVisible="#{pickBean.copyAllVisible}"
+ copyVisible="#{pickBean.copyVisible}"
+ removeVisible="#{pickBean.removeVisible}"
+ removeAllVisible="#{pickBean.removeAllVisible}"
+ disabled="#{pickBean.disabled}"
<f:selectItems
value="#{pickBean.testList}"/>
Modified: trunk/ui/pickList/src/main/config/component/picklist.xml
===================================================================
--- trunk/ui/pickList/src/main/config/component/picklist.xml 2009-04-09 15:58:30 UTC (rev
13477)
+++ trunk/ui/pickList/src/main/config/component/picklist.xml 2009-04-09 21:34:17 UTC (rev
13478)
@@ -74,9 +74,9 @@
<property>
<name>showButtonsLabel</name>
<classname>boolean</classname>
+ <description>Shows a label for a button. Default value is
"true"</description>
<defaultvalue>true</defaultvalue>
- <description>Shows a label for a button. Default value is
"true"</description>
- </property>
+ </property>
<property>
<name>copyAllControlLabel</name>
@@ -166,10 +166,42 @@
<defaultvalue>"140px"</defaultvalue>
</property>
<property>
+ <name>copyAllVisible</name>
+ <classname>boolean</classname>
+ <description>
+ If "false", the 'Copy All' control will
not be displayed. Even if this value is "true", the 'Copy
All' control will not be displayed if the
"fastMoveControlsVisible" attribute is "false".
Default value is "true".
+ </description>
+ <defaultvalue>true</defaultvalue>
+ </property>
+ <property>
+ <name>copyVisible</name>
+ <classname>boolean</classname>
+ <description>
+ If "false", the 'Copy' control will not
be displayed. Even if this value is "true", the 'Copy'
control will not be displayed if the "moveControlsVisible" attribute is
"false". Default value is "true".
+ </description>
+ <defaultvalue>true</defaultvalue>
+ </property>
+ <property>
+ <name>removeVisible</name>
+ <classname>boolean</classname>
+ <description>
+ If "false", the 'Remove' control will
not be displayed. Even if this value is "true", the
'Remove' control will not be displayed if the
"moveControlsVisible" attribute is "false". Default
value is "true".
+ </description>
+ <defaultvalue>true</defaultvalue>
+ </property>
+ <property>
+ <name>removeAllVisible</name>
+ <classname>boolean</classname>
+ <description>
+ If "false", the 'Remove All' control
will not be displayed. Even if this value is "true", the
'Remove All' control will not be displayed if the
"fastMoveControlsVisible" attribute is "false".
Default value is "true".
+ </description>
+ <defaultvalue>true</defaultvalue>
+ </property>
+ <property>
<name>moveControlsVisible</name>
<classname>boolean</classname>
<description>
- If "false", 'Copy' and
'Remove' controls aren't displayed. Default value is
"true".
+ If "false", 'Copy' and
'Remove' controls aren't displayed. Even if this value is
"true", the 'Copy' and 'Remove'
controls will not be displayed if the "copyVisible" and
"removeVisible" attribute values are "false". Default
value is "true".
</description>
<defaultvalue>true</defaultvalue>
</property>
@@ -177,7 +209,7 @@
<name>fastMoveControlsVisible</name>
<classname>boolean</classname>
<description>
- If "false", 'Copy All' and
'Remove All' controls aren't displayed. Default value is
"true".
+ If "false", 'Copy All' and
'Remove All' controls aren't displayed. Even if this value is
"true", the 'Copy All' and 'Remove
All' controls will not be displayed if the "copyAllVisible" and
"removeAllVisible" attribute values are "false".
Default value is "true".
</description>
<defaultvalue>true</defaultvalue>
</property>
Modified: trunk/ui/pickList/src/main/java/org/richfaces/component/UIPickList.java
===================================================================
--- trunk/ui/pickList/src/main/java/org/richfaces/component/UIPickList.java 2009-04-09
15:58:30 UTC (rev 13477)
+++ trunk/ui/pickList/src/main/java/org/richfaces/component/UIPickList.java 2009-04-09
21:34:17 UTC (rev 13478)
@@ -138,5 +138,17 @@
public abstract boolean isFastMoveControlsVisible();
public abstract void setFastMoveControlsVisible(boolean visible);
-
+
+ public abstract boolean isCopyAllVisible();
+ public abstract void setCopyAllVisible(boolean visible);
+
+ public abstract boolean isCopyVisible();
+ public abstract void setCopyVisible(boolean visible);
+
+ public abstract boolean isRemoveVisible();
+ public abstract void setRemoveVisible(boolean visible);
+
+ public abstract boolean isRemoveAllVisible();
+ public abstract void setRemoveAllVisible(boolean visible);
+
}
Modified:
trunk/ui/pickList/src/main/java/org/richfaces/renderkit/PickListControlsHelper.java
===================================================================
---
trunk/ui/pickList/src/main/java/org/richfaces/renderkit/PickListControlsHelper.java 2009-04-09
15:58:30 UTC (rev 13477)
+++
trunk/ui/pickList/src/main/java/org/richfaces/renderkit/PickListControlsHelper.java 2009-04-09
21:34:17 UTC (rev 13478)
@@ -127,7 +127,8 @@
"copyAll".concat(OrderingComponentControlsHelper.CONTROL_LABEL_ATTRIBUTE_SUFFIX),
COPY_ALL_TITLE) {
public boolean isRendered(FacesContext context, UIComponent listComponent) {
- return ((UIPickList) listComponent).isFastMoveControlsVisible() &&
!((UIPickList) listComponent).isDisabled();
+ return ((UIPickList) listComponent).isFastMoveControlsVisible() &&
((UIPickList) listComponent).isCopyAllVisible()
+ && !((UIPickList) listComponent).isDisabled();
}
},
@@ -137,7 +138,7 @@
.concat(OrderingComponentControlsHelper.CONTROL_LABEL_ATTRIBUTE_SUFFIX),
COPY_ALL_TITLE) {
public boolean isRendered(FacesContext context, UIComponent listComponent) {
- return ((UIPickList) listComponent).isFastMoveControlsVisible();
+ return ((UIPickList) listComponent).isFastMoveControlsVisible() &&
((UIPickList) listComponent).isCopyAllVisible();
}
},
@@ -146,7 +147,8 @@
.concat(OrderingComponentControlsHelper.CONTROL_LABEL_ATTRIBUTE_SUFFIX),
COPY_TITLE) {
public boolean isRendered(FacesContext context, UIComponent listComponent) {
- return ((UIPickList) listComponent).isMoveControlsVisible() &&
!((UIPickList) listComponent).isDisabled();
+ return ((UIPickList) listComponent).isMoveControlsVisible() &&
((UIPickList) listComponent).isCopyVisible()
+ && !((UIPickList) listComponent).isDisabled();
}
},
@@ -155,7 +157,7 @@
false,
"copy".concat(OrderingComponentControlsHelper.CONTROL_LABEL_ATTRIBUTE_SUFFIX),
COPY_TITLE) {
public boolean isRendered(FacesContext context, UIComponent listComponent) {
- return ((UIPickList) listComponent).isMoveControlsVisible();
+ return ((UIPickList) listComponent).isMoveControlsVisible() &&
((UIPickList) listComponent).isCopyVisible();
}
},
@@ -164,7 +166,8 @@
.concat(OrderingComponentControlsHelper.CONTROL_LABEL_ATTRIBUTE_SUFFIX),
REMOVE_TITLE) {
public boolean isRendered(FacesContext context, UIComponent listComponent) {
- return ((UIPickList) listComponent).isMoveControlsVisible() &&
!((UIPickList) listComponent).isDisabled();
+ return ((UIPickList) listComponent).isMoveControlsVisible() &&
((UIPickList) listComponent).isRemoveVisible()
+ && !((UIPickList) listComponent).isDisabled();
}
},
@@ -173,7 +176,7 @@
.concat(CONTROL_ID_REMOVE), null, false,
"remove".concat(OrderingComponentControlsHelper.CONTROL_LABEL_ATTRIBUTE_SUFFIX),
REMOVE_TITLE) {
public boolean isRendered(FacesContext context, UIComponent listComponent) {
- return ((UIPickList) listComponent).isMoveControlsVisible();
+ return ((UIPickList) listComponent).isMoveControlsVisible() &&
((UIPickList) listComponent).isRemoveVisible();
}
},
@@ -182,7 +185,8 @@
true,
"removeAll".concat(OrderingComponentControlsHelper.CONTROL_LABEL_ATTRIBUTE_SUFFIX),
REMOVE_ALL_TITLE) {
public boolean isRendered(FacesContext context, UIComponent listComponent) {
- return ((UIPickList) listComponent).isFastMoveControlsVisible() &&
!((UIPickList) listComponent).isDisabled();
+ return ((UIPickList) listComponent).isFastMoveControlsVisible() &&
((UIPickList) listComponent).isRemoveAllVisible()
+ && !((UIPickList) listComponent).isDisabled();
}
},
@@ -192,7 +196,7 @@
.concat(OrderingComponentControlsHelper.CONTROL_LABEL_ATTRIBUTE_SUFFIX),
REMOVE_ALL_TITLE) {
public boolean isRendered(FacesContext context, UIComponent listComponent) {
- return ((UIPickList) listComponent).isFastMoveControlsVisible();
+ return ((UIPickList) listComponent).isFastMoveControlsVisible() &&
((UIPickList) listComponent).isRemoveAllVisible();
}
} };