Author: adubovsky
Date: 2008-07-10 08:37:00 -0400 (Thu, 10 Jul 2008)
New Revision: 9505
Modified:
trunk/test-applications/jsp/src/main/java/toolBar/ToolBar.java
trunk/test-applications/jsp/src/main/java/util/event/Event.java
trunk/test-applications/jsp/src/main/webapp/ToolBar/ToolBar.jsp
trunk/test-applications/jsp/src/main/webapp/ToolBar/ToolBarProperty.jsp
trunk/test-applications/jsp/src/main/webapp/styles/styles.css
Log:
Add events and styles for toolBar
Modified: trunk/test-applications/jsp/src/main/java/toolBar/ToolBar.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/toolBar/ToolBar.java 2008-07-10 12:15:27 UTC
(rev 9504)
+++ trunk/test-applications/jsp/src/main/java/toolBar/ToolBar.java 2008-07-10 12:37:00 UTC
(rev 9505)
@@ -1,5 +1,8 @@
package toolBar;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+
import org.richfaces.component.html.HtmlToolBar;
import util.componentInfo.ComponentInfo;
@@ -11,10 +14,11 @@
private String itemSeparator;//none, line, square, disc and grid
private String location;//A location of a group on a menu bar. Possible values are left
and right
private HtmlToolBar htmlToolBar = null;
- private String contentStyle;
- private String separatorStyle;
+ private String contentClass;
+ private String separatorClass;
private String btnLabel="ON";
private boolean rendered;
+ private String bindLabel="not checked";
public void addHtmlToolBar(){
ComponentInfo info = ComponentInfo.getInstance();
@@ -29,30 +33,33 @@
public void setHtmlToolBar(HtmlToolBar htmlToolBar) {
this.htmlToolBar = htmlToolBar;
}
-
-
+
+ public void checkBinding(ActionEvent actionEvent){
+ FacesContext context = FacesContext.getCurrentInstance();
+ bindLabel = htmlToolBar.getClientId(context);
+ }
+
public ToolBar() {
rendered=true;
width="75%";
height="50px";
- itemSeparator="square";
+ itemSeparator="line";
location="left";
- contentStyle=null;
- separatorStyle=null;
+ contentClass=null;
+ separatorClass=null;
}
-
public void doStyles()
{
- if (getSeparatorStyle() == null) {
+ if (getSeparatorClass() == null) {
setBtnLabel("OFF");
- setContentStyle("contentStyle");
- setSeparatorStyle("separatorStyle");
+ setContentClass("contentClass");
+ setSeparatorClass("separatorClass");
} else {
setBtnLabel("ON");
- setContentStyle(null);
- setSeparatorStyle(null);
+ setContentClass(null);
+ setSeparatorClass(null);
}
}
@@ -72,8 +79,6 @@
return itemSeparator;
}
-
-
public void setItemSeparator(String itemSeparator) {
this.itemSeparator = itemSeparator;
}
@@ -116,26 +121,26 @@
- public String getContentStyle() {
- return contentStyle;
+ public String getContentClass() {
+ return contentClass;
}
- public void setContentStyle(String contentStyle) {
- this.contentStyle = contentStyle;
+ public void setContentClass(String contentClass) {
+ this.contentClass = contentClass;
}
- public String getSeparatorStyle() {
- return separatorStyle;
+ public String getSeparatorClass() {
+ return separatorClass;
}
- public void setSeparatorStyle(String separatorStyle) {
- this.separatorStyle = separatorStyle;
+ public void setSeparatorClass(String separatorClass) {
+ this.separatorClass = separatorClass;
}
@@ -148,4 +153,12 @@
this.btnLabel = btnLabel;
}
+ public String getBindLabel() {
+ return bindLabel;
+ }
+
+ public void setBindLabel(String bindLabel) {
+ this.bindLabel = bindLabel;
+ }
+
}
Modified: trunk/test-applications/jsp/src/main/java/util/event/Event.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/util/event/Event.java 2008-07-10 12:15:27
UTC (rev 9504)
+++ trunk/test-applications/jsp/src/main/java/util/event/Event.java 2008-07-10 12:37:00
UTC (rev 9505)
@@ -114,6 +114,18 @@
private String opened;
private String onobjectchange;
private String onadd;
+ /* Events for toolBar */
+ private String onitemclick;
+ private String onitemdblclick;
+ private String onitemkeydown;
+ private String onitemkeypress;
+ private String onitemkeyup;
+ private String onitemmousedown;
+ private String onitemmousemove;
+ private String onitemmouseout;
+ private String onitemmouseover;
+ private String onitemmouseup;
+ /* --- */
public String getOpened() {
return opened;
@@ -125,6 +137,18 @@
// showEvent('onkeypressInputID', 'onkeypress work!')
public Event() {
+ /* Events for toolBar */
+ onitemclick = "showEvent('infoFormID:infoSubview:onitemclickInputID',
'onitemclick work!')";
+ onitemdblclick =
"showEvent('infoFormID:infoSubview:onitemdblclickInputID',
'onitemdblclick work!')";
+ onitemkeydown =
"showEvent('infoFormID:infoSubview:onitemkeydownInputID', 'onitemkeydown
work!')";
+ onitemkeypress =
"showEvent('infoFormID:infoSubview:onitemkeypressInputID',
'onitemkeypress work!')";
+ onitemkeyup = "showEvent('infoFormID:infoSubview:onitemkeyupInputID',
'onitemkeyup work!')";
+ onitemmousedown =
"showEvent('infoFormID:infoSubview:onitemmousedownInputID',
'onitemmousedown work!')";
+ onitemmousemove =
"showEvent('infoFormID:infoSubview:onitemmousemoveInputID',
'onitemmousemove work!')";
+ onitemmouseout =
"showEvent('infoFormID:infoSubview:onitemmouseoutInputID',
'onitemmouseout work!')";
+ onitemmouseover =
"showEvent('infoFormID:infoSubview:onitemmouseoverInputID',
'onitemmouseover work!')";
+ onitemmouseup =
"showEvent('infoFormID:infoSubview:onitemmouseupInputID', 'onitemmouseup
work!')";
+ /* --- */
onobjectchange =
"showEvent('infoFormID:infoSubview:onobjectchangeInputID',
'onobjectchange work!')";
onLoadMap = "showEvent('infoFormID:infoSubview:onLoadMapInputID',
'onLoadMap work!')";
opened = "showEvent('infoFormID:infoSubview:openedInputID', 'opened
work!')";
@@ -1282,4 +1306,84 @@
this.onadd = onadd;
}
+ public String getOnitemclick() {
+ return onitemclick;
+ }
+
+ public void setOnitemclick(String onitemclick) {
+ this.onitemclick = onitemclick;
+ }
+
+ public String getOnitemdblclick() {
+ return onitemdblclick;
+ }
+
+ public void setOnitemdblclick(String onitemdblclick) {
+ this.onitemdblclick = onitemdblclick;
+ }
+
+ public String getOnitemkeydown() {
+ return onitemkeydown;
+ }
+
+ public void setOnitemkeydown(String onitemkeydown) {
+ this.onitemkeydown = onitemkeydown;
+ }
+
+ public String getOnitemkeypress() {
+ return onitemkeypress;
+ }
+
+ public void setOnitemkeypress(String onitemkeypress) {
+ this.onitemkeypress = onitemkeypress;
+ }
+
+ public String getOnitemkeyup() {
+ return onitemkeyup;
+ }
+
+ public void setOnitemkeyup(String onitemkeyup) {
+ this.onitemkeyup = onitemkeyup;
+ }
+
+ public String getOnitemmousedown() {
+ return onitemmousedown;
+ }
+
+ public void setOnitemmousedown(String onitemmousedown) {
+ this.onitemmousedown = onitemmousedown;
+ }
+
+ public String getOnitemmousemove() {
+ return onitemmousemove;
+ }
+
+ public void setOnitemmousemove(String onitemmousemove) {
+ this.onitemmousemove = onitemmousemove;
+ }
+
+ public String getOnitemmouseout() {
+ return onitemmouseout;
+ }
+
+ public void setOnitemmouseout(String onitemmouseout) {
+ this.onitemmouseout = onitemmouseout;
+ }
+
+ public String getOnitemmouseover() {
+ return onitemmouseover;
+ }
+
+ public void setOnitemmouseover(String onitemmouseover) {
+ this.onitemmouseover = onitemmouseover;
+ }
+
+ public String getOnitemmouseup() {
+ return onitemmouseup;
+ }
+
+ public void setOnitemmouseup(String onitemmouseup) {
+ this.onitemmouseup = onitemmouseup;
+ }
+
}
\ No newline at end of file
Modified: trunk/test-applications/jsp/src/main/webapp/ToolBar/ToolBar.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/ToolBar/ToolBar.jsp 2008-07-10 12:15:27
UTC (rev 9504)
+++ trunk/test-applications/jsp/src/main/webapp/ToolBar/ToolBar.jsp 2008-07-10 12:37:00
UTC (rev 9505)
@@ -6,13 +6,29 @@
<f:subview id="toolBarSubviewID">
<h:messages></h:messages>
- <rich:toolBar id="toolBarId" width="#{toolBar.width}"
binding="#{toolBar.htmlToolBar}"
- height="#{toolBar.height}" rendered="#{toolBar.rendered}"
+ <rich:toolBar id="toolBarId"
+ width="#{toolBar.width}"
+ binding="#{toolBar.htmlToolBar}"
+ height="#{toolBar.height}"
+ rendered="#{toolBar.rendered}"
itemSeparator="#{toolBar.itemSeparator}"
- contentClass="#{toolBar.contentStyle}"
- separatorClass="#{toolBar.separatorStyle}"
- contentStyle="contentStyle" style="#{style.style}"
styleClass="#{style.styleClass}">
- <h:outputText value="ToolBar" style="font-style:
italic"></h:outputText>
+ contentClass="#{toolBar.contentClass}"
+ separatorClass="#{toolBar.separatorClass}"
+ contentStyle="font-style: italic"
+ style=""
+ styleClass=""
+ onitemclick="#{event.onitemclick}"
+ onitemdblclick="#{event.onitemdblclick}"
+ onitemkeydown="#{event.onitemkeydown}"
+ onitemkeypress="#{event.onitemkeypress}"
+ onitemkeyup="#{event.onitemkeyup}"
+ onitemmousedown="#{event.onitemmousedown}"
+ onitemmousemove="#{event.onitemmousemove}"
+ onitemmouseout="#{event.onitemmouseout}"
+ onitemmouseover="#{event.onitemmouseover}"
+ onitemmouseup="#{event.onitemmouseup}">
+
+ <h:outputText value="ToolBar" ></h:outputText>
<rich:toolBarGroup>
<h:outputText value="Width:"></h:outputText>
@@ -28,10 +44,17 @@
</h:inputText>
</rich:toolBarGroup>
+ <rich:toolBarGroup>
+ <rich:comboBox>
+ <f:selectItem itemValue="select_1"/>
+ <f:selectItem itemValue="select_2"/>
+ </rich:comboBox>
+ </rich:toolBarGroup>
+
<rich:toolBarGroup location="#{toolBar.location}">
<h:graphicImage
value="/pics/ajax_process.gif"></h:graphicImage>
</rich:toolBarGroup>
-
+
</rich:toolBar>
</f:subview>
Modified: trunk/test-applications/jsp/src/main/webapp/ToolBar/ToolBarProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/ToolBar/ToolBarProperty.jsp 2008-07-10
12:15:27 UTC (rev 9504)
+++ trunk/test-applications/jsp/src/main/webapp/ToolBar/ToolBarProperty.jsp 2008-07-10
12:37:00 UTC (rev 9505)
@@ -24,13 +24,19 @@
<a4j:support event="onclick"
reRender="toolBarId"></a4j:support>
</h:selectOneRadio>
- <h:outputText value="Switch Styles" />
+ <h:outputText value="Switch Styles (check contentClass and
separatorClass)" />
<a4j:commandButton id="slBtn" value="#{toolBar.btnLabel}"
action="#{toolBar.doStyles}" reRender="toolBarId,slBtn">
</a4j:commandButton>
+
+ <h:outputText value="rendered" />
+ <h:selectBooleanCheckbox value="#{toolBar.rendered}"
onclick="submit()"/>
+
+ <h:commandButton actionListener="#{toolBar.checkBinding}"
value="binding" />
+ <h:outputText value="#{toolBar.bindLabel}" />
+
</h:panelGrid>
- <br />
- <br />
+
<div style="FONT-WEIGHT: bold;">rich:findComponent</div>
<h:panelGrid columns="2">
<rich:column>
Modified: trunk/test-applications/jsp/src/main/webapp/styles/styles.css
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/styles/styles.css 2008-07-10 12:15:27 UTC
(rev 9504)
+++ trunk/test-applications/jsp/src/main/webapp/styles/styles.css 2008-07-10 12:37:00 UTC
(rev 9505)
@@ -117,11 +117,22 @@
}
/* ToolBar Styles*/
-.separatorStyle {
+.separatorClass {
border: 3px solid red;
background: lime;
}
+.contentClass {
+ background: silver;
+ border: 1px red;
+ font: 20px;
+}
+
+.toolBarClass {
+ border: 3px double yellow;
+ background: lime;
+}
+
/*Calendar*/
.smallText {
font-size: xx-small;