Author: nbelaevski
Date: 2007-07-13 12:42:27 -0400 (Fri, 13 Jul 2007)
New Revision: 1622
Added:
trunk/sandbox/ui/pom.xml
trunk/sandbox/ui/tooltip/
Removed:
trunk/sandbox/tooltip/
Modified:
trunk/sandbox/api/
trunk/sandbox/api/pom.xml
trunk/sandbox/api/src/main/java/org/richfaces/model/DataModelCache.java
trunk/sandbox/api/src/main/java/org/richfaces/model/GridDataModel.java
trunk/sandbox/api/src/main/java/org/richfaces/model/ScrollableGridRange.java
trunk/sandbox/pom.xml
trunk/sandbox/samples/calendar-sample/pom.xml
trunk/sandbox/samples/panel2-sample/pom.xml
trunk/sandbox/samples/panelmenu-sample/pom.xml
trunk/sandbox/samples/pom.xml
trunk/sandbox/samples/simpleTogglePanel2-sample/pom.xml
trunk/sandbox/ui/calendar/pom.xml
trunk/sandbox/ui/calendar/src/main/config/component/calendar.xml
trunk/sandbox/ui/panel2/pom.xml
trunk/sandbox/ui/panel2/src/main/config/component/panel2.xml
trunk/sandbox/ui/panel2/src/main/templates/panel2.jspx
trunk/sandbox/ui/panelmenu/pom.xml
trunk/sandbox/ui/panelmenu/src/main/config/component/panelMenu.xml
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRendererBase.java
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/gradientimages/PanelMenuGroupGradient.java
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/gradientimages/PanelMenuItemGradient.java
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconBasic.java
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevron.java
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronDown.java
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronUp.java
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconDisc.java
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconGrid.java
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconSpacer.java
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangle.java
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangleDown.java
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangleUp.java
trunk/sandbox/ui/panelmenu/src/test/java/org/richfaces/component/PanelMenuComponentTest.java
trunk/sandbox/ui/scrollable-grid/pom.xml
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java
trunk/sandbox/ui/simpleTogglePanel2/pom.xml
trunk/sandbox/ui/simpleTogglePanel2/src/main/config/component/simpleTogglePanel2.xml
trunk/sandbox/ui/simpleTogglePanel2/src/main/java/org/richfaces/component/UISimpleTogglePanel2.java
Log:
Sandbox ready to build
Property changes on: trunk/sandbox/api
___________________________________________________________________
Name: svn:ignore
+ target
Modified: trunk/sandbox/api/pom.xml
===================================================================
--- trunk/sandbox/api/pom.xml 2007-07-13 13:14:47 UTC (rev 1621)
+++ trunk/sandbox/api/pom.xml 2007-07-13 16:42:27 UTC (rev 1622)
@@ -1,68 +1,72 @@
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>sandbox</artifactId>
- <groupId>org.richfaces</groupId>
- <version>3.1.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.sandbox</groupId>
- <artifactId>api</artifactId>
- <name>Java Server Faces AJAX framework API</name>
- <properties>
- <jsfVersion>1.1</jsfVersion>
- </properties>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- <version>1.1.12</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <version>1.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.0.4</version>
- </dependency>
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.7.0</version>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.2_03</version>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>sandbox</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.sandbox</groupId>
+ <artifactId>api</artifactId>
+ <name>Richfaces Sandbox API</name>
+ <properties>
+ <jsfVersion>1.1</jsfVersion>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ <version>1.1.12</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.4</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.7.0</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_03</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies></project>
\ No newline at end of file
Modified: trunk/sandbox/api/src/main/java/org/richfaces/model/DataModelCache.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/model/DataModelCache.java 2007-07-13
13:14:47 UTC (rev 1621)
+++ trunk/sandbox/api/src/main/java/org/richfaces/model/DataModelCache.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -11,9 +11,9 @@
import javax.faces.context.FacesContext;
import javax.faces.model.DataModelListener;
-import org.ajax4jsf.ajax.repeat.DataVisitor;
-import org.ajax4jsf.ajax.repeat.Range;
-import org.ajax4jsf.ajax.repeat.SerializableDataModel;
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.Range;
+import org.ajax4jsf.model.SerializableDataModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: trunk/sandbox/api/src/main/java/org/richfaces/model/GridDataModel.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/model/GridDataModel.java 2007-07-13
13:14:47 UTC (rev 1621)
+++ trunk/sandbox/api/src/main/java/org/richfaces/model/GridDataModel.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -11,9 +11,9 @@
import javax.faces.context.FacesContext;
-import org.ajax4jsf.ajax.repeat.DataVisitor;
-import org.ajax4jsf.ajax.repeat.ExtendedDataModel;
-import org.ajax4jsf.ajax.repeat.Range;
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: trunk/sandbox/api/src/main/java/org/richfaces/model/ScrollableGridRange.java
===================================================================
---
trunk/sandbox/api/src/main/java/org/richfaces/model/ScrollableGridRange.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/api/src/main/java/org/richfaces/model/ScrollableGridRange.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -12,7 +12,7 @@
import java.io.Serializable;
-import org.ajax4jsf.ajax.repeat.Range;
+import org.ajax4jsf.model.Range;
Modified: trunk/sandbox/pom.xml
===================================================================
--- trunk/sandbox/pom.xml 2007-07-13 13:14:47 UTC (rev 1621)
+++ trunk/sandbox/pom.xml 2007-07-13 16:42:27 UTC (rev 1622)
@@ -1,265 +1,25 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces</groupId>
- <artifactId>sandbox-parent</artifactId>
- <packaging>pom</packaging>
- <name>RichFaces Components</name>
- <version>1.0.0-SNAPSHOT</version>
- <url>http://richfaces.ajax4jsf.org</url>
- <properties>
- <!-- -->
- </properties>
- <!--
- <
url>http://labs.jboss.com/jbossrichfaces</url>
- -->
- <licenses>
- <license>
- <name>LGPL 2.1</name>
- <
url>http://www.gnu.org/licenses/lgpl.html</url>
- <distribution>repo</distribution>
- <comments>
- GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
- </comments>
- </license>
- </licenses>
- <issueManagement>
- <system>JIRA</system>
- <
url>http://jira.jboss.org/jira/browse/RF</url>
- </issueManagement>
- <developers>
- <developer>
- <id>alexsmirnov</id>
- <name>Alexander Smirnov</name>
- <email>alexsmirnov(a)exadel.com</email>
- <organization>Exadel Inc.</organization>
- <organizationUrl>http://www.exadel.com</organizationUrl>
- <roles>
- <role>architect</role>
- <role>developer</role>
- </roles>
- <timezone>-3</timezone>
- </developer>
- <developer>
- <id>ishabalov</id>
- <name>Igor Shabalov</name>
- <email>ishabalov(a)exadel.com</email>
- <organization>Exadel Inc.</organization>
- <organizationUrl>http://www.exadel.com</organizationUrl>
- <roles>
- <role>architect</role>
- <role>developer</role>
- </roles>
- <timezone>+8</timezone>
- </developer>
- <developer>
- <id>sergeysmirnov</id>
- <name>Sergey Smirnov</name>
- <email>sergeysmirnov(a)exadel.com</email>
- <organization>Exadel Inc.</organization>
- <organizationUrl>http://www.exadel.com</organizationUrl>
- <roles>
- <role>architect</role>
- <role>developer</role>
- </roles>
- <timezone>+8</timezone>
- </developer>
- <developer>
- <id>nbelayevsky</id>
- <name>Nik Belyaevsky</name>
- <email>nbelayevsky(a)exadel.com</email>
- <organization>Exadel Inc.</organization>
- <organizationUrl>http://www.exadel.com</organizationUrl>
- <roles>
- <role>architect</role>
- <role>developer</role>
- </roles>
- <timezone>-2</timezone>
- </developer>
- </developers>
- <distributionManagement>
- <downloadUrl>
-
http://labs.jboss.com/portal/jbossrichfaces/downloads
-
- </downloadUrl>
- <repository>
- <id>release-repository</id>
- <uniqueVersion>false</uniqueVersion>
-
- <url>${releaseRepository}</url>
- </repository>
- <snapshotRepository>
- <id>snap-repository</id>
- <uniqueVersion>true</uniqueVersion>
- <url>${snapshotRepository}</url>
- </snapshotRepository>
- </distributionManagement>
- <scm>
- <connection>
-
scm:svn:http://anonsvn.jboss.org/repos/richfaces/
- </connection>
- <developerConnection>
-
scm:svn:https://svn.jboss.org/repos/richfaces/
- </developerConnection>
- <
url>http://anonsvn.jboss.org/repos/richfaces/</url>
- </scm>
-
-
- <pluginRepositories>
- <pluginRepository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>daily</updatePolicy>
- </snapshots>
- <id>maven2-snapshots.jboss.org</id>
- <name>Jboss Repository for Maven Snapshots</name>
- <
url>http://snapshots.jboss.com/</url>
- </pluginRepository>
- </pluginRepositories>
- <repositories>
-
- <repository>
- <releases/>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>maven-repository.dev.java.net</id>
- <
name>Java.net Repository for Maven</name>
- <url>
-
https://maven-repository.dev.java.net/nonav/repository
- </url>
- <layout>legacy</layout>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>maven2-snapshots.jboss.org</id>
- <name>Jboss Repository for Maven Snapshots</name>
- <
url>http://snapshots.jboss.com/</url>
- </repository>
-
-
-
- </repositories>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-source</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.1_02</version>
- <exclusions>
- <!-- No longer presented in any repo -->
- <exclusion>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.servlet.jsp.jstl</groupId>
- <artifactId>jstl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <version>1.1_02</version>
- <scope>runtime</scope>
- <exclusions>
- <!-- No longer presented in any repo -->
- <exclusion>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.servlet.jsp.jstl</groupId>
- <artifactId>jstl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>ajax4jsf</artifactId>
- <version>3.1.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>test</artifactId>
- <version>3.1.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- <version>1.1.11</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <version>1.0</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>el-impl</groupId>
- <artifactId>el-impl</artifactId>
- <version>1.0</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2</version>
- </dependency>
- </dependencies>
- <modules>
- <module>scrollable-grid</module>
- <module>panel2</module>
- <module>simpleTogglePanel2</module>
- <module>panelmenu</module>
- <module>calendar</module>
- <module>tooltip</module>
- </modules>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>root</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>sandbox</artifactId>
+ <packaging>pom</packaging>
+ <name>RichFaces Sandbox Components</name>
+ <
url>http://richfaces.ajax4jsf.org/sandbox</url>
+ <properties>
+ <!-- -->
+ </properties>
+ <!--
+ <
url>http://labs.jboss.com/jbossrichfaces</url>
+ -->
+ <modules>
+ <module>api</module>
+ <module>ui</module>
+ <module>samples</module>
+ </modules>
+</project>
Modified: trunk/sandbox/samples/calendar-sample/pom.xml
===================================================================
--- trunk/sandbox/samples/calendar-sample/pom.xml 2007-07-13 13:14:47 UTC (rev 1621)
+++ trunk/sandbox/samples/calendar-sample/pom.xml 2007-07-13 16:42:27 UTC (rev 1622)
@@ -1,22 +1,16 @@
<?xml version="1.0"?><project>
<parent>
- <artifactId>richfaces-samples</artifactId>
- <groupId>org.richfaces</groupId>
+ <artifactId>samples</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
<version>3.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces</groupId>
<artifactId>calendar-sample</artifactId>
<packaging>war</packaging>
<name>calendar-sample Maven Webapp</name>
<dependencies>
<dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>common</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.sandbox.ui</groupId>
<artifactId>calendar</artifactId>
<version>${project.version}</version>
</dependency>
Modified: trunk/sandbox/samples/panel2-sample/pom.xml
===================================================================
--- trunk/sandbox/samples/panel2-sample/pom.xml 2007-07-13 13:14:47 UTC (rev 1621)
+++ trunk/sandbox/samples/panel2-sample/pom.xml 2007-07-13 16:42:27 UTC (rev 1622)
@@ -1,7 +1,7 @@
<?xml version="1.0"?><project>
<parent>
- <artifactId>richfaces-samples</artifactId>
- <groupId>org.richfaces</groupId>
+ <artifactId>samples</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
<version>3.1.0-SNAPSHOT</version>
</parent>
@@ -13,14 +13,14 @@
<dependencies>
<dependency>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.sandbox.ui</groupId>
<artifactId>panel2</artifactId>
- <version>3.1.0-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.richfaces</groupId>
- <artifactId>richfaces</artifactId>
- <version>3.1.0-SNAPSHOT</version>
+ <artifactId>skins</artifactId>
+ <version>${project.version}</version>
</dependency>
</dependencies>
Modified: trunk/sandbox/samples/panelmenu-sample/pom.xml
===================================================================
--- trunk/sandbox/samples/panelmenu-sample/pom.xml 2007-07-13 13:14:47 UTC (rev 1621)
+++ trunk/sandbox/samples/panelmenu-sample/pom.xml 2007-07-13 16:42:27 UTC (rev 1622)
@@ -1,7 +1,7 @@
<?xml version="1.0"?><project>
<parent>
- <artifactId>richfaces-samples</artifactId>
- <groupId>org.richfaces</groupId>
+ <artifactId>samples</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
<version>3.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -11,12 +11,7 @@
<name>panelmenu-sample Maven Webapp</name>
<dependencies>
<dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>common</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.sandbox.ui</groupId>
<artifactId>panelmenu</artifactId>
<version>${project.version}</version>
</dependency>
Modified: trunk/sandbox/samples/pom.xml
===================================================================
--- trunk/sandbox/samples/pom.xml 2007-07-13 13:14:47 UTC (rev 1621)
+++ trunk/sandbox/samples/pom.xml 2007-07-13 16:42:27 UTC (rev 1622)
@@ -1,303 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces</groupId>
- <artifactId>sandbox-samples</artifactId>
- <packaging>pom</packaging>
- <name>RichFaces Components Examples</name>
- <version>1.0.0-SNAPSHOT</version>
- <
url>http://labs.jboss.com/jbossrichfaces/samples</url>
- <properties>
- <!-- -->
- </properties>
- <!-- Profile to run jetty, so the tomcat jars are included in the bundle. They are
not included by default -->
- <build>
- <plugins>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.1</version>
- <configuration>
- <scanIntervalSeconds>10</scanIntervalSeconds>
- <connectors>
- <connector
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>8080</port>
- <maxIdleTime>60000</maxIdleTime>
- </connector>
- </connectors>
- </configuration>
+<?xml version="1.0" encoding="UTF-8"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>samples</artifactId>
+ <version>3.1.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.sandbox</groupId>
+ <artifactId>samples</artifactId>
+ <packaging>pom</packaging>
+ <name>RichFaces Sandbox Components Examples</name>
+ <modules>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- <executions>
- <execution>
- <id>surefire-it</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>false</skip>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>ajax4jsf</artifactId>
- <version>3.1.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- <version>1.1.12</version>
- </dependency>
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <version>1.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>el-impl</groupId>
- <artifactId>el-impl</artifactId>
- <version>1.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <version>1.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces</artifactId>
- <version>3.1.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-
- <scm>
- <connection>
-
scm:svn:http://anonsvn.jboss.org/repos/richfaces/
- </connection>
- <developerConnection>
-
scm:svn:https://svn.jboss.org/repos/richfaces/
- </developerConnection>
- <
url>http://anonsvn.jboss.org/repos/richfaces/</url>
- </scm>
-
- <distributionManagement>
-
<
downloadUrl>http://labs.jboss.com/portal/jbossrichfaces/downloads</...
- <repository>
- <id>release-repository</id>
- <uniqueVersion>false</uniqueVersion>
- <url>${releaseRepository}</url>
- </repository>
- <snapshotRepository>
- <id>snap-repository</id>
- <uniqueVersion>true</uniqueVersion>
- <url>${snapshotRepository}</url>
- </snapshotRepository>
- </distributionManagement>
- <pluginRepositories>
- <pluginRepository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>always</updatePolicy>
- </snapshots>
- <id>maven2-snapshots.jboss.org</id>
- <name>Jboss Repository for Maven Snapshots</name>
- <
url>http://snapshots.jboss.com/</url>
- </pluginRepository>
- </pluginRepositories>
- <repositories>
- <repository>
- <releases/>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>maven-repository.dev.java.net</id>
- <
name>Java.net Repository for Maven</name>
- <url>
-
https://maven-repository.dev.java.net/nonav/repository
- </url>
- <layout>legacy</layout>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>always</updatePolicy>
- </snapshots>
- <id>maven2-snapshots.jboss.org</id>
- <name>Jboss Repository for Maven Snapshots</name>
- <
url>http://snapshots.jboss.com/</url>
- </repository>
- </repositories>
- <profiles>
- <profile>
- <id>jsf12</id>
- <build>
- <defaultGoal>jetty:run</defaultGoal>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0</version>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.2_03</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <version>1.2_03</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>myfaces</id>
- <properties>
- <myfaces>1.1.5</myfaces>
- <tomahawk>1.1.5</tomahawk>
- </properties>
- <build>
- <plugins/>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>ajax4jsf</artifactId>
- <version>3.1.0-SNAPSHOT</version>
- <exclusions>
- <exclusion>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.myfaces.core</groupId>
- <artifactId>myfaces-api</artifactId>
- <version>${myfaces}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.myfaces.core</groupId>
- <artifactId>myfaces-impl</artifactId>
- <version>${myfaces}</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>jsf-facelets</id>
- <dependencies>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.2_03</version>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <version>1.2_03</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- <version>1.1.11</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <version>1.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>el-impl</groupId>
- <artifactId>el-impl</artifactId>
- <version>1.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <version>1.0</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
- <modules>
- <module>scrollable-grid-demo</module>
- <module>panel2-sample</module>
- <module>simpleTogglePanel2-sample</module>
- <module>panelmenu-sample</module>
- <module>calendar-sample</module>
- <module>tooltip-sample</module>
- </modules>
+ <module>calendar-sample</module>
+ <!--module>scrollable-grid-demo</module-->
+ <module>panel2-sample</module>
+ <module>simpleTogglePanel2-sample</module>
+ <module>panelmenu-sample</module>
+
+ <!--module>tooltip-sample</module-->
+ </modules>
</project>
\ No newline at end of file
Modified: trunk/sandbox/samples/simpleTogglePanel2-sample/pom.xml
===================================================================
--- trunk/sandbox/samples/simpleTogglePanel2-sample/pom.xml 2007-07-13 13:14:47 UTC (rev
1621)
+++ trunk/sandbox/samples/simpleTogglePanel2-sample/pom.xml 2007-07-13 16:42:27 UTC (rev
1622)
@@ -1,7 +1,7 @@
<?xml version="1.0"?><project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>richfaces-samples</artifactId>
- <groupId>org.richfaces</groupId>
+ <artifactId>samples</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
<version>3.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -14,15 +14,10 @@
</build>
<dependencies>
<dependency>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.sandbox.ui</groupId>
<artifactId>simpleTogglePanel2</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>common</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.richfaces</groupId>
<artifactId>skins</artifactId>
Modified: trunk/sandbox/ui/calendar/pom.xml
===================================================================
--- trunk/sandbox/ui/calendar/pom.xml 2007-07-13 13:14:47 UTC (rev 1621)
+++ trunk/sandbox/ui/calendar/pom.xml 2007-07-13 16:42:27 UTC (rev 1622)
@@ -2,11 +2,11 @@
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>ui</artifactId>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.sandbox</groupId>
<version>3.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.sandbox.ui</groupId>
<artifactId>calendar</artifactId>
<name>Calendar</name>
<build>
@@ -44,9 +44,9 @@
</build>
<dependencies>
<dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>common</artifactId>
- <version>3.1.0-SNAPSHOT</version>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>impl</artifactId>
+ <version>${project.version}</version>
</dependency>
</dependencies>
</project>
Modified: trunk/sandbox/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- trunk/sandbox/ui/calendar/src/main/config/component/calendar.xml 2007-07-13 13:14:47
UTC (rev 1621)
+++ trunk/sandbox/ui/calendar/src/main/config/component/calendar.xml 2007-07-13 16:42:27
UTC (rev 1622)
@@ -18,7 +18,7 @@
<name>calendar</name>
<classname>org.richfaces.taglib.CalendarTag</classname>
<superclass>
- org.ajax4jsf.framework.taglib.HtmlComponentTagBase
+ org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
</superclass>
</tag>
<!--
Modified: trunk/sandbox/ui/panel2/pom.xml
===================================================================
--- trunk/sandbox/ui/panel2/pom.xml 2007-07-13 13:14:47 UTC (rev 1621)
+++ trunk/sandbox/ui/panel2/pom.xml 2007-07-13 16:42:27 UTC (rev 1622)
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>sandbox-parent</artifactId>
- <groupId>org.richfaces</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>ui</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
+ <version>3.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.sandbox.ui</groupId>
<artifactId>panel2</artifactId>
<name>Panel2</name>
<build>
@@ -44,9 +44,9 @@
</build>
<dependencies>
<dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>common</artifactId>
- <version>3.1.0-SNAPSHOT</version>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>impl</artifactId>
+ <version>${project.version}</version>
</dependency>
</dependencies>
</project>
Modified: trunk/sandbox/ui/panel2/src/main/config/component/panel2.xml
===================================================================
--- trunk/sandbox/ui/panel2/src/main/config/component/panel2.xml 2007-07-13 13:14:47 UTC
(rev 1621)
+++ trunk/sandbox/ui/panel2/src/main/config/component/panel2.xml 2007-07-13 16:42:27 UTC
(rev 1622)
@@ -23,7 +23,7 @@
<name>panel2</name>
<classname>org.richfaces.taglib.Panel2Tag</classname>
<superclass>
- org.ajax4jsf.framework.taglib.HtmlComponentTagBase
+ org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
</superclass>
<test>
<classname>org.richfaces.taglib.HtmlPanel2TagTest</classname>
Modified: trunk/sandbox/ui/panel2/src/main/templates/panel2.jspx
===================================================================
--- trunk/sandbox/ui/panel2/src/main/templates/panel2.jspx 2007-07-13 13:14:47 UTC (rev
1621)
+++ trunk/sandbox/ui/panel2/src/main/templates/panel2.jspx 2007-07-13 16:42:27 UTC (rev
1622)
@@ -6,7 +6,7 @@
xmlns:x="
http://jsf.exadel.com/vcp"
xmlns:u="http://jsf.exadel.com/util"
xmlns:h="http://jsf.exadel.com/header"
- baseclass="org.ajax4jsf.framework.renderer.HeaderResourcesRendererBase"
+ baseclass="org.ajax4jsf.renderkit.HeaderResourcesRendererBase"
class="org.richfaces.renderkit.html.Panel2Renderer">
<f:clientid var="clientId"/>
Modified: trunk/sandbox/ui/panelmenu/pom.xml
===================================================================
--- trunk/sandbox/ui/panelmenu/pom.xml 2007-07-13 13:14:47 UTC (rev 1621)
+++ trunk/sandbox/ui/panelmenu/pom.xml 2007-07-13 16:42:27 UTC (rev 1622)
@@ -1,51 +1,50 @@
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>ui</artifactId>
- <groupId>org.richfaces</groupId>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>ui</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
<version>3.1.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces</groupId>
- <artifactId>panelmenu</artifactId>
- <name>Panel menu</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-cdk-plugin</artifactId>
- <version>3.1.0-SNAPSHOT</version>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- <execution>
- <id>generate-test-sources</id>
- <phase>generate-test-sources</phase>
- <goals>
- <goal>generate-tests</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <library>
- <prefix>org.richfaces</prefix>
- <taglib>
- <shortName>panelmenu</shortName>
- </taglib>
- </library>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>common</artifactId>
- <version>3.1.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.sandbox.ui</groupId>
+ <artifactId>panelmenu</artifactId>
+ <name>Panel menu</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>3.1.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>generate-test-sources</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>generate-tests</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <library>
+ <prefix>org.richfaces</prefix>
+ <taglib>
+ <shortName>panelmenu</shortName>
+ </taglib>
+ </library>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
</project>
\ No newline at end of file
Modified: trunk/sandbox/ui/panelmenu/src/main/config/component/panelMenu.xml
===================================================================
--- trunk/sandbox/ui/panelmenu/src/main/config/component/panelMenu.xml 2007-07-13 13:14:47
UTC (rev 1621)
+++ trunk/sandbox/ui/panelmenu/src/main/config/component/panelMenu.xml 2007-07-13 16:42:27
UTC (rev 1622)
@@ -1,257 +1,257 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
"https://ajax4jsf.dev.java.net/nonav/dtds/component-config.dtd" >
-<components>
- <component>
- <name>org.richfaces.PanelMenu</name>
- <family>org.richfaces.PanelMenu</family>
- <description>Defines the menu on the page and the set of the child elements
properties in layout.</description>
- <superclass>org.richfaces.component.UIPanelMenu</superclass>
- <classname>org.richfaces.component.html.HtmlPanelMenu</classname>
- <renderer generate="true" override="true">
- <name>org.richfaces.PanelMenuRenderer</name>
- <template>org/richfaces/htmlPanelMenu.jspx</template>
- </renderer>
- <tag>
- <name>panelMenu</name>
- <classname>org.richfaces.taglib.PanelMenuTag</classname>
- <superclass>org.ajax4jsf.framework.taglib.HtmlComponentTagBase</superclass>
- </tag>
- <property>
- <name>event</name>
- <classname>java.lang.String</classname>
- <description>
- Defines the event on the representation element that
- triggers the submenu's expand/collapse. (default=onclick)
- </description>
- <defaultvalue><![CDATA["onclick"]]></defaultvalue>
- </property>
- <property>
- <name>mode</name>
- <classname>java.lang.String</classname>
- <description>
- Set the submission mode for all panel menu items on the panel
- menu except ones where this attribute redefined. (ajax, server,(Default), none)
- </description>
- <defaultvalue><![CDATA["server"]]></defaultvalue>
- </property>
- <property>
- <name>width</name>
- <classname>java.lang.String</classname>
- <description>Set minimal width for the menu.</description>
- <defaultvalue><![CDATA["100%"]]></defaultvalue>
- </property>
- <property>
- <name>expandMode</name>
- <classname>java.lang.String</classname>
- <description>
- Set the submission mode for all panel menu groups after
- expand/collapse except ones where this attribute redefined. (ajax, server,
none(Default))
- </description>
- <defaultvalue><![CDATA["none"]]></defaultvalue>
- </property>
- <property>
- <name>expandSingle</name>
- <classname>boolean</classname>
- <description>
- Whether only one panel menu node on top level can be opened at a time.
- If the value of this attribute is true, the previously opened
- node on the top level is closed. If the value is false, the node is left opened. The
default value is false.
- </description>
- <defaultvalue>false</defaultvalue>
- </property>
- <property>
- <name>iconItem</name>
- <classname>java.lang.String</classname>
- <description>Path to the icon to be displayed for the enabled item
state</description>
- <defaultvalue><![CDATA["grid"]]></defaultvalue>
- </property>
- <property>
- <name>iconDisabledItem</name>
- <classname>java.lang.String</classname>
- <description>Path to the icon to be displayed for the disabled item
state</description>
- <defaultvalue><![CDATA["grid"]]></defaultvalue>
- </property>
- <property>
- <name>iconTopItem</name>
- <classname>java.lang.String</classname>
- <description>Path to the icon to be displayed for the enabled top item
state</description>
- <defaultvalue><![CDATA["grid"]]></defaultvalue>
- </property>
- <property>
- <name>iconTopDisabledItem</name>
- <classname>java.lang.String</classname>
- <description>Path to the icon to be displayed for the disabled top item
state</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>iconExpandedGroup</name>
- <classname>java.lang.String</classname>
- <description>Path to the icon to be displayed for the expanded Group
state</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>iconCollapsedGroup</name>
- <classname>java.lang.String</classname>
- <description>Path to the icon to be displayed for the collapsed Group
state</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>iconDisabledGroup</name>
- <classname>java.lang.String</classname>
- <description>Path to the icon to be displayed for the disabled group
state</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>iconExpandedTopGroup</name>
- <classname>java.lang.String</classname>
- <description>Path to the icon to be displayed for the expanded top group
state</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>iconCollapsedTopGroup</name>
- <classname>java.lang.String</classname>
- <description>Path to the icon to be displayed for the collapsed top group
state</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>iconTopDisableGroup</name>
- <classname>java.lang.String</classname>
- <description>Path to the icon to be displayed for the disabled top Group
state</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>iconItemPosition</name>
- <classname>java.lang.String</classname>
- <description>Position of the icon (left, right none (default) ) for the item
icon</description>
- <defaultvalue><![CDATA["left"]]></defaultvalue>
- </property>
- <property>
- <name>iconItemTopPosition</name>
- <classname>java.lang.String</classname>
- <description>Position of the icon (left, right none (default) ) for the top
item icon</description>
- <defaultvalue><![CDATA["left"]]></defaultvalue>
- </property>
- <property>
- <name>iconGroupPosition</name>
- <classname>java.lang.String</classname>
- <description>Position of the icon (left, right none (default) ) for the group
icon</description>
- <defaultvalue><![CDATA["left"]]></defaultvalue>
- </property>
- <property>
- <name>iconGroupTopPosition</name>
- <classname>java.lang.String</classname>
- <description>Position of the icon (left, right none (default) ) for the top
group icon</description>
- <defaultvalue><![CDATA["left"]]></defaultvalue>
- </property>
- <property>
- <name>style</name>
- <classname>java.lang.String</classname>
- <description>The CSS style for the panel menu.</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>styleClass</name>
- <classname>java.lang.String</classname>
- <description>The CSS class for the panel menu.</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>groupStyle</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>groupClass</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>topGroupStyle</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>topGroupClass</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>itemStyle</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>itemClass</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>topItemStyle</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>topItemClass</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>disabledItemClass</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA["dr-pmenu-disabled-element
rich-pmenu-disabled-element"]]></defaultvalue>
- </property>
- <property>
- <name>disabledItemStyle</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>disabledGroupClass</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA["dr-pmenu-disabled-element
rich-pmenu-disabled-element"]]></defaultvalue>
- </property>
- <property>
- <name>disabledGroupStyle</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>hoveredItemClass</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA["dr-pmenu-hovered-element
rich-pmenu-hovered-element"]]></defaultvalue>
- </property>
- <property>
- <name>hoveredItemStyle</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>hoveredGroupStyle</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>hoveredGroupClass</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA["dr-pmenu-hovered-element
rich-pmenu-hovered-element"]]></defaultvalue>
- </property>
- &ui_component_attributes;
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
"https://ajax4jsf.dev.java.net/nonav/dtds/component-config.dtd" >
+<components>
+ <component>
+ <name>org.richfaces.PanelMenu</name>
+ <family>org.richfaces.PanelMenu</family>
+ <description>Defines the menu on the page and the set of the child elements
properties in layout.</description>
+ <superclass>org.richfaces.component.UIPanelMenu</superclass>
+ <classname>org.richfaces.component.html.HtmlPanelMenu</classname>
+ <renderer generate="true" override="true">
+ <name>org.richfaces.PanelMenuRenderer</name>
+ <template>org/richfaces/htmlPanelMenu.jspx</template>
+ </renderer>
+ <tag>
+ <name>panelMenu</name>
+ <classname>org.richfaces.taglib.PanelMenuTag</classname>
+ <superclass>org.ajax4jsf.webapp.taglib.HtmlComponentTagBase</superclass>
+ </tag>
+ <property>
+ <name>event</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Defines the event on the representation element that
+ triggers the submenu's expand/collapse. (default=onclick)
+ </description>
+ <defaultvalue><![CDATA["onclick"]]></defaultvalue>
+ </property>
+ <property>
+ <name>mode</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Set the submission mode for all panel menu items on the panel
+ menu except ones where this attribute redefined. (ajax, server,(Default), none)
+ </description>
+ <defaultvalue><![CDATA["server"]]></defaultvalue>
+ </property>
+ <property>
+ <name>width</name>
+ <classname>java.lang.String</classname>
+ <description>Set minimal width for the menu.</description>
+ <defaultvalue><![CDATA["100%"]]></defaultvalue>
+ </property>
+ <property>
+ <name>expandMode</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Set the submission mode for all panel menu groups after
+ expand/collapse except ones where this attribute redefined. (ajax, server,
none(Default))
+ </description>
+ <defaultvalue><![CDATA["none"]]></defaultvalue>
+ </property>
+ <property>
+ <name>expandSingle</name>
+ <classname>boolean</classname>
+ <description>
+ Whether only one panel menu node on top level can be opened at a time.
+ If the value of this attribute is true, the previously opened
+ node on the top level is closed. If the value is false, the node is left opened. The
default value is false.
+ </description>
+ <defaultvalue>false</defaultvalue>
+ </property>
+ <property>
+ <name>iconItem</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the icon to be displayed for the enabled item
state</description>
+ <defaultvalue><![CDATA["grid"]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconDisabledItem</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the icon to be displayed for the disabled item
state</description>
+ <defaultvalue><![CDATA["grid"]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconTopItem</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the icon to be displayed for the enabled top item
state</description>
+ <defaultvalue><![CDATA["grid"]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconTopDisabledItem</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the icon to be displayed for the disabled top item
state</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconExpandedGroup</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the icon to be displayed for the expanded Group
state</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconCollapsedGroup</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the icon to be displayed for the collapsed Group
state</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconDisabledGroup</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the icon to be displayed for the disabled group
state</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconExpandedTopGroup</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the icon to be displayed for the expanded top group
state</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconCollapsedTopGroup</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the icon to be displayed for the collapsed top group
state</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconTopDisableGroup</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the icon to be displayed for the disabled top Group
state</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconItemPosition</name>
+ <classname>java.lang.String</classname>
+ <description>Position of the icon (left, right none (default) ) for the item
icon</description>
+ <defaultvalue><![CDATA["left"]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconItemTopPosition</name>
+ <classname>java.lang.String</classname>
+ <description>Position of the icon (left, right none (default) ) for the top
item icon</description>
+ <defaultvalue><![CDATA["left"]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconGroupPosition</name>
+ <classname>java.lang.String</classname>
+ <description>Position of the icon (left, right none (default) ) for the group
icon</description>
+ <defaultvalue><![CDATA["left"]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconGroupTopPosition</name>
+ <classname>java.lang.String</classname>
+ <description>Position of the icon (left, right none (default) ) for the top
group icon</description>
+ <defaultvalue><![CDATA["left"]]></defaultvalue>
+ </property>
+ <property>
+ <name>style</name>
+ <classname>java.lang.String</classname>
+ <description>The CSS style for the panel menu.</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>styleClass</name>
+ <classname>java.lang.String</classname>
+ <description>The CSS class for the panel menu.</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>groupStyle</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>groupClass</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>topGroupStyle</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>topGroupClass</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>itemStyle</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>itemClass</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>topItemStyle</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>topItemClass</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>disabledItemClass</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA["dr-pmenu-disabled-element
rich-pmenu-disabled-element"]]></defaultvalue>
+ </property>
+ <property>
+ <name>disabledItemStyle</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>disabledGroupClass</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA["dr-pmenu-disabled-element
rich-pmenu-disabled-element"]]></defaultvalue>
+ </property>
+ <property>
+ <name>disabledGroupStyle</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>hoveredItemClass</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA["dr-pmenu-hovered-element
rich-pmenu-hovered-element"]]></defaultvalue>
+ </property>
+ <property>
+ <name>hoveredItemStyle</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>hoveredGroupStyle</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>hoveredGroupClass</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA["dr-pmenu-hovered-element
rich-pmenu-hovered-element"]]></defaultvalue>
+ </property>
+ &ui_component_attributes;
&html_events;
<property>
@@ -286,290 +286,290 @@
</property>
-
- <property>
- <name>onitemhover</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>ongroupcollapse</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>ongroupexpand</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>disabled</name>
- <classname>boolean</classname>
- <description>
- If true sets state of the item to disabled state. false is default.
- </description>
- <defaultvalue>false</defaultvalue>
- </property>
- </component>
-
- <component>
- <name>org.richfaces.PanelMenuGroup</name>
- <family>org.richfaces.PanelMenuGroup</family>
- <description>Defines expandable group of items inside the panel menu or other
group.</description>
- <superclass>org.richfaces.component.UIPanelMenuGroup</superclass>
- <classname>org.richfaces.component.html.HtmlPanelMenuGroup</classname>
- <renderer generate="true" override="true">
- <name>org.richfaces.PanelMenuGroupRenderer</name>
- <template>org/richfaces/htmlPanelMenuGroup.jspx</template>
- </renderer>
- <tag>
- <name>panelMenuGroup</name>
- <classname>org.richfaces.taglib.PanelMenuGroupTag</classname>
- <superclass>org.ajax4jsf.framework.taglib.HtmlComponentTagBase</superclass>
- </tag>
- <property>
- <name>mode</name>
- <classname>java.lang.String</classname>
- <description>
- Set the submission mode for all panel menu groups after expand/collapse
- except ones where this attribute redefined. (ajax, server, none(Default))
- </description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>iconExpanded</name>
- <classname>java.lang.String</classname>
- <description>Path to the icon to be displayed for the expanded item
state</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>iconCollapsed</name>
- <classname>java.lang.String</classname>
- <description>Path to the icon to be displayed for the collapsed item
state</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
+
+ <property>
+ <name>onitemhover</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
+ <property>
+ <name>ongroupcollapse</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>ongroupexpand</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>disabled</name>
+ <classname>boolean</classname>
+ <description>
+ If true sets state of the item to disabled state. false is default.
+ </description>
+ <defaultvalue>false</defaultvalue>
+ </property>
+ </component>
+
+ <component>
+ <name>org.richfaces.PanelMenuGroup</name>
+ <family>org.richfaces.PanelMenuGroup</family>
+ <description>Defines expandable group of items inside the panel menu or other
group.</description>
+ <superclass>org.richfaces.component.UIPanelMenuGroup</superclass>
+ <classname>org.richfaces.component.html.HtmlPanelMenuGroup</classname>
+ <renderer generate="true" override="true">
+ <name>org.richfaces.PanelMenuGroupRenderer</name>
+ <template>org/richfaces/htmlPanelMenuGroup.jspx</template>
+ </renderer>
+ <tag>
+ <name>panelMenuGroup</name>
+ <classname>org.richfaces.taglib.PanelMenuGroupTag</classname>
+ <superclass>org.ajax4jsf.webapp.taglib.HtmlComponentTagBase</superclass>
+ </tag>
<property>
+ <name>mode</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Set the submission mode for all panel menu groups after expand/collapse
+ except ones where this attribute redefined. (ajax, server, none(Default))
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconExpanded</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the icon to be displayed for the expanded item
state</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconCollapsed</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the icon to be displayed for the collapsed item
state</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
<name>expanded</name>
<classname>boolean</classname>
<description>If “true” group will be displayed expanded
initially.</description>
<defaultvalue>false</defaultvalue>
</property>
- <property>
- <name>iconDisabled</name>
- <classname>java.lang.String</classname>
- <description>Path to the icon to be displayed for the disabled item
state</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>disabled</name>
- <classname>boolean</classname>
- <description>
- If “true” sets state of the item to disabled state. “false” is default.
- </description>
- <defaultvalue>false</defaultvalue>
- </property>
- <!--property>
- <name>value</name>
- <classname>java.lang.Object</classname>
- <description>Defines representation text for menuItem.</description>
- </property-->
- &listeners;
- <!--property>
- <name>action</name>
- <classname>java.lang.String</classname>
- <description>The action method binding expression.</description>
- </property-->
- <property>
- <name>target</name>
- <classname>java.lang.String</classname>
- <description>Target frame for action to execute.</description>
- </property>
- <property>
- <name>immediate</name>
- <classname>boolean</classname>
- <description>A flag indicating that this component value must be converted and
validated immediately (that is, during Apply Request Values phase), rather than waiting
until a Process Validations phase.
- </description>
- </property>
- &ui_component_attributes;
- &html_input_attributes;
- &html_input_events;
- &ui_input_attributes;
- &html_events;
- <property>
- <name>oncollapse</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>onexpand</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>hoverClass</name>
- <classname>java.lang.String</classname>
- <description>Class to be applied to hovered items.</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>hoverStyle</name>
- <classname>java.lang.String</classname>
- <description>CSS style rules to be applied to hovered
items.</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>disabledClass</name>
- <classname>java.lang.String</classname>
- <description>Class to be applied to disabled items.</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>disabledStyle</name>
- <classname>java.lang.String</classname>
- <description>CSS style rules to be applied to disabled
items.</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>styleClass</name>
- <classname>java.lang.String</classname>
- <description>Corresponds to the HTML class attribute.</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>style</name>
- <classname>java.lang.String</classname>
- <description>CSS style(s) to be applied when this component is
rendered.</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>iconClass</name>
- <classname>java.lang.String</classname>
- <description>Class to be applied to icon element.</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>iconStyle</name>
- <classname>java.lang.String</classname>
- <description>CSS style rules to be applied</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
+ <property>
+ <name>iconDisabled</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the icon to be displayed for the disabled item
state</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
+ <name>disabled</name>
+ <classname>boolean</classname>
+ <description>
+ If “true” sets state of the item to disabled state. “false” is default.
+ </description>
+ <defaultvalue>false</defaultvalue>
+ </property>
+ <!--property>
+ <name>value</name>
+ <classname>java.lang.Object</classname>
+ <description>Defines representation text for menuItem.</description>
+ </property-->
+ &listeners;
+ <!--property>
+ <name>action</name>
+ <classname>java.lang.String</classname>
+ <description>The action method binding expression.</description>
+ </property-->
+ <property>
+ <name>target</name>
+ <classname>java.lang.String</classname>
+ <description>Target frame for action to execute.</description>
+ </property>
+ <property>
+ <name>immediate</name>
+ <classname>boolean</classname>
+ <description>A flag indicating that this component value must be converted and
validated immediately (that is, during Apply Request Values phase), rather than waiting
until a Process Validations phase.
+ </description>
+ </property>
+ &ui_component_attributes;
+ &html_input_attributes;
+ &html_input_events;
+ &ui_input_attributes;
+ &html_events;
+ <property>
+ <name>oncollapse</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>onexpand</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>hoverClass</name>
+ <classname>java.lang.String</classname>
+ <description>Class to be applied to hovered items.</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>hoverStyle</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style rules to be applied to hovered
items.</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>disabledClass</name>
+ <classname>java.lang.String</classname>
+ <description>Class to be applied to disabled items.</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>disabledStyle</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style rules to be applied to disabled
items.</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>styleClass</name>
+ <classname>java.lang.String</classname>
+ <description>Corresponds to the HTML class attribute.</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>style</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style(s) to be applied when this component is
rendered.</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconClass</name>
+ <classname>java.lang.String</classname>
+ <description>Class to be applied to icon element.</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconStyle</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style rules to be applied</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
<name>label</name>
<classname>java.lang.String</classname>
<description>Displayed node's text</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
- </component>
-
- <component>
- <name>org.richfaces.PanelMenuItem</name>
- <family>org.richfaces.PanelMenuItem</family>
- <description>Defines single Item inside popup list.</description>
- <superclass>org.richfaces.component.UIPanelMenuItem</superclass>
- <classname>org.richfaces.component.html.HtmlPanelMenuItem</classname>
- <renderer generate="true" override="true">
- <name>org.richfaces.PanelMenuItemRenderer</name>
- <template>org/richfaces/htmlPanelMenuItem.jspx</template>
- </renderer>
- <tag>
- <name>panelMenuItem</name>
- <classname>org.richfaces.taglib.PanelMenuItemTag</classname>
- <superclass>org.ajax4jsf.framework.taglib.HtmlComponentTagBase</superclass>
- </tag>
- <property>
- <name>mode</name>
- <classname>java.lang.String</classname>
- <description>
- Set the submission mode (ajax,server(Default),none)
- </description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>icon</name>
- <classname>java.lang.String</classname>
- <description>Path to the icon or the default one name to be displayed for the
enabled item state</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>iconDisabled</name>
- <classname>java.lang.String</classname>
- <description>Path to the icon to be displayed for the disabled item
state</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>disabled</name>
- <classname>boolean</classname>
- <description>
- If “true” sets state of the item to disabled state. “false” is default.
- </description>
- <defaultvalue>false</defaultvalue>
- </property>
- <property>
- <name>value</name>
- <classname>java.lang.Object</classname>
- <description>Defines representation text for menuItem.</description>
- </property>
- <property>
- <name>hoverClass</name>
- <classname>java.lang.String</classname>
- <description>Class to be applied to hovered items.</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>hoverStyle</name>
- <classname>java.lang.String</classname>
- <description>CSS style rules to be applied to hovered
items.</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>disabledClass</name>
- <classname>java.lang.String</classname>
- <description>Class to be applied to disabled items.</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>disabledStyle</name>
- <classname>java.lang.String</classname>
- <description>CSS style rules to be applied to disabled
items.</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>styleClass</name>
- <classname>java.lang.String</classname>
- <description>Corresponds to the HTML class attribute.</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>style</name>
- <classname>java.lang.String</classname>
- <description>CSS style(s) to be applied when this component is
rendered.</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>iconClass</name>
- <classname>java.lang.String</classname>
- <description>Class to be applied to icon element.</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>iconStyle</name>
- <classname>java.lang.String</classname>
- <description>CSS style rules to be applied</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- &ui_component_attributes;
- &ui_command_attributes;
- &html_style_attributes;
- &html_events;
- <property>
- <name>target</name>
- <classname>java.lang.String</classname>
- <description>Target frame for action to execute.</description>
- </property>
- </component>
+ </component>
+
+ <component>
+ <name>org.richfaces.PanelMenuItem</name>
+ <family>org.richfaces.PanelMenuItem</family>
+ <description>Defines single Item inside popup list.</description>
+ <superclass>org.richfaces.component.UIPanelMenuItem</superclass>
+ <classname>org.richfaces.component.html.HtmlPanelMenuItem</classname>
+ <renderer generate="true" override="true">
+ <name>org.richfaces.PanelMenuItemRenderer</name>
+ <template>org/richfaces/htmlPanelMenuItem.jspx</template>
+ </renderer>
+ <tag>
+ <name>panelMenuItem</name>
+ <classname>org.richfaces.taglib.PanelMenuItemTag</classname>
+ <superclass>org.ajax4jsf.webapp.taglib.HtmlComponentTagBase</superclass>
+ </tag>
+ <property>
+ <name>mode</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Set the submission mode (ajax,server(Default),none)
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>icon</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the icon or the default one name to be displayed for the
enabled item state</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconDisabled</name>
+ <classname>java.lang.String</classname>
+ <description>Path to the icon to be displayed for the disabled item
state</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>disabled</name>
+ <classname>boolean</classname>
+ <description>
+ If “true” sets state of the item to disabled state. “false” is default.
+ </description>
+ <defaultvalue>false</defaultvalue>
+ </property>
+ <property>
+ <name>value</name>
+ <classname>java.lang.Object</classname>
+ <description>Defines representation text for menuItem.</description>
+ </property>
+ <property>
+ <name>hoverClass</name>
+ <classname>java.lang.String</classname>
+ <description>Class to be applied to hovered items.</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>hoverStyle</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style rules to be applied to hovered
items.</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>disabledClass</name>
+ <classname>java.lang.String</classname>
+ <description>Class to be applied to disabled items.</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>disabledStyle</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style rules to be applied to disabled
items.</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>styleClass</name>
+ <classname>java.lang.String</classname>
+ <description>Corresponds to the HTML class attribute.</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>style</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style(s) to be applied when this component is
rendered.</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconClass</name>
+ <classname>java.lang.String</classname>
+ <description>Class to be applied to icon element.</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>iconStyle</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style rules to be applied</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ &ui_component_attributes;
+ &ui_command_attributes;
+ &html_style_attributes;
+ &html_events;
+ <property>
+ <name>target</name>
+ <classname>java.lang.String</classname>
+ <description>Target frame for action to execute.</description>
+ </property>
+ </component>
</components>
\ No newline at end of file
Modified:
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRendererBase.java
===================================================================
---
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRendererBase.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRendererBase.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -30,8 +30,8 @@
import javax.faces.context.ResponseWriter;
import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
import org.ajax4jsf.renderkit.compiler.TemplateContext;
-import org.ajax4jsf.framework.skin.Skin;
-import org.ajax4jsf.framework.util.style.CSSFormat;
+import org.richfaces.skin.Skin;
+import org.ajax4jsf.util.style.CSSFormat;
import org.richfaces.component.UIPanelMenu;
import org.richfaces.component.UIPanelMenuGroup;
import org.richfaces.component.UIPanelMenuItem;
Modified:
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
===================================================================
---
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -1,280 +1,280 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html;
-
-import java.io.IOException;
-import java.util.Map;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import javax.faces.convert.ConverterException;
-import javax.faces.event.ActionEvent;
-import org.ajax4jsf.framework.ajax.AjaxEvent;
-import org.richfaces.component.UIPanelMenu;
-import org.richfaces.component.UIPanelMenuGroup;
-import org.richfaces.component.UISwitchablePanel;
-import org.richfaces.renderkit.PanelMenuRendererBase;
-
-public class PanelMenuGroupRenderer extends PanelMenuRendererBase {
-
- protected Class getComponentClass() {
- return UIPanelMenuGroup.class;
- }
-
- protected void doDecode(FacesContext context, UIComponent component) {
- String clientId = component.getClientId(context);
- Map requestMap =context.getExternalContext().getRequestParameterMap();
- UIPanelMenuGroup group = ((UIPanelMenuGroup)component);
-
- if(requestMap.containsKey("panelMenuState"+clientId)){
- Object property = requestMap.get("panelMenuState"+clientId);
- if (property.equals("opened")) {
- group.setSubmittedValue("true");
- } else if (property.equals("closed")) {
- group.setSubmittedValue("false");
- }
-
- }
- if(isSubmitted(context, component)){
- new ActionEvent(component).queue();
- if (UISwitchablePanel.AJAX_METHOD.equals(getItemMode(component))) {
- new AjaxEvent(component).queue();
- }
- }
- }
-
- public void insertImage(FacesContext context, UIComponent component, Object data)
- throws IOException {
-
- String from = (String)data;
- String align = "";
-
- UIPanelMenu panelMenu = findMenu(component);
- boolean isTopLevel = isTopLevel(component);
-
- if (isTopLevel){
- align = panelMenu.getIconGroupTopPosition();
- } else {
- align = panelMenu.getIconGroupPosition();
- }
-
- if (align.equalsIgnoreCase(from)){
- image(context,component, from + "Icon" + component.getClientId(context));
- } else {
- String iconType = PANEL_MENU_SPACER_ICON_NAME;
- String imageSrc = getIconByType(iconType, isTopLevel, context, component);
- drawIcon(context.getResponseWriter(), iconType, imageSrc, component, from +
"Icon" + component.getClientId(context));
- }
- }
-
- private void image(FacesContext context, UIComponent component, String id )throws
IOException {
- ResponseWriter writer = context.getResponseWriter();
-
- UIPanelMenu panelMenu = findMenu(component);
- if(panelMenu == null){
- return;
- }
- UIPanelMenuGroup panelMenuGroup = (UIPanelMenuGroup)component;
- boolean isTopLevel = isTopLevel(panelMenuGroup);
-
- boolean isOpened = isOpened(context,component);
-
-
- String defaultIconNodeClosed = null;
-
- if(isTopLevel){
- if(panelMenuGroup.isDisabled()){
- defaultIconNodeClosed = panelMenu.getIconTopDisableGroup();
- if(defaultIconNodeClosed == null || defaultIconNodeClosed.equals("")){
- defaultIconNodeClosed = panelMenu.getIconDisabledGroup();
- }
- } else {
- defaultIconNodeClosed = panelMenu.getIconCollapsedTopGroup();
- if(defaultIconNodeClosed == null || defaultIconNodeClosed.equals("")){
- defaultIconNodeClosed = panelMenu.getIconCollapsedGroup();
- }
- }
- } else {
- if(panelMenuGroup.isDisabled()){
- defaultIconNodeClosed = panelMenu.getIconDisabledGroup();
- } else {
- defaultIconNodeClosed = panelMenu.getIconCollapsedGroup();
- }
- }
-
- String defaultIconNodeOpened = null;
-
- if(isTopLevel){
- defaultIconNodeOpened = panelMenu.getIconExpandedTopGroup();
- if(defaultIconNodeOpened == null || defaultIconNodeOpened.equals("")){
- defaultIconNodeOpened = panelMenu.getIconExpandedGroup();
- }
- } else {
- defaultIconNodeOpened = panelMenu.getIconExpandedGroup();
- }
-
- String iconExpanded = "";
- String iconCollapsed = "";
-
- iconExpanded = panelMenuGroup.isDisabled() ? panelMenuGroup.getIconDisabled() :
panelMenuGroup.getIconExpanded();
- iconCollapsed = panelMenuGroup.isDisabled() ? panelMenuGroup.getIconDisabled() :
panelMenuGroup.getIconCollapsed();
-
- String icon = null;
- if(isOpened){
- if(iconExpanded != null && !iconExpanded.equals("")){
- if(iconExpanded.equals("none")){
- return;
- } else {
- icon = iconExpanded;
- }
- } else {
- icon = defaultIconNodeOpened;
- }
- } else {
- if(iconCollapsed!= null && !iconCollapsed.equals("")){
- if(iconCollapsed.equals("none")){
- return;
- } else {
- icon = iconCollapsed;
- }
- } else {
- icon = defaultIconNodeClosed;
- }
- }
-
- if ("".equals(icon))
- icon = "custom";
- String source = getIconByType(icon, isTopLevel, context, component);
- drawIcon(writer, icon, source, component, id);
- }
-
- public String getFullStyleClass(FacesContext context, UIComponent component) {
- StringBuffer classBuffer = new StringBuffer("");
- UIPanelMenuGroup group = (UIPanelMenuGroup)component;
- UIPanelMenu parentMenu = findMenu(group);
- if (!parentMenu.isDisabled() && !group.isDisabled()) {
- if (calculateLevel(group) == 0)
- classBuffer.append(parentMenu.getTopGroupClass() + " ");
- else
- classBuffer.append(parentMenu.getGroupClass() + " ");
- classBuffer.append(group.getStyleClass());
- } else
- classBuffer.append(parentMenu.getDisabledGroupClass() + " ")
- .append(group.getDisabledClass());
- return classBuffer.toString();
- }
-
- public String getFullStyle(FacesContext context, UIComponent component) {
- StringBuffer styleBuffer = new StringBuffer("");
- UIPanelMenuGroup group = (UIPanelMenuGroup)component;
- UIPanelMenu parentMenu = findMenu(group);
- if (!group.isDisabled()) {
- if (calculateLevel(group) == 0)
- styleBuffer.append(parentMenu.getTopGroupStyle() + "; ");
- else
- styleBuffer.append(parentMenu.getGroupStyle() + "; ");
- styleBuffer.append(group.getStyle());
- } else
- styleBuffer.append(parentMenu.getDisabledGroupStyle() + "; ")
- .append(group.getDisabledStyle());
- return styleBuffer.toString();
- }
-
- public void insertLabel(FacesContext context, UIComponent component) throws IOException
{
- Object label = component.getAttributes().get("label");
- if (label!=null){
- context.getResponseWriter().write(label.toString());
- }
- }
-
- public Object getConvertedValue(FacesContext context,
- UIComponent component, Object submittedValue)
- throws ConverterException {
-
- UIPanelMenuGroup group = (UIPanelMenuGroup)component;
- if(group.getConverter() != null){
- return group.getConverter().getAsObject(context, component, (String)submittedValue);
- } else {
- return submittedValue;
- }
-
- }
-
- public boolean isOpened(FacesContext context, UIComponent component)throws IOException
{
- UIPanelMenuGroup group = (UIPanelMenuGroup)component;
-
- Boolean value = (Boolean)group.getValue();
- if (value != null) {
- return value.booleanValue();
- } else {
- boolean isParentDisabled = isParentDisabled(component);
- if(component instanceof UIPanelMenuGroup){
- if( ((UIPanelMenuGroup)component).isExpanded() &&
!((UIPanelMenuGroup)component).isDisabled() && !isParentDisabled ){
- return true;
- } else {
- //check expanded attributes in children groups, if exists
- boolean isChildrenExpanded = isChildrenExpanded(component);
- return isChildrenExpanded && !isParentDisabled &&
!((UIPanelMenuGroup)component).isDisabled();// ? "opened" : "closed";
- }
- }
- }
- return false;
- }
-
- public String getLabelClass(FacesContext context, UIComponent component) {
- UIPanelMenuGroup group = (UIPanelMenuGroup)component;
- UIPanelMenu parentMenu = findMenu(group);
- if(!group.isDisabled() && !parentMenu.isDisabled()){
- if(isTopLevel(component)){
- return "rich-pmenu-group-self-label rich-pmenu-top-group-self-label";
- } else return "rich-pmenu-group-self-label";
- }
- return "";
- }
-
- public String getIconClass(FacesContext context, UIComponent component) {
- UIPanelMenuGroup group = (UIPanelMenuGroup)component;
- UIPanelMenu parentMenu = findMenu(group);
- if(!group.isDisabled() && !parentMenu.isDisabled()){
- if(isTopLevel(component)){
- return "rich-pmenu-group-self-icon rich-pmenu-top-group-self-icon";
- } else return "rich-pmenu-group-self-icon";
- }
- return "";
- }
-
- public String getDivClass(FacesContext context, UIComponent component) {
- String result = "";
- if (isTopLevel(component))
- result = "dr-pmenu-group-div";
- return result;
- }
-
- public String getTableClass(FacesContext context, UIComponent component) {
- String result;
- if (isTopLevel(component))
- result = "dr-pmenu-top-group";
- else
- result = "dr-pmenu-group";
- return result;
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+import java.util.Map;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.convert.ConverterException;
+import javax.faces.event.ActionEvent;
+import org.ajax4jsf.event.AjaxEvent;
+import org.richfaces.component.UIPanelMenu;
+import org.richfaces.component.UIPanelMenuGroup;
+import org.richfaces.component.UISwitchablePanel;
+import org.richfaces.renderkit.PanelMenuRendererBase;
+
+public class PanelMenuGroupRenderer extends PanelMenuRendererBase {
+
+ protected Class getComponentClass() {
+ return UIPanelMenuGroup.class;
+ }
+
+ protected void doDecode(FacesContext context, UIComponent component) {
+ String clientId = component.getClientId(context);
+ Map requestMap =context.getExternalContext().getRequestParameterMap();
+ UIPanelMenuGroup group = ((UIPanelMenuGroup)component);
+
+ if(requestMap.containsKey("panelMenuState"+clientId)){
+ Object property = requestMap.get("panelMenuState"+clientId);
+ if (property.equals("opened")) {
+ group.setSubmittedValue("true");
+ } else if (property.equals("closed")) {
+ group.setSubmittedValue("false");
+ }
+
+ }
+ if(isSubmitted(context, component)){
+ new ActionEvent(component).queue();
+ if (UISwitchablePanel.AJAX_METHOD.equals(getItemMode(component))) {
+ new AjaxEvent(component).queue();
+ }
+ }
+ }
+
+ public void insertImage(FacesContext context, UIComponent component, Object data)
+ throws IOException {
+
+ String from = (String)data;
+ String align = "";
+
+ UIPanelMenu panelMenu = findMenu(component);
+ boolean isTopLevel = isTopLevel(component);
+
+ if (isTopLevel){
+ align = panelMenu.getIconGroupTopPosition();
+ } else {
+ align = panelMenu.getIconGroupPosition();
+ }
+
+ if (align.equalsIgnoreCase(from)){
+ image(context,component, from + "Icon" + component.getClientId(context));
+ } else {
+ String iconType = PANEL_MENU_SPACER_ICON_NAME;
+ String imageSrc = getIconByType(iconType, isTopLevel, context, component);
+ drawIcon(context.getResponseWriter(), iconType, imageSrc, component, from +
"Icon" + component.getClientId(context));
+ }
+ }
+
+ private void image(FacesContext context, UIComponent component, String id )throws
IOException {
+ ResponseWriter writer = context.getResponseWriter();
+
+ UIPanelMenu panelMenu = findMenu(component);
+ if(panelMenu == null){
+ return;
+ }
+ UIPanelMenuGroup panelMenuGroup = (UIPanelMenuGroup)component;
+ boolean isTopLevel = isTopLevel(panelMenuGroup);
+
+ boolean isOpened = isOpened(context,component);
+
+
+ String defaultIconNodeClosed = null;
+
+ if(isTopLevel){
+ if(panelMenuGroup.isDisabled()){
+ defaultIconNodeClosed = panelMenu.getIconTopDisableGroup();
+ if(defaultIconNodeClosed == null || defaultIconNodeClosed.equals("")){
+ defaultIconNodeClosed = panelMenu.getIconDisabledGroup();
+ }
+ } else {
+ defaultIconNodeClosed = panelMenu.getIconCollapsedTopGroup();
+ if(defaultIconNodeClosed == null || defaultIconNodeClosed.equals("")){
+ defaultIconNodeClosed = panelMenu.getIconCollapsedGroup();
+ }
+ }
+ } else {
+ if(panelMenuGroup.isDisabled()){
+ defaultIconNodeClosed = panelMenu.getIconDisabledGroup();
+ } else {
+ defaultIconNodeClosed = panelMenu.getIconCollapsedGroup();
+ }
+ }
+
+ String defaultIconNodeOpened = null;
+
+ if(isTopLevel){
+ defaultIconNodeOpened = panelMenu.getIconExpandedTopGroup();
+ if(defaultIconNodeOpened == null || defaultIconNodeOpened.equals("")){
+ defaultIconNodeOpened = panelMenu.getIconExpandedGroup();
+ }
+ } else {
+ defaultIconNodeOpened = panelMenu.getIconExpandedGroup();
+ }
+
+ String iconExpanded = "";
+ String iconCollapsed = "";
+
+ iconExpanded = panelMenuGroup.isDisabled() ? panelMenuGroup.getIconDisabled() :
panelMenuGroup.getIconExpanded();
+ iconCollapsed = panelMenuGroup.isDisabled() ? panelMenuGroup.getIconDisabled() :
panelMenuGroup.getIconCollapsed();
+
+ String icon = null;
+ if(isOpened){
+ if(iconExpanded != null && !iconExpanded.equals("")){
+ if(iconExpanded.equals("none")){
+ return;
+ } else {
+ icon = iconExpanded;
+ }
+ } else {
+ icon = defaultIconNodeOpened;
+ }
+ } else {
+ if(iconCollapsed!= null && !iconCollapsed.equals("")){
+ if(iconCollapsed.equals("none")){
+ return;
+ } else {
+ icon = iconCollapsed;
+ }
+ } else {
+ icon = defaultIconNodeClosed;
+ }
+ }
+
+ if ("".equals(icon))
+ icon = "custom";
+ String source = getIconByType(icon, isTopLevel, context, component);
+ drawIcon(writer, icon, source, component, id);
+ }
+
+ public String getFullStyleClass(FacesContext context, UIComponent component) {
+ StringBuffer classBuffer = new StringBuffer("");
+ UIPanelMenuGroup group = (UIPanelMenuGroup)component;
+ UIPanelMenu parentMenu = findMenu(group);
+ if (!parentMenu.isDisabled() && !group.isDisabled()) {
+ if (calculateLevel(group) == 0)
+ classBuffer.append(parentMenu.getTopGroupClass() + " ");
+ else
+ classBuffer.append(parentMenu.getGroupClass() + " ");
+ classBuffer.append(group.getStyleClass());
+ } else
+ classBuffer.append(parentMenu.getDisabledGroupClass() + " ")
+ .append(group.getDisabledClass());
+ return classBuffer.toString();
+ }
+
+ public String getFullStyle(FacesContext context, UIComponent component) {
+ StringBuffer styleBuffer = new StringBuffer("");
+ UIPanelMenuGroup group = (UIPanelMenuGroup)component;
+ UIPanelMenu parentMenu = findMenu(group);
+ if (!group.isDisabled()) {
+ if (calculateLevel(group) == 0)
+ styleBuffer.append(parentMenu.getTopGroupStyle() + "; ");
+ else
+ styleBuffer.append(parentMenu.getGroupStyle() + "; ");
+ styleBuffer.append(group.getStyle());
+ } else
+ styleBuffer.append(parentMenu.getDisabledGroupStyle() + "; ")
+ .append(group.getDisabledStyle());
+ return styleBuffer.toString();
+ }
+
+ public void insertLabel(FacesContext context, UIComponent component) throws IOException
{
+ Object label = component.getAttributes().get("label");
+ if (label!=null){
+ context.getResponseWriter().write(label.toString());
+ }
+ }
+
+ public Object getConvertedValue(FacesContext context,
+ UIComponent component, Object submittedValue)
+ throws ConverterException {
+
+ UIPanelMenuGroup group = (UIPanelMenuGroup)component;
+ if(group.getConverter() != null){
+ return group.getConverter().getAsObject(context, component, (String)submittedValue);
+ } else {
+ return submittedValue;
+ }
+
+ }
+
+ public boolean isOpened(FacesContext context, UIComponent component)throws IOException
{
+ UIPanelMenuGroup group = (UIPanelMenuGroup)component;
+
+ Boolean value = (Boolean)group.getValue();
+ if (value != null) {
+ return value.booleanValue();
+ } else {
+ boolean isParentDisabled = isParentDisabled(component);
+ if(component instanceof UIPanelMenuGroup){
+ if( ((UIPanelMenuGroup)component).isExpanded() &&
!((UIPanelMenuGroup)component).isDisabled() && !isParentDisabled ){
+ return true;
+ } else {
+ //check expanded attributes in children groups, if exists
+ boolean isChildrenExpanded = isChildrenExpanded(component);
+ return isChildrenExpanded && !isParentDisabled &&
!((UIPanelMenuGroup)component).isDisabled();// ? "opened" : "closed";
+ }
+ }
+ }
+ return false;
+ }
+
+ public String getLabelClass(FacesContext context, UIComponent component) {
+ UIPanelMenuGroup group = (UIPanelMenuGroup)component;
+ UIPanelMenu parentMenu = findMenu(group);
+ if(!group.isDisabled() && !parentMenu.isDisabled()){
+ if(isTopLevel(component)){
+ return "rich-pmenu-group-self-label rich-pmenu-top-group-self-label";
+ } else return "rich-pmenu-group-self-label";
+ }
+ return "";
+ }
+
+ public String getIconClass(FacesContext context, UIComponent component) {
+ UIPanelMenuGroup group = (UIPanelMenuGroup)component;
+ UIPanelMenu parentMenu = findMenu(group);
+ if(!group.isDisabled() && !parentMenu.isDisabled()){
+ if(isTopLevel(component)){
+ return "rich-pmenu-group-self-icon rich-pmenu-top-group-self-icon";
+ } else return "rich-pmenu-group-self-icon";
+ }
+ return "";
+ }
+
+ public String getDivClass(FacesContext context, UIComponent component) {
+ String result = "";
+ if (isTopLevel(component))
+ result = "dr-pmenu-group-div";
+ return result;
+ }
+
+ public String getTableClass(FacesContext context, UIComponent component) {
+ String result;
+ if (isTopLevel(component))
+ result = "dr-pmenu-top-group";
+ else
+ result = "dr-pmenu-group";
+ return result;
+ }
+}
Modified:
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
===================================================================
---
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -1,192 +1,192 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html;
-
-import java.io.IOException;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import javax.faces.event.ActionEvent;
-
-import org.ajax4jsf.framework.ajax.AjaxEvent;
-import org.richfaces.component.UIPanelMenu;
-import org.richfaces.component.UIPanelMenuItem;
-import org.richfaces.renderkit.PanelMenuRendererBase;
-
-public class PanelMenuItemRenderer extends PanelMenuRendererBase {
- protected Class getComponentClass() {
- return UIPanelMenuItem.class;
- }
-
- protected void doEncodeBegin(ResponseWriter writer, FacesContext context,UIComponent
component) throws IOException {
-
- }
- protected void doDecode(FacesContext context, UIComponent component) {
- if(isSubmitted(context, component)) {
- new ActionEvent(component).queue();
- if ("ajax".equals(getItemMode(component))) {
- new AjaxEvent(component).queue();
- } else {
-
- }
- }
- }
-
- protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException {
-
- }
-
- /*
- public String getOnClick(FacesContext context, UIComponent component) {
- String clientId = component.getClientId(context);
- return ";PanelMenuStorage['" + clientId +
"'].trigger(event);";
- }
- */
- public void insertImage(FacesContext context, UIComponent component, Object data) throws
IOException {
- String from = (String)data;
- UIPanelMenu panelMenu = findMenu(component);
- if(panelMenu == null){
- return;
- }
- String align = "";
- UIPanelMenuItem panelMenuItem = (UIPanelMenuItem)component;
- boolean isTopLevel = isTopLevel(panelMenuItem);
-
- if (isTopLevel){
- align = panelMenu.getIconItemTopPosition();
- } else {
- align = panelMenu.getIconItemPosition();
- }
-
- if (align.equalsIgnoreCase(from)){
- image(context,component, from);
- } else {
- String iconType = PANEL_MENU_SPACER_ICON_NAME;
- String imageSrc = getIconByType(iconType, isTopLevel, context, component);
- drawIcon(context.getResponseWriter(), iconType, imageSrc, component, from +
"Icon" + component.getClientId(context));
- }
- }
-
- private void image(FacesContext context, UIComponent component, String from)
- throws IOException{
-
- UIPanelMenu panelMenu = findMenu(component);
- ResponseWriter writer = context.getResponseWriter();
- boolean isTopLevel = isTopLevel(component);
- String source = null;
- String iconType = null;
- UIPanelMenuItem item = (UIPanelMenuItem)component;
-
- String defaultItemIcon = null;
- String customItemIcon = null;
-
- if(isTopLevel){
- if(item.isDisabled()){
- defaultItemIcon = panelMenu.getIconTopDisabledItem();
- } else {
- defaultItemIcon = panelMenu.getIconTopItem();
- }
- if(defaultItemIcon == null || defaultItemIcon.equals("")){
- if(item.isDisabled()){
- defaultItemIcon = panelMenu.getIconDisabledItem();
- } else {
- defaultItemIcon = panelMenu.getIconItem();
- }
- }
- } else {
- //isTopLevel == false
- if(defaultItemIcon == null || defaultItemIcon.equals("")){
- if(item.isDisabled()){
- defaultItemIcon = panelMenu.getIconDisabledItem();
- } else {
- defaultItemIcon = panelMenu.getIconItem();
- }
- }
- }
-
- customItemIcon = item.isDisabled() ? item.getIconDisabled() : item.getIcon();
-
- if(customItemIcon == null || customItemIcon.equals("")){
- iconType = defaultItemIcon;
- } else iconType = customItemIcon;
-
- source = getIconByType(iconType, isTopLevel, context, component);
- drawIcon(writer, iconType, source, component, from + "Icon" +
component.getClientId(context));
- }
-
-
- public String getFullStyleClass(FacesContext context, UIComponent component) {
- StringBuffer classBuffer = new StringBuffer("");
- UIPanelMenuItem item = (UIPanelMenuItem)component;
- UIPanelMenu parentMenu = findMenu(item);
- if (!parentMenu.isDisabled() && !item.isDisabled()) {
- if (calculateLevel(item) == 0) {
- classBuffer.append(parentMenu.getTopItemClass()).append(" ");
- classBuffer.append("rich-pmenu-top-item ");
- } else
- classBuffer.append(parentMenu.getItemClass() + " ");
- classBuffer.append(item.getStyleClass());
- } else
- classBuffer.append(parentMenu.getDisabledItemClass() + " ")
- .append(item.getDisabledClass());
- return classBuffer.toString();
- }
-
- public String getFullStyle(FacesContext context, UIComponent component) {
- StringBuffer styleBuffer = new StringBuffer("");
- UIPanelMenuItem item = (UIPanelMenuItem)component;
- UIPanelMenu parentMenu = findMenu(item);
- if (!item.isDisabled()) {
- if (calculateLevel(item) == 0)
- styleBuffer.append(parentMenu.getTopItemStyle() + "; ");
- else
- styleBuffer.append(parentMenu.getItemStyle() + "; ");
- styleBuffer.append(item.getStyle());
- } else
- styleBuffer.append(parentMenu.getDisabledItemStyle() + "; ")
- .append(item.getDisabledStyle());
- return styleBuffer.toString();
- }
-
- public String getLabelClass(FacesContext context, UIComponent component) {
- UIPanelMenuItem item = (UIPanelMenuItem)component;
- UIPanelMenu parentMenu = findMenu(item);
- if(!item.isDisabled() && !parentMenu.isDisabled()){
- if(isTopLevel(component)){
- return "rich-pmenu-item-label rich-pmenu-top-item-label";
- } else return "rich-pmenu-item-label";
- }
- return "";
- }
-
- public String getIconClass(FacesContext context, UIComponent component) {
- UIPanelMenuItem item = (UIPanelMenuItem)component;
- UIPanelMenu parentMenu = findMenu(item);
- if(!item.isDisabled() && !parentMenu.isDisabled()){
- if(isTopLevel(component)){
- return "rich-pmenu-item-icon rich-pmenu-top-item-icon";
- } else return "rich-pmenu-item-icon";
- }
- return "";
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.event.ActionEvent;
+
+import org.ajax4jsf.event.AjaxEvent;
+import org.richfaces.component.UIPanelMenu;
+import org.richfaces.component.UIPanelMenuItem;
+import org.richfaces.renderkit.PanelMenuRendererBase;
+
+public class PanelMenuItemRenderer extends PanelMenuRendererBase {
+ protected Class getComponentClass() {
+ return UIPanelMenuItem.class;
+ }
+
+ protected void doEncodeBegin(ResponseWriter writer, FacesContext context,UIComponent
component) throws IOException {
+
+ }
+ protected void doDecode(FacesContext context, UIComponent component) {
+ if(isSubmitted(context, component)) {
+ new ActionEvent(component).queue();
+ if ("ajax".equals(getItemMode(component))) {
+ new AjaxEvent(component).queue();
+ } else {
+
+ }
+ }
+ }
+
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException {
+
+ }
+
+ /*
+ public String getOnClick(FacesContext context, UIComponent component) {
+ String clientId = component.getClientId(context);
+ return ";PanelMenuStorage['" + clientId +
"'].trigger(event);";
+ }
+ */
+ public void insertImage(FacesContext context, UIComponent component, Object data) throws
IOException {
+ String from = (String)data;
+ UIPanelMenu panelMenu = findMenu(component);
+ if(panelMenu == null){
+ return;
+ }
+ String align = "";
+ UIPanelMenuItem panelMenuItem = (UIPanelMenuItem)component;
+ boolean isTopLevel = isTopLevel(panelMenuItem);
+
+ if (isTopLevel){
+ align = panelMenu.getIconItemTopPosition();
+ } else {
+ align = panelMenu.getIconItemPosition();
+ }
+
+ if (align.equalsIgnoreCase(from)){
+ image(context,component, from);
+ } else {
+ String iconType = PANEL_MENU_SPACER_ICON_NAME;
+ String imageSrc = getIconByType(iconType, isTopLevel, context, component);
+ drawIcon(context.getResponseWriter(), iconType, imageSrc, component, from +
"Icon" + component.getClientId(context));
+ }
+ }
+
+ private void image(FacesContext context, UIComponent component, String from)
+ throws IOException{
+
+ UIPanelMenu panelMenu = findMenu(component);
+ ResponseWriter writer = context.getResponseWriter();
+ boolean isTopLevel = isTopLevel(component);
+ String source = null;
+ String iconType = null;
+ UIPanelMenuItem item = (UIPanelMenuItem)component;
+
+ String defaultItemIcon = null;
+ String customItemIcon = null;
+
+ if(isTopLevel){
+ if(item.isDisabled()){
+ defaultItemIcon = panelMenu.getIconTopDisabledItem();
+ } else {
+ defaultItemIcon = panelMenu.getIconTopItem();
+ }
+ if(defaultItemIcon == null || defaultItemIcon.equals("")){
+ if(item.isDisabled()){
+ defaultItemIcon = panelMenu.getIconDisabledItem();
+ } else {
+ defaultItemIcon = panelMenu.getIconItem();
+ }
+ }
+ } else {
+ //isTopLevel == false
+ if(defaultItemIcon == null || defaultItemIcon.equals("")){
+ if(item.isDisabled()){
+ defaultItemIcon = panelMenu.getIconDisabledItem();
+ } else {
+ defaultItemIcon = panelMenu.getIconItem();
+ }
+ }
+ }
+
+ customItemIcon = item.isDisabled() ? item.getIconDisabled() : item.getIcon();
+
+ if(customItemIcon == null || customItemIcon.equals("")){
+ iconType = defaultItemIcon;
+ } else iconType = customItemIcon;
+
+ source = getIconByType(iconType, isTopLevel, context, component);
+ drawIcon(writer, iconType, source, component, from + "Icon" +
component.getClientId(context));
+ }
+
+
+ public String getFullStyleClass(FacesContext context, UIComponent component) {
+ StringBuffer classBuffer = new StringBuffer("");
+ UIPanelMenuItem item = (UIPanelMenuItem)component;
+ UIPanelMenu parentMenu = findMenu(item);
+ if (!parentMenu.isDisabled() && !item.isDisabled()) {
+ if (calculateLevel(item) == 0) {
+ classBuffer.append(parentMenu.getTopItemClass()).append(" ");
+ classBuffer.append("rich-pmenu-top-item ");
+ } else
+ classBuffer.append(parentMenu.getItemClass() + " ");
+ classBuffer.append(item.getStyleClass());
+ } else
+ classBuffer.append(parentMenu.getDisabledItemClass() + " ")
+ .append(item.getDisabledClass());
+ return classBuffer.toString();
+ }
+
+ public String getFullStyle(FacesContext context, UIComponent component) {
+ StringBuffer styleBuffer = new StringBuffer("");
+ UIPanelMenuItem item = (UIPanelMenuItem)component;
+ UIPanelMenu parentMenu = findMenu(item);
+ if (!item.isDisabled()) {
+ if (calculateLevel(item) == 0)
+ styleBuffer.append(parentMenu.getTopItemStyle() + "; ");
+ else
+ styleBuffer.append(parentMenu.getItemStyle() + "; ");
+ styleBuffer.append(item.getStyle());
+ } else
+ styleBuffer.append(parentMenu.getDisabledItemStyle() + "; ")
+ .append(item.getDisabledStyle());
+ return styleBuffer.toString();
+ }
+
+ public String getLabelClass(FacesContext context, UIComponent component) {
+ UIPanelMenuItem item = (UIPanelMenuItem)component;
+ UIPanelMenu parentMenu = findMenu(item);
+ if(!item.isDisabled() && !parentMenu.isDisabled()){
+ if(isTopLevel(component)){
+ return "rich-pmenu-item-label rich-pmenu-top-item-label";
+ } else return "rich-pmenu-item-label";
+ }
+ return "";
+ }
+
+ public String getIconClass(FacesContext context, UIComponent component) {
+ UIPanelMenuItem item = (UIPanelMenuItem)component;
+ UIPanelMenu parentMenu = findMenu(item);
+ if(!item.isDisabled() && !parentMenu.isDisabled()){
+ if(isTopLevel(component)){
+ return "rich-pmenu-item-icon rich-pmenu-top-item-icon";
+ } else return "rich-pmenu-item-icon";
+ }
+ return "";
+ }
+}
Modified:
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
===================================================================
---
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -1,437 +1,437 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import org.ajax4jsf.renderkit.AjaxRendererUtils;
-import org.ajax4jsf.framework.util.javascript.JSFunction;
-import org.richfaces.component.UIPanelMenu;
-import org.richfaces.component.UIPanelMenuGroup;
-import org.richfaces.component.UIPanelMenuItem;
-import org.richfaces.renderkit.PanelMenuRendererBase;
-
-public class PanelMenuRenderer extends PanelMenuRendererBase {
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
- */
- protected Class getComponentClass() {
- return UIComponent.class;
- }
-
- public void insertScript(FacesContext context, UIComponent component)
- throws IOException {
-
- StringBuffer buffer = new StringBuffer();
- StringBuffer panelMenu = new StringBuffer();
- List flatList = new LinkedList();
- Map levels = new HashMap();
-
- boolean expandSingle = ((UIPanelMenu)component).isExpandSingle();
-
- flatten(component.getChildren(), flatList, levels, 0);
-
- panelMenu
- .append("new PanelMenu('")
- .append(component.getClientId(context).toString())
- .append("',")
- .append(new Boolean(expandSingle).toString())
- .append(");\n");
-
- for (Iterator iter = flatList.iterator(); iter.hasNext();) {
- UIComponent child = (UIComponent) iter.next();
- if ((child instanceof UIPanelMenuItem)||(child instanceof UIPanelMenuGroup)) {
- boolean childDisabled;
- if (!((UIPanelMenu)component).isDisabled())
- childDisabled = child instanceof UIPanelMenuGroup ?
((UIPanelMenuGroup)child).isDisabled() : ((UIPanelMenuItem)child).isDisabled();
- else
- childDisabled = true;
- boolean childRendered = child instanceof UIPanelMenuGroup ?
((UIPanelMenuGroup)child).isRendered() : ((UIPanelMenuItem)child).isRendered();
- boolean parentRendered = true;
- if (! (child.getParent() instanceof UIPanelMenu))
- parentRendered = child.getParent() instanceof UIPanelMenuGroup ?
((UIPanelMenuGroup)child.getParent()).isRendered() :
((UIPanelMenuItem)child.getParent()).isRendered();
- if (!parentRendered){
- child.getAttributes().put("rendered",Boolean.FALSE);
- }
-
- UIPanelMenu parentMenu = findMenu(child);
-
- String event = parentMenu.getEvent();
- if ("".equals(event))
- event = "click";
- else if (event.startsWith("on"))
- event = event.substring(2);
-
- String onopen = (child instanceof UIPanelMenuGroup) &&
!((UIPanelMenuGroup)child).isDisabled() && !isParentDisabled(child) ?
- parentMenu.getOngroupexpand() + ";" +
((UIPanelMenuGroup)child).getOnexpand() : "";
- String onclose = (child instanceof UIPanelMenuGroup) &&
!((UIPanelMenuGroup)child).isDisabled() && !isParentDisabled(child) ?
- parentMenu.getOngroupcollapse() + ";" +
((UIPanelMenuGroup)child).getOncollapse() : "";
- String hoveredStyle = (child instanceof UIPanelMenuGroup ?
- parentMenu.getHoveredGroupStyle() : parentMenu.getHoveredItemStyle())
- + ";" + (child instanceof UIPanelMenuGroup ?
- ((UIPanelMenuGroup)child).getHoverStyle() :
((UIPanelMenuItem)child).getHoverStyle());
- String hoveredClass = (child instanceof UIPanelMenuGroup ?
- parentMenu.getHoveredGroupClass() : parentMenu.getHoveredItemClass())
- + " " + (child instanceof UIPanelMenuGroup ?
- ((UIPanelMenuGroup)child).getHoverClass() :
((UIPanelMenuItem)child).getHoverClass());
- String [] hoveredStyles = hoveredStyle.split(";");
- String [] hoveredClasses = hoveredClass.split(" ");
-
- String mode = getItemMode(child);
- Object target = child.getAttributes().get("target");
- String targetString;
- if (null == target)
- targetString = "";
- else
- targetString = target.toString();
-
-
-
- if (childRendered && parentRendered){
- if ( !isParentDisabled(child) ){
- buffer
- .append("new PanelMenuItem({myId:'")
- .append((String) child.getClientId(context))
- .append("',parentId:'")
- .append((String) child.getParent().getClientId(context))
- .append("'},{type:" + (child instanceof UIPanelMenuItem ?
"\"item\"":"\"node\""))
- .append(",onopen:"+("".equals(onopen) ?
"\"\"" : "\"" + onopen +
"\"")+",onclose:"+("".equals(onclose) ?
"\"\"" : "\"" + onclose + "\""))
- .append(",event:\"" + event + "\"")
- .append(",mode:\"" + mode + "\"")
- .append(",target:\"" + targetString + "\"")
- .append(",disabled:" +
- new Boolean(childDisabled).toString())
- .append("},{");
-
-
- for (int i = 0; i < hoveredStyles.length; i++)
- if (!"".equals(hoveredStyles[i])) {
- String [] temp = hoveredStyles[i].split(":");
- String cssName = temp[0].trim();
- String cssValue = temp[1].trim();
- buffer.append("\"" + cssName + "\": \"" +
cssValue + "\"");
- if (i != hoveredStyles.length - 1)
- buffer.append(",");
- }
-
- buffer.append("},");
- if (hoveredClasses.length > 0) {
- buffer.append("new Array(");
- for (int i = 0; i < hoveredClasses.length; i++)
- if (!"".equals(hoveredClasses[i])) {;
- buffer.append("\"" + hoveredClasses[i] + "\"");
- if (i != hoveredClasses.length - 1)
- buffer.append(",");
- }
- buffer.append("),");
- } else
- buffer.append("new Array(),");
-
- buffer.append(levels.get(child.getClientId(context)));
- switchOnImagesIfNeeded(context,child,buffer);
-
- addActionIfNeeded(context,child,buffer);
-
- setExpandedIfNeeded(context,child,buffer);
-
- addAjaxFunction(context,child,buffer);
-
- addOnItemHover(parentMenu.getOnitemhover(), child, buffer);
-
- String iconPos = "left";
- boolean isTopLevel = isTopLevel(child);
- if(child instanceof UIPanelMenuGroup){
- iconPos = isTopLevel ? parentMenu.getIconGroupTopPosition() :
parentMenu.getIconGroupPosition();
- } else {
- iconPos = isTopLevel ? parentMenu.getIconItemTopPosition() :
parentMenu.getIconItemPosition();
- }
-
- buffer.append(","+'"'+iconPos+'"');
-
- addImages(buffer,context,child,component.getClientId(context).toString());
-
- buffer.append(");\n");
- }
- } else {
- continue;
- }
- }
- }
- StringBuffer ret = new StringBuffer();
- ret.append("<script ");
- ret.append("type=\"text/javascript\" ");
- ret.append("id =\"script" +
component.getClientId(context)+"\">\n");
- ret.append(panelMenu);
- ret.append(buffer);
- ret.append("\n</script>");
-
- ResponseWriter writer = context.getResponseWriter();
- writer.write(ret.toString());
- }
-
- public void flatten(List children, List flatList, Map levels,int initialLevel) {
- FacesContext context = FacesContext.getCurrentInstance();
- if (children != null) {
- for (Iterator iter = children.iterator(); iter.hasNext();) {
- UIComponent child = (UIComponent) iter.next();
- if (child instanceof UIPanelMenu){
- continue;
- }
- flatList.add(child);
- levels.put(child.getClientId(context), new Integer(initialLevel));
- flatten(child.getChildren(), flatList, levels, initialLevel + 1);
- }
- }
- }
-
- private void switchOnImagesIfNeeded(FacesContext context, UIComponent child,
StringBuffer buffer)throws IOException {
- boolean isToplevel = isTopLevel(child);
- String customIconOpened = "";
- String customIconClosed = "";
-
- UIPanelMenu panelMenu = findMenu(child);
- if(panelMenu == null){
- return;
- }
- String iconOpened = isToplevel ? panelMenu.getIconExpandedTopGroup() :
panelMenu.getIconExpandedGroup();
- String iconClosed = isToplevel ? panelMenu.getIconCollapsedTopGroup() :
panelMenu.getIconCollapsedGroup();
-
- try {
- customIconOpened = (String)child.getAttributes().get("iconOpened");
- customIconClosed = (String)child.getAttributes().get("iconClosed");
- } catch (Exception e) {}
-
- if (child instanceof UIPanelMenuItem){
- buffer.append(",false");
- } else {
- if
(iconClosed.equals("custom")&&iconOpened.equals("custom")){
- if
(customIconClosed.equals("")&&customIconOpened.equals("")){
- buffer.append(",false");
- } else {
- buffer.append(",true");
- }
- } else {
- buffer.append(",true");
- }
- }
- }
-
- private void addActionIfNeeded(FacesContext context,UIComponent child,StringBuffer
buffer){
- //TODO by nick - dima - use CommandScriptBuilder
- if (child instanceof UIPanelMenuItem){
- if (((UIPanelMenuItem)child).getAction() == null){
- buffer.append(",false");
- } else {
- buffer.append(",true");
- }
- } else {
- if
(((UIPanelMenuGroup)child).getAction()!=null&&!((UIPanelMenuGroup)child).getAction().equals("")){
- buffer.append(",'panelMenuNodeAction'");
- } else {
- buffer.append(",false");
- }
- }
- }
-
- private void setExpandedIfNeeded(FacesContext context,UIComponent child,StringBuffer
buffer){
- if(child instanceof UIPanelMenuItem){
- buffer.append(",false");
- } else {
- UIPanelMenuGroup group = (UIPanelMenuGroup)child;
- if(group.getValue() != null){
- buffer.append(",").append(group.getValue().toString());
- } else {
- PanelMenuGroupRenderer r =
(PanelMenuGroupRenderer)context.getRenderKit().getRenderer(group.getFamily(),
group.getRendererType());
- boolean isNodeOpened;
- try {
- isNodeOpened = r.isOpened(context, child);
- } catch (IOException e) {
- // TODO Auto-generated catch block
-// e.printStackTrace();
- isNodeOpened = false;
- }
- buffer.append(",").append(String.valueOf(isNodeOpened));
- }
- }
- }
-
- private void addImages(StringBuffer buffer,FacesContext context,UIComponent
component,String id){
- UIPanelMenu panelMenu = findMenu(component);
- if(panelMenu == null){
- return;
- }
- boolean isTopLevel = isTopLevel(component);
-
- final String PANEL_MENU_SPACER_ICON = getIconByType(PANEL_MENU_SPACER_ICON_NAME,
isTopLevel,context, component);
-
- if(component instanceof UIPanelMenuItem){
- UIPanelMenuItem item = (UIPanelMenuItem)component;
-
- String defaultItemIcon = null;
- String defaultItemIconSrc = null;
- String customItemIcon = null;
- String customIconSource = null;
-
- if(isTopLevel){
- if(item.isDisabled()){
- defaultItemIcon = panelMenu.getIconTopDisabledItem();
- } else {
- defaultItemIcon = panelMenu.getIconTopItem();
- }
- if(defaultItemIcon == null || defaultItemIcon.equals("")){
- if(item.isDisabled()){
- defaultItemIcon = panelMenu.getIconDisabledItem();
- } else {
- defaultItemIcon = panelMenu.getIconItem();
- }
- }
- } else {
- //isTopLevel == false
- if(defaultItemIcon == null || defaultItemIcon.equals("")){
- if(item.isDisabled()){
- defaultItemIcon = panelMenu.getIconDisabledItem();
- } else {
- defaultItemIcon = panelMenu.getIconItem();
- }
- }
- }
-
- if(defaultItemIcon != null && defaultItemIcon.equals("none")){
- defaultItemIconSrc = PANEL_MENU_SPACER_ICON;
- } else {
- defaultItemIconSrc = getIconByType(defaultItemIcon, isTopLevel,context, component);
- }
-
-
- customItemIcon = item.isDisabled() ? item.getIconDisabled() : item.getIcon();
- if(customItemIcon != null && customItemIcon.equals("none")){
- customIconSource = PANEL_MENU_SPACER_ICON;
- } else {
- customIconSource = getIconByType(customItemIcon, isTopLevel,context, component);
- }
-
- if(customItemIcon != null && !customItemIcon.equals("")){
- buffer.append(","+'"'+customIconSource+'"').append(","+'"'+customIconSource+'"'+"
");
- } else if (defaultItemIcon != null && !defaultItemIcon.equals("")){
- buffer.append(","+'"'+defaultItemIconSrc+'"').append(","+'"'+defaultItemIconSrc+'"'+"
");
- } else {
- buffer.append(","+'"'+PANEL_MENU_SPACER_ICON+'"').append(","+'"'+PANEL_MENU_SPACER_ICON+'"'+"
");
- }
- buffer.append(",\"\" ");
-
- } else if(component instanceof UIPanelMenuGroup){
- UIPanelMenuGroup group = (UIPanelMenuGroup)component;
-
- String defaultIconNodeClosed = isTopLevel ? (group.isDisabled() ?
panelMenu.getIconTopDisableGroup() : panelMenu.getIconCollapsedTopGroup()) :
(group.isDisabled() ? panelMenu.getIconDisabledGroup() :
panelMenu.getIconCollapsedGroup());
-
- if(isTopLevel){
- if(group.isDisabled()){
- defaultIconNodeClosed = panelMenu.getIconTopDisableGroup();
- if(defaultIconNodeClosed == null || defaultIconNodeClosed.equals("")){
- defaultIconNodeClosed = panelMenu.getIconDisabledGroup();
- }
- } else {
- defaultIconNodeClosed = panelMenu.getIconCollapsedTopGroup();
- if(defaultIconNodeClosed == null || defaultIconNodeClosed.equals("")){
- defaultIconNodeClosed = panelMenu.getIconCollapsedGroup();
- }
- }
- } else {
- if(group.isDisabled()){
- defaultIconNodeClosed = panelMenu.getIconDisabledGroup();
- } else {
- defaultIconNodeClosed = panelMenu.getIconCollapsedGroup();
- }
- }
-
- String defaultIconNodeOpened = isTopLevel ? panelMenu.getIconExpandedTopGroup() :
panelMenu.getIconExpandedGroup();
-
- if(isTopLevel){
- defaultIconNodeOpened = panelMenu.getIconExpandedTopGroup();
- if(defaultIconNodeOpened == null || defaultIconNodeOpened.equals("")){
- defaultIconNodeOpened = panelMenu.getIconExpandedGroup();
- }
- } else {
- defaultIconNodeOpened = panelMenu.getIconExpandedGroup();
- }
-
- String defaultIconNodeClosedSrc = getIconByType(defaultIconNodeClosed,
isTopLevel,context, component);
- String defaultIconNodeOpenedSrc = getIconByType(defaultIconNodeOpened,
isTopLevel,context, component);
-
- String iconExpanded = "";
- String iconCollapsed = "";
- String iconExpandedSource = "";
- String iconCollapsedSource = "";
-
- iconExpanded = group.isDisabled() ? group.getIconDisabled() :
group.getIconExpanded();
- iconCollapsed = group.isDisabled() ? group.getIconDisabled() :
group.getIconCollapsed();
- iconExpandedSource = getIconByType(iconExpanded,isTopLevel,context,component);
- iconCollapsedSource = getIconByType(iconCollapsed,isTopLevel,context,component);
-
- if(iconExpanded != null && !iconExpanded.equals("")){
- buffer.append(","+'"'+ iconExpandedSource +
'"');
- } else if(defaultIconNodeOpened != null &&
!defaultIconNodeOpened.equals("")){
- buffer.append(","+'"'+defaultIconNodeOpenedSrc +
'"');
- } else {
- buffer.append(","+'"'+PANEL_MENU_SPACER_ICON +
'"');
- }
-
- if(iconCollapsed != null && !iconCollapsed.equals("")){
- buffer.append(","+'"'+iconCollapsedSource+'"');
- } else if(defaultIconNodeClosed != null &&
!defaultIconNodeClosed.equals("")){
- buffer.append(","+'"'+defaultIconNodeClosedSrc+'"');
- } else {
- buffer.append(","+'"'+PANEL_MENU_SPACER_ICON +
'"');
- }
- }
- buffer.append(",\"" + PANEL_MENU_SPACER_ICON + "\"");
- }
-
- protected void addAjaxFunction(FacesContext context, UIComponent child, StringBuffer
buffer) {
- JSFunction function = AjaxRendererUtils.buildAjaxFunction(child,
- context);
- Map eventOptions = AjaxRendererUtils.buildEventOptions(context,
- child);
- function.addParameter(eventOptions);
-
- buffer.append(",\"");
- function.appendScript(buffer);
- buffer.append("\"");
- }
-
- protected void addOnItemHover(String menuOnItemHover, UIComponent child, StringBuffer
buffer) {
- buffer.append(",\"");
- if(child instanceof UIPanelMenuItem){
- if(menuOnItemHover != null && !menuOnItemHover.equals(""))
buffer.append(menuOnItemHover);
- }
- buffer.append("\"");
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
+import org.ajax4jsf.javascript.JSFunction;
+import org.richfaces.component.UIPanelMenu;
+import org.richfaces.component.UIPanelMenuGroup;
+import org.richfaces.component.UIPanelMenuItem;
+import org.richfaces.renderkit.PanelMenuRendererBase;
+
+public class PanelMenuRenderer extends PanelMenuRendererBase {
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
+ */
+ protected Class getComponentClass() {
+ return UIComponent.class;
+ }
+
+ public void insertScript(FacesContext context, UIComponent component)
+ throws IOException {
+
+ StringBuffer buffer = new StringBuffer();
+ StringBuffer panelMenu = new StringBuffer();
+ List flatList = new LinkedList();
+ Map levels = new HashMap();
+
+ boolean expandSingle = ((UIPanelMenu)component).isExpandSingle();
+
+ flatten(component.getChildren(), flatList, levels, 0);
+
+ panelMenu
+ .append("new PanelMenu('")
+ .append(component.getClientId(context).toString())
+ .append("',")
+ .append(new Boolean(expandSingle).toString())
+ .append(");\n");
+
+ for (Iterator iter = flatList.iterator(); iter.hasNext();) {
+ UIComponent child = (UIComponent) iter.next();
+ if ((child instanceof UIPanelMenuItem)||(child instanceof UIPanelMenuGroup)) {
+ boolean childDisabled;
+ if (!((UIPanelMenu)component).isDisabled())
+ childDisabled = child instanceof UIPanelMenuGroup ?
((UIPanelMenuGroup)child).isDisabled() : ((UIPanelMenuItem)child).isDisabled();
+ else
+ childDisabled = true;
+ boolean childRendered = child instanceof UIPanelMenuGroup ?
((UIPanelMenuGroup)child).isRendered() : ((UIPanelMenuItem)child).isRendered();
+ boolean parentRendered = true;
+ if (! (child.getParent() instanceof UIPanelMenu))
+ parentRendered = child.getParent() instanceof UIPanelMenuGroup ?
((UIPanelMenuGroup)child.getParent()).isRendered() :
((UIPanelMenuItem)child.getParent()).isRendered();
+ if (!parentRendered){
+ child.getAttributes().put("rendered",Boolean.FALSE);
+ }
+
+ UIPanelMenu parentMenu = findMenu(child);
+
+ String event = parentMenu.getEvent();
+ if ("".equals(event))
+ event = "click";
+ else if (event.startsWith("on"))
+ event = event.substring(2);
+
+ String onopen = (child instanceof UIPanelMenuGroup) &&
!((UIPanelMenuGroup)child).isDisabled() && !isParentDisabled(child) ?
+ parentMenu.getOngroupexpand() + ";" +
((UIPanelMenuGroup)child).getOnexpand() : "";
+ String onclose = (child instanceof UIPanelMenuGroup) &&
!((UIPanelMenuGroup)child).isDisabled() && !isParentDisabled(child) ?
+ parentMenu.getOngroupcollapse() + ";" +
((UIPanelMenuGroup)child).getOncollapse() : "";
+ String hoveredStyle = (child instanceof UIPanelMenuGroup ?
+ parentMenu.getHoveredGroupStyle() : parentMenu.getHoveredItemStyle())
+ + ";" + (child instanceof UIPanelMenuGroup ?
+ ((UIPanelMenuGroup)child).getHoverStyle() :
((UIPanelMenuItem)child).getHoverStyle());
+ String hoveredClass = (child instanceof UIPanelMenuGroup ?
+ parentMenu.getHoveredGroupClass() : parentMenu.getHoveredItemClass())
+ + " " + (child instanceof UIPanelMenuGroup ?
+ ((UIPanelMenuGroup)child).getHoverClass() :
((UIPanelMenuItem)child).getHoverClass());
+ String [] hoveredStyles = hoveredStyle.split(";");
+ String [] hoveredClasses = hoveredClass.split(" ");
+
+ String mode = getItemMode(child);
+ Object target = child.getAttributes().get("target");
+ String targetString;
+ if (null == target)
+ targetString = "";
+ else
+ targetString = target.toString();
+
+
+
+ if (childRendered && parentRendered){
+ if ( !isParentDisabled(child) ){
+ buffer
+ .append("new PanelMenuItem({myId:'")
+ .append((String) child.getClientId(context))
+ .append("',parentId:'")
+ .append((String) child.getParent().getClientId(context))
+ .append("'},{type:" + (child instanceof UIPanelMenuItem ?
"\"item\"":"\"node\""))
+ .append(",onopen:"+("".equals(onopen) ?
"\"\"" : "\"" + onopen +
"\"")+",onclose:"+("".equals(onclose) ?
"\"\"" : "\"" + onclose + "\""))
+ .append(",event:\"" + event + "\"")
+ .append(",mode:\"" + mode + "\"")
+ .append(",target:\"" + targetString + "\"")
+ .append(",disabled:" +
+ new Boolean(childDisabled).toString())
+ .append("},{");
+
+
+ for (int i = 0; i < hoveredStyles.length; i++)
+ if (!"".equals(hoveredStyles[i])) {
+ String [] temp = hoveredStyles[i].split(":");
+ String cssName = temp[0].trim();
+ String cssValue = temp[1].trim();
+ buffer.append("\"" + cssName + "\": \"" +
cssValue + "\"");
+ if (i != hoveredStyles.length - 1)
+ buffer.append(",");
+ }
+
+ buffer.append("},");
+ if (hoveredClasses.length > 0) {
+ buffer.append("new Array(");
+ for (int i = 0; i < hoveredClasses.length; i++)
+ if (!"".equals(hoveredClasses[i])) {;
+ buffer.append("\"" + hoveredClasses[i] + "\"");
+ if (i != hoveredClasses.length - 1)
+ buffer.append(",");
+ }
+ buffer.append("),");
+ } else
+ buffer.append("new Array(),");
+
+ buffer.append(levels.get(child.getClientId(context)));
+ switchOnImagesIfNeeded(context,child,buffer);
+
+ addActionIfNeeded(context,child,buffer);
+
+ setExpandedIfNeeded(context,child,buffer);
+
+ addAjaxFunction(context,child,buffer);
+
+ addOnItemHover(parentMenu.getOnitemhover(), child, buffer);
+
+ String iconPos = "left";
+ boolean isTopLevel = isTopLevel(child);
+ if(child instanceof UIPanelMenuGroup){
+ iconPos = isTopLevel ? parentMenu.getIconGroupTopPosition() :
parentMenu.getIconGroupPosition();
+ } else {
+ iconPos = isTopLevel ? parentMenu.getIconItemTopPosition() :
parentMenu.getIconItemPosition();
+ }
+
+ buffer.append(","+'"'+iconPos+'"');
+
+ addImages(buffer,context,child,component.getClientId(context).toString());
+
+ buffer.append(");\n");
+ }
+ } else {
+ continue;
+ }
+ }
+ }
+ StringBuffer ret = new StringBuffer();
+ ret.append("<script ");
+ ret.append("type=\"text/javascript\" ");
+ ret.append("id =\"script" +
component.getClientId(context)+"\">\n");
+ ret.append(panelMenu);
+ ret.append(buffer);
+ ret.append("\n</script>");
+
+ ResponseWriter writer = context.getResponseWriter();
+ writer.write(ret.toString());
+ }
+
+ public void flatten(List children, List flatList, Map levels,int initialLevel) {
+ FacesContext context = FacesContext.getCurrentInstance();
+ if (children != null) {
+ for (Iterator iter = children.iterator(); iter.hasNext();) {
+ UIComponent child = (UIComponent) iter.next();
+ if (child instanceof UIPanelMenu){
+ continue;
+ }
+ flatList.add(child);
+ levels.put(child.getClientId(context), new Integer(initialLevel));
+ flatten(child.getChildren(), flatList, levels, initialLevel + 1);
+ }
+ }
+ }
+
+ private void switchOnImagesIfNeeded(FacesContext context, UIComponent child,
StringBuffer buffer)throws IOException {
+ boolean isToplevel = isTopLevel(child);
+ String customIconOpened = "";
+ String customIconClosed = "";
+
+ UIPanelMenu panelMenu = findMenu(child);
+ if(panelMenu == null){
+ return;
+ }
+ String iconOpened = isToplevel ? panelMenu.getIconExpandedTopGroup() :
panelMenu.getIconExpandedGroup();
+ String iconClosed = isToplevel ? panelMenu.getIconCollapsedTopGroup() :
panelMenu.getIconCollapsedGroup();
+
+ try {
+ customIconOpened = (String)child.getAttributes().get("iconOpened");
+ customIconClosed = (String)child.getAttributes().get("iconClosed");
+ } catch (Exception e) {}
+
+ if (child instanceof UIPanelMenuItem){
+ buffer.append(",false");
+ } else {
+ if
(iconClosed.equals("custom")&&iconOpened.equals("custom")){
+ if
(customIconClosed.equals("")&&customIconOpened.equals("")){
+ buffer.append(",false");
+ } else {
+ buffer.append(",true");
+ }
+ } else {
+ buffer.append(",true");
+ }
+ }
+ }
+
+ private void addActionIfNeeded(FacesContext context,UIComponent child,StringBuffer
buffer){
+ //TODO by nick - dima - use CommandScriptBuilder
+ if (child instanceof UIPanelMenuItem){
+ if (((UIPanelMenuItem)child).getAction() == null){
+ buffer.append(",false");
+ } else {
+ buffer.append(",true");
+ }
+ } else {
+ if
(((UIPanelMenuGroup)child).getAction()!=null&&!((UIPanelMenuGroup)child).getAction().equals("")){
+ buffer.append(",'panelMenuNodeAction'");
+ } else {
+ buffer.append(",false");
+ }
+ }
+ }
+
+ private void setExpandedIfNeeded(FacesContext context,UIComponent child,StringBuffer
buffer){
+ if(child instanceof UIPanelMenuItem){
+ buffer.append(",false");
+ } else {
+ UIPanelMenuGroup group = (UIPanelMenuGroup)child;
+ if(group.getValue() != null){
+ buffer.append(",").append(group.getValue().toString());
+ } else {
+ PanelMenuGroupRenderer r =
(PanelMenuGroupRenderer)context.getRenderKit().getRenderer(group.getFamily(),
group.getRendererType());
+ boolean isNodeOpened;
+ try {
+ isNodeOpened = r.isOpened(context, child);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+// e.printStackTrace();
+ isNodeOpened = false;
+ }
+ buffer.append(",").append(String.valueOf(isNodeOpened));
+ }
+ }
+ }
+
+ private void addImages(StringBuffer buffer,FacesContext context,UIComponent
component,String id){
+ UIPanelMenu panelMenu = findMenu(component);
+ if(panelMenu == null){
+ return;
+ }
+ boolean isTopLevel = isTopLevel(component);
+
+ final String PANEL_MENU_SPACER_ICON = getIconByType(PANEL_MENU_SPACER_ICON_NAME,
isTopLevel,context, component);
+
+ if(component instanceof UIPanelMenuItem){
+ UIPanelMenuItem item = (UIPanelMenuItem)component;
+
+ String defaultItemIcon = null;
+ String defaultItemIconSrc = null;
+ String customItemIcon = null;
+ String customIconSource = null;
+
+ if(isTopLevel){
+ if(item.isDisabled()){
+ defaultItemIcon = panelMenu.getIconTopDisabledItem();
+ } else {
+ defaultItemIcon = panelMenu.getIconTopItem();
+ }
+ if(defaultItemIcon == null || defaultItemIcon.equals("")){
+ if(item.isDisabled()){
+ defaultItemIcon = panelMenu.getIconDisabledItem();
+ } else {
+ defaultItemIcon = panelMenu.getIconItem();
+ }
+ }
+ } else {
+ //isTopLevel == false
+ if(defaultItemIcon == null || defaultItemIcon.equals("")){
+ if(item.isDisabled()){
+ defaultItemIcon = panelMenu.getIconDisabledItem();
+ } else {
+ defaultItemIcon = panelMenu.getIconItem();
+ }
+ }
+ }
+
+ if(defaultItemIcon != null && defaultItemIcon.equals("none")){
+ defaultItemIconSrc = PANEL_MENU_SPACER_ICON;
+ } else {
+ defaultItemIconSrc = getIconByType(defaultItemIcon, isTopLevel,context, component);
+ }
+
+
+ customItemIcon = item.isDisabled() ? item.getIconDisabled() : item.getIcon();
+ if(customItemIcon != null && customItemIcon.equals("none")){
+ customIconSource = PANEL_MENU_SPACER_ICON;
+ } else {
+ customIconSource = getIconByType(customItemIcon, isTopLevel,context, component);
+ }
+
+ if(customItemIcon != null && !customItemIcon.equals("")){
+ buffer.append(","+'"'+customIconSource+'"').append(","+'"'+customIconSource+'"'+"
");
+ } else if (defaultItemIcon != null && !defaultItemIcon.equals("")){
+ buffer.append(","+'"'+defaultItemIconSrc+'"').append(","+'"'+defaultItemIconSrc+'"'+"
");
+ } else {
+ buffer.append(","+'"'+PANEL_MENU_SPACER_ICON+'"').append(","+'"'+PANEL_MENU_SPACER_ICON+'"'+"
");
+ }
+ buffer.append(",\"\" ");
+
+ } else if(component instanceof UIPanelMenuGroup){
+ UIPanelMenuGroup group = (UIPanelMenuGroup)component;
+
+ String defaultIconNodeClosed = isTopLevel ? (group.isDisabled() ?
panelMenu.getIconTopDisableGroup() : panelMenu.getIconCollapsedTopGroup()) :
(group.isDisabled() ? panelMenu.getIconDisabledGroup() :
panelMenu.getIconCollapsedGroup());
+
+ if(isTopLevel){
+ if(group.isDisabled()){
+ defaultIconNodeClosed = panelMenu.getIconTopDisableGroup();
+ if(defaultIconNodeClosed == null || defaultIconNodeClosed.equals("")){
+ defaultIconNodeClosed = panelMenu.getIconDisabledGroup();
+ }
+ } else {
+ defaultIconNodeClosed = panelMenu.getIconCollapsedTopGroup();
+ if(defaultIconNodeClosed == null || defaultIconNodeClosed.equals("")){
+ defaultIconNodeClosed = panelMenu.getIconCollapsedGroup();
+ }
+ }
+ } else {
+ if(group.isDisabled()){
+ defaultIconNodeClosed = panelMenu.getIconDisabledGroup();
+ } else {
+ defaultIconNodeClosed = panelMenu.getIconCollapsedGroup();
+ }
+ }
+
+ String defaultIconNodeOpened = isTopLevel ? panelMenu.getIconExpandedTopGroup() :
panelMenu.getIconExpandedGroup();
+
+ if(isTopLevel){
+ defaultIconNodeOpened = panelMenu.getIconExpandedTopGroup();
+ if(defaultIconNodeOpened == null || defaultIconNodeOpened.equals("")){
+ defaultIconNodeOpened = panelMenu.getIconExpandedGroup();
+ }
+ } else {
+ defaultIconNodeOpened = panelMenu.getIconExpandedGroup();
+ }
+
+ String defaultIconNodeClosedSrc = getIconByType(defaultIconNodeClosed,
isTopLevel,context, component);
+ String defaultIconNodeOpenedSrc = getIconByType(defaultIconNodeOpened,
isTopLevel,context, component);
+
+ String iconExpanded = "";
+ String iconCollapsed = "";
+ String iconExpandedSource = "";
+ String iconCollapsedSource = "";
+
+ iconExpanded = group.isDisabled() ? group.getIconDisabled() :
group.getIconExpanded();
+ iconCollapsed = group.isDisabled() ? group.getIconDisabled() :
group.getIconCollapsed();
+ iconExpandedSource = getIconByType(iconExpanded,isTopLevel,context,component);
+ iconCollapsedSource = getIconByType(iconCollapsed,isTopLevel,context,component);
+
+ if(iconExpanded != null && !iconExpanded.equals("")){
+ buffer.append(","+'"'+ iconExpandedSource +
'"');
+ } else if(defaultIconNodeOpened != null &&
!defaultIconNodeOpened.equals("")){
+ buffer.append(","+'"'+defaultIconNodeOpenedSrc +
'"');
+ } else {
+ buffer.append(","+'"'+PANEL_MENU_SPACER_ICON +
'"');
+ }
+
+ if(iconCollapsed != null && !iconCollapsed.equals("")){
+ buffer.append(","+'"'+iconCollapsedSource+'"');
+ } else if(defaultIconNodeClosed != null &&
!defaultIconNodeClosed.equals("")){
+ buffer.append(","+'"'+defaultIconNodeClosedSrc+'"');
+ } else {
+ buffer.append(","+'"'+PANEL_MENU_SPACER_ICON +
'"');
+ }
+ }
+ buffer.append(",\"" + PANEL_MENU_SPACER_ICON + "\"");
+ }
+
+ protected void addAjaxFunction(FacesContext context, UIComponent child, StringBuffer
buffer) {
+ JSFunction function = AjaxRendererUtils.buildAjaxFunction(child,
+ context);
+ Map eventOptions = AjaxRendererUtils.buildEventOptions(context,
+ child);
+ function.addParameter(eventOptions);
+
+ buffer.append(",\"");
+ function.appendScript(buffer);
+ buffer.append("\"");
+ }
+
+ protected void addOnItemHover(String menuOnItemHover, UIComponent child, StringBuffer
buffer) {
+ buffer.append(",\"");
+ if(child instanceof UIPanelMenuItem){
+ if(menuOnItemHover != null && !menuOnItemHover.equals(""))
buffer.append(menuOnItemHover);
+ }
+ buffer.append("\"");
+ }
+
+}
Modified:
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/gradientimages/PanelMenuGroupGradient.java
===================================================================
---
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/gradientimages/PanelMenuGroupGradient.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/gradientimages/PanelMenuGroupGradient.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -1,32 +1,32 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.gradientimages;
-
-import org.ajax4jsf.framework.skin.Skin;
-import org.richfaces.renderkit.html.BaseGradient;
-
-public class PanelMenuGroupGradient extends BaseGradient {
- public PanelMenuGroupGradient() {
- super(10, 40, 14, "headerGradientColor", Skin.headerBackgroundColor);
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.gradientimages;
+
+import org.richfaces.skin.Skin;
+import org.richfaces.renderkit.html.BaseGradient;
+
+public class PanelMenuGroupGradient extends BaseGradient {
+ public PanelMenuGroupGradient() {
+ super(10, 40, 14, "headerGradientColor", Skin.headerBackgroundColor);
+ }
+
+}
Modified:
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/gradientimages/PanelMenuItemGradient.java
===================================================================
---
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/gradientimages/PanelMenuItemGradient.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/gradientimages/PanelMenuItemGradient.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -1,31 +1,31 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.gradientimages;
-
-import org.ajax4jsf.framework.skin.Skin;
-import org.richfaces.renderkit.html.BaseGradient;
-
-public class PanelMenuItemGradient extends BaseGradient {
- public PanelMenuItemGradient() {
- super(10, 40, 14, "controlBackgroundColor",
Skin.generalBackgroundColor);
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.gradientimages;
+
+import org.richfaces.skin.Skin;
+import org.richfaces.renderkit.html.BaseGradient;
+
+public class PanelMenuItemGradient extends BaseGradient {
+ public PanelMenuItemGradient() {
+ super(10, 40, 14, "controlBackgroundColor",
Skin.generalBackgroundColor);
+ }
+}
Modified:
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconBasic.java
===================================================================
---
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconBasic.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconBasic.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -1,100 +1,100 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.iconimages;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.util.Date;
-
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.framework.resource.GifRenderer;
-import org.ajax4jsf.framework.resource.InternetResourceBuilder;
-import org.ajax4jsf.framework.resource.Java2Dresource;
-import org.ajax4jsf.framework.resource.ResourceContext;
-import org.ajax4jsf.framework.skin.Skin;
-import org.ajax4jsf.framework.skin.SkinFactory;
-import org.ajax4jsf.framework.util.HtmlColor;
-import org.ajax4jsf.framework.util.HtmlDimensions;
-
-
-/**
- * @author Pavel Kotikov
- *
- */
-public class PanelMenuIconBasic extends Java2Dresource {
-
- public PanelMenuIconBasic() {
- setRenderer(new GifRenderer());
- setLastModified(new Date(InternetResourceBuilder.getInstance().getStartTime()));
- }
-
-
- public Dimension getDimensions(FacesContext facesContext, Object data) {
- return calculateDimensions(getDataToStore(facesContext, data));
- }
- protected Dimension getDimensions(ResourceContext resourceContext) {
- return calculateDimensions(restoreData(resourceContext));
- }
-
- protected void paint(ResourceContext context, Graphics2D g2d) {
-
- }
-
- protected Dimension calculateDimensions(Object data){
- Object [] stored = (Object []) data;
- int h = ((Integer) stored[0]).intValue();
- return new Dimension(h,h);
- }
-
-
- /**
- * @param data - pass icon color there
- */
- protected Object getDataToStore(FacesContext context, Object data) {
- Object[] stored = new Object[5];
- Skin skin = SkinFactory.getInstance().getSkin(context);
- Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
-
- stored[0] = new Integer(HtmlDimensions.decode("16px").intValue());
-
- Color col = null;
-
- if (data!=null){
- col = HtmlColor.decode(data.toString());
- } else {
- String skinParameter = "headerTextColor";
- String headerTextColor = (String) skin.getParameter(context, skinParameter);
- if (null == headerTextColor || "".equals(headerTextColor))
- headerTextColor = (String) defaultSkin.getParameter(context, skinParameter);
- col = HtmlColor.decode(headerTextColor);
- }
- stored[1]= col;
- return stored;
- }
-
- public boolean isCacheable() {
- return true;
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.iconimages;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.util.Date;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.resource.GifRenderer;
+import org.ajax4jsf.resource.InternetResourceBuilder;
+import org.ajax4jsf.resource.Java2Dresource;
+import org.ajax4jsf.resource.ResourceContext;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+import org.ajax4jsf.util.HtmlColor;
+import org.ajax4jsf.util.HtmlDimensions;
+
+
+/**
+ * @author Pavel Kotikov
+ *
+ */
+public class PanelMenuIconBasic extends Java2Dresource {
+
+ public PanelMenuIconBasic() {
+ setRenderer(new GifRenderer());
+ setLastModified(new Date(InternetResourceBuilder.getInstance().getStartTime()));
+ }
+
+
+ public Dimension getDimensions(FacesContext facesContext, Object data) {
+ return calculateDimensions(getDataToStore(facesContext, data));
+ }
+ protected Dimension getDimensions(ResourceContext resourceContext) {
+ return calculateDimensions(restoreData(resourceContext));
+ }
+
+ protected void paint(ResourceContext context, Graphics2D g2d) {
+
+ }
+
+ protected Dimension calculateDimensions(Object data){
+ Object [] stored = (Object []) data;
+ int h = ((Integer) stored[0]).intValue();
+ return new Dimension(h,h);
+ }
+
+
+ /**
+ * @param data - pass icon color there
+ */
+ protected Object getDataToStore(FacesContext context, Object data) {
+ Object[] stored = new Object[5];
+ Skin skin = SkinFactory.getInstance().getSkin(context);
+ Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
+
+ stored[0] = new Integer(HtmlDimensions.decode("16px").intValue());
+
+ Color col = null;
+
+ if (data!=null){
+ col = HtmlColor.decode(data.toString());
+ } else {
+ String skinParameter = "headerTextColor";
+ String headerTextColor = (String) skin.getParameter(context, skinParameter);
+ if (null == headerTextColor || "".equals(headerTextColor))
+ headerTextColor = (String) defaultSkin.getParameter(context, skinParameter);
+ col = HtmlColor.decode(headerTextColor);
+ }
+ stored[1]= col;
+ return stored;
+ }
+
+ public boolean isCacheable() {
+ return true;
+ }
+
+}
Modified:
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevron.java
===================================================================
---
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevron.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevron.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -1,81 +1,81 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.iconimages;
-
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.GeneralPath;
-import java.awt.image.AffineTransformOp;
-import java.awt.image.BufferedImage;
-import org.ajax4jsf.framework.resource.ResourceContext;
-
-
-
-public class PanelMenuIconChevron extends PanelMenuIconBasic {
-
- protected void paint(ResourceContext context, Graphics2D graphics2d) {
-
- BufferedImage bufferedImage = new BufferedImage(128, 128,
BufferedImage.TYPE_INT_ARGB);
- Graphics2D g2d = bufferedImage.createGraphics();
-
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_OFF);
- g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
RenderingHints.VALUE_STROKE_NORMALIZE);
- g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_DISABLE);
- g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
- g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
-
- Dimension dimension = getDimensions(context);
- GeneralPath path = new GeneralPath();
- g2d.setStroke(new BasicStroke(1,BasicStroke.CAP_BUTT,BasicStroke.JOIN_MITER));
- g2d.translate(28,28);
- Object [] data = (Object[]) restoreData(context);
- Color col = (Color)data[1];
-
- g2d.setColor(col);
-
- path.moveTo(1,1);
- path.lineTo(17,1);
- path.lineTo(47,31);
- path.lineTo(17,61);
- path.lineTo(1,61);
- path.lineTo(31,31);
- path.closePath();
- g2d.fill(path);
-
- g2d.translate(24,0);
-
- g2d.fill(path);
-
- AffineTransform transform = AffineTransform.getScaleInstance(dimension.getHeight()/128,
dimension.getHeight()/128);
- AffineTransformOp transformOp = new AffineTransformOp(transform,
AffineTransformOp.TYPE_BILINEAR);
-
- graphics2d.drawImage(bufferedImage,transformOp, 0, 0);
-
- g2d.dispose();
- }
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.iconimages;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.GeneralPath;
+import java.awt.image.AffineTransformOp;
+import java.awt.image.BufferedImage;
+import org.ajax4jsf.resource.ResourceContext;
+
+
+
+public class PanelMenuIconChevron extends PanelMenuIconBasic {
+
+ protected void paint(ResourceContext context, Graphics2D graphics2d) {
+
+ BufferedImage bufferedImage = new BufferedImage(128, 128,
BufferedImage.TYPE_INT_ARGB);
+ Graphics2D g2d = bufferedImage.createGraphics();
+
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_OFF);
+ g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
RenderingHints.VALUE_STROKE_NORMALIZE);
+ g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_DISABLE);
+ g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
+ g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
+
+ Dimension dimension = getDimensions(context);
+ GeneralPath path = new GeneralPath();
+ g2d.setStroke(new BasicStroke(1,BasicStroke.CAP_BUTT,BasicStroke.JOIN_MITER));
+ g2d.translate(28,28);
+ Object [] data = (Object[]) restoreData(context);
+ Color col = (Color)data[1];
+
+ g2d.setColor(col);
+
+ path.moveTo(1,1);
+ path.lineTo(17,1);
+ path.lineTo(47,31);
+ path.lineTo(17,61);
+ path.lineTo(1,61);
+ path.lineTo(31,31);
+ path.closePath();
+ g2d.fill(path);
+
+ g2d.translate(24,0);
+
+ g2d.fill(path);
+
+ AffineTransform transform = AffineTransform.getScaleInstance(dimension.getHeight()/128,
dimension.getHeight()/128);
+ AffineTransformOp transformOp = new AffineTransformOp(transform,
AffineTransformOp.TYPE_BILINEAR);
+
+ graphics2d.drawImage(bufferedImage,transformOp, 0, 0);
+
+ g2d.dispose();
+ }
}
\ No newline at end of file
Modified:
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronDown.java
===================================================================
---
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronDown.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronDown.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -1,80 +1,80 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.iconimages;
-
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.GeneralPath;
-import java.awt.image.AffineTransformOp;
-import java.awt.image.BufferedImage;
-import org.ajax4jsf.framework.resource.ResourceContext;
-
-
-
-public class PanelMenuIconChevronDown extends PanelMenuIconBasic {
-
- protected void paint(ResourceContext context, Graphics2D graphics2D) {
- BufferedImage bufferedImage = new BufferedImage(128, 128,
BufferedImage.TYPE_INT_ARGB);
- Graphics2D g2d = bufferedImage.createGraphics();
-
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_OFF);
- g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
RenderingHints.VALUE_STROKE_NORMALIZE);
- g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_DISABLE);
- g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
- g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
-
- Dimension dimension = getDimensions(context);
- GeneralPath path = new GeneralPath();
- g2d.setStroke(new BasicStroke(1,BasicStroke.CAP_BUTT,BasicStroke.JOIN_MITER));
- g2d.translate(28,28);
- Object [] data = (Object[]) restoreData(context);
- Color col = (Color)data[1];
-
- g2d.setColor(col);
-
- path.moveTo(1,0);
- path.lineTo(31,30);
- path.lineTo(61,0);
- path.lineTo(61,16);
- path.lineTo(31,46);
- path.lineTo(1,16);
- path.closePath();
- g2d.fill(path);
-
- g2d.translate(0,24);
-
- g2d.fill(path);
-
- AffineTransform transform = AffineTransform.getScaleInstance(dimension.getHeight()/128,
dimension.getHeight()/128);
- AffineTransformOp transformOp = new AffineTransformOp(transform,
AffineTransformOp.TYPE_BILINEAR);
-
- graphics2D.drawImage(bufferedImage,transformOp, 0, 0);
-
- g2d.dispose();
- }
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.iconimages;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.GeneralPath;
+import java.awt.image.AffineTransformOp;
+import java.awt.image.BufferedImage;
+import org.ajax4jsf.resource.ResourceContext;
+
+
+
+public class PanelMenuIconChevronDown extends PanelMenuIconBasic {
+
+ protected void paint(ResourceContext context, Graphics2D graphics2D) {
+ BufferedImage bufferedImage = new BufferedImage(128, 128,
BufferedImage.TYPE_INT_ARGB);
+ Graphics2D g2d = bufferedImage.createGraphics();
+
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_OFF);
+ g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
RenderingHints.VALUE_STROKE_NORMALIZE);
+ g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_DISABLE);
+ g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
+ g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
+
+ Dimension dimension = getDimensions(context);
+ GeneralPath path = new GeneralPath();
+ g2d.setStroke(new BasicStroke(1,BasicStroke.CAP_BUTT,BasicStroke.JOIN_MITER));
+ g2d.translate(28,28);
+ Object [] data = (Object[]) restoreData(context);
+ Color col = (Color)data[1];
+
+ g2d.setColor(col);
+
+ path.moveTo(1,0);
+ path.lineTo(31,30);
+ path.lineTo(61,0);
+ path.lineTo(61,16);
+ path.lineTo(31,46);
+ path.lineTo(1,16);
+ path.closePath();
+ g2d.fill(path);
+
+ g2d.translate(0,24);
+
+ g2d.fill(path);
+
+ AffineTransform transform = AffineTransform.getScaleInstance(dimension.getHeight()/128,
dimension.getHeight()/128);
+ AffineTransformOp transformOp = new AffineTransformOp(transform,
AffineTransformOp.TYPE_BILINEAR);
+
+ graphics2D.drawImage(bufferedImage,transformOp, 0, 0);
+
+ g2d.dispose();
+ }
}
\ No newline at end of file
Modified:
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronUp.java
===================================================================
---
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronUp.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronUp.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -1,80 +1,80 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.iconimages;
-
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.GeneralPath;
-import java.awt.image.AffineTransformOp;
-import java.awt.image.BufferedImage;
-import org.ajax4jsf.framework.resource.ResourceContext;
-
-
-
-public class PanelMenuIconChevronUp extends PanelMenuIconBasic {
-
- protected void paint(ResourceContext context, Graphics2D graphics2D) {
- BufferedImage bufferedImage = new BufferedImage(128, 128,
BufferedImage.TYPE_INT_ARGB);
- Graphics2D g2d = bufferedImage.createGraphics();
-
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_OFF);
- g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
RenderingHints.VALUE_STROKE_NORMALIZE);
- g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_DISABLE);
- g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
- g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
-
- Dimension dimension = getDimensions(context);
- GeneralPath path = new GeneralPath();
- g2d.setStroke(new BasicStroke(1,BasicStroke.CAP_BUTT,BasicStroke.JOIN_MITER));
- g2d.translate(28,28);
- Object [] data = (Object[]) restoreData(context);
- Color col = (Color)data[1];
-
- g2d.setColor(col);
-
- path.moveTo(0,46);
- path.lineTo(0,31);
- path.lineTo(30,1);
- path.lineTo(61,31);
- path.lineTo(61,46);
- path.lineTo(30,16);
- path.closePath();
- g2d.fill(path);
-
- g2d.translate(0,24);
-
- g2d.fill(path);
-
- AffineTransform transform = AffineTransform.getScaleInstance(dimension.getHeight()/128,
dimension.getHeight()/128);
- AffineTransformOp transformOp = new AffineTransformOp(transform,
AffineTransformOp.TYPE_BILINEAR);
-
- graphics2D.drawImage(bufferedImage,transformOp, 0, 0);
-
- g2d.dispose();
- }
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.iconimages;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.GeneralPath;
+import java.awt.image.AffineTransformOp;
+import java.awt.image.BufferedImage;
+import org.ajax4jsf.resource.ResourceContext;
+
+
+
+public class PanelMenuIconChevronUp extends PanelMenuIconBasic {
+
+ protected void paint(ResourceContext context, Graphics2D graphics2D) {
+ BufferedImage bufferedImage = new BufferedImage(128, 128,
BufferedImage.TYPE_INT_ARGB);
+ Graphics2D g2d = bufferedImage.createGraphics();
+
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_OFF);
+ g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
RenderingHints.VALUE_STROKE_NORMALIZE);
+ g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_DISABLE);
+ g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
+ g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
+
+ Dimension dimension = getDimensions(context);
+ GeneralPath path = new GeneralPath();
+ g2d.setStroke(new BasicStroke(1,BasicStroke.CAP_BUTT,BasicStroke.JOIN_MITER));
+ g2d.translate(28,28);
+ Object [] data = (Object[]) restoreData(context);
+ Color col = (Color)data[1];
+
+ g2d.setColor(col);
+
+ path.moveTo(0,46);
+ path.lineTo(0,31);
+ path.lineTo(30,1);
+ path.lineTo(61,31);
+ path.lineTo(61,46);
+ path.lineTo(30,16);
+ path.closePath();
+ g2d.fill(path);
+
+ g2d.translate(0,24);
+
+ g2d.fill(path);
+
+ AffineTransform transform = AffineTransform.getScaleInstance(dimension.getHeight()/128,
dimension.getHeight()/128);
+ AffineTransformOp transformOp = new AffineTransformOp(transform,
AffineTransformOp.TYPE_BILINEAR);
+
+ graphics2D.drawImage(bufferedImage,transformOp, 0, 0);
+
+ g2d.dispose();
+ }
}
\ No newline at end of file
Modified:
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconDisc.java
===================================================================
---
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconDisc.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconDisc.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -1,50 +1,50 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.iconimages;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.geom.Ellipse2D;
-import org.ajax4jsf.framework.resource.ResourceContext;
-
-
-
-public class PanelMenuIconDisc extends PanelMenuIconBasic {
-
- protected void paint(ResourceContext context, Graphics2D g2d) {
-
- Dimension dimension = getDimensions(context);
- Object [] data = (Object[]) restoreData(context);
- Color col = (Color)data[1];
-
- int dim = (int) Math.round(dimension.getWidth() / 3);
-
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.setColor(col);
- g2d.translate(dim,dim);
- Ellipse2D dot = new Ellipse2D.Double(0, 0, dim, dim);
- g2d.fill(dot);
-
- }
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.iconimages;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.Ellipse2D;
+import org.ajax4jsf.resource.ResourceContext;
+
+
+
+public class PanelMenuIconDisc extends PanelMenuIconBasic {
+
+ protected void paint(ResourceContext context, Graphics2D g2d) {
+
+ Dimension dimension = getDimensions(context);
+ Object [] data = (Object[]) restoreData(context);
+ Color col = (Color)data[1];
+
+ int dim = (int) Math.round(dimension.getWidth() / 3);
+
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
+ g2d.setColor(col);
+ g2d.translate(dim,dim);
+ Ellipse2D dot = new Ellipse2D.Double(0, 0, dim, dim);
+ g2d.fill(dot);
+
+ }
}
\ No newline at end of file
Modified:
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconGrid.java
===================================================================
---
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconGrid.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconGrid.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -1,63 +1,63 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.iconimages;
-
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.geom.Rectangle2D;
-import org.ajax4jsf.framework.resource.ResourceContext;
-
-
-
-public class PanelMenuIconGrid extends PanelMenuIconBasic {
-
-
- protected void paint(ResourceContext context, Graphics2D g2d) {
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
RenderingHints.VALUE_STROKE_NORMALIZE);
- g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_ENABLE);
- g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
- g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
- Rectangle2D.Float path = new Rectangle2D.Float();
- Dimension dimension = getDimensions(context);
- g2d.setStroke(new BasicStroke(16,BasicStroke.CAP_SQUARE,BasicStroke.JOIN_BEVEL));
- g2d.scale(dimension.getHeight()/128,dimension.getHeight()/128);
-
- g2d.translate(40,40);
-
- path.setRect(0,0,40,40);
- Object [] data = (Object[]) restoreData(context);
- Color col = (Color)data[1];
-
- g2d.setColor(col);
- Color bcolor = new Color(1f,1f,1f,0f);
- g2d.setBackground(bcolor);
- g2d.fill(path);
- g2d.clearRect(16,0,8,40);
- g2d.clearRect(0,16,40,8);
- }
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.iconimages;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.Rectangle2D;
+import org.ajax4jsf.resource.ResourceContext;
+
+
+
+public class PanelMenuIconGrid extends PanelMenuIconBasic {
+
+
+ protected void paint(ResourceContext context, Graphics2D g2d) {
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
+ g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
RenderingHints.VALUE_STROKE_NORMALIZE);
+ g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_ENABLE);
+ g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
+ g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
+ Rectangle2D.Float path = new Rectangle2D.Float();
+ Dimension dimension = getDimensions(context);
+ g2d.setStroke(new BasicStroke(16,BasicStroke.CAP_SQUARE,BasicStroke.JOIN_BEVEL));
+ g2d.scale(dimension.getHeight()/128,dimension.getHeight()/128);
+
+ g2d.translate(40,40);
+
+ path.setRect(0,0,40,40);
+ Object [] data = (Object[]) restoreData(context);
+ Color col = (Color)data[1];
+
+ g2d.setColor(col);
+ Color bcolor = new Color(1f,1f,1f,0f);
+ g2d.setBackground(bcolor);
+ g2d.fill(path);
+ g2d.clearRect(16,0,8,40);
+ g2d.clearRect(0,16,40,8);
+ }
}
\ No newline at end of file
Modified:
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconSpacer.java
===================================================================
---
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconSpacer.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconSpacer.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -1,33 +1,33 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.iconimages;
-
-import java.awt.Graphics2D;
-import org.ajax4jsf.framework.resource.ResourceContext;
-
-
-public class PanelMenuIconSpacer extends PanelMenuIconBasic {
-
- protected void paint(ResourceContext context, Graphics2D g2d) {
-
- }
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.iconimages;
+
+import java.awt.Graphics2D;
+import org.ajax4jsf.resource.ResourceContext;
+
+
+public class PanelMenuIconSpacer extends PanelMenuIconBasic {
+
+ protected void paint(ResourceContext context, Graphics2D g2d) {
+
+ }
}
\ No newline at end of file
Modified:
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangle.java
===================================================================
---
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangle.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangle.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -1,51 +1,51 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.iconimages;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.geom.GeneralPath;
-import org.ajax4jsf.framework.resource.ResourceContext;
-
-
-public class PanelMenuIconTriangle extends PanelMenuIconBasic {
-
- protected void paint(ResourceContext context, Graphics2D g2d) {
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_ENABLE);
- GeneralPath path = new GeneralPath();
-
- Dimension dimension = getDimensions(context);
- g2d.scale(dimension.getHeight()/128,dimension.getHeight()/128);
- g2d.translate(47,30);
- path.moveTo(0,0);
- path.lineTo(33,33);
- path.lineTo(33,34);
- path.lineTo(0,67);
- path.closePath();
- g2d.setColor((Color)(((Object[]) restoreData(context))[1]));
- g2d.fill(path);
- }
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.iconimages;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.GeneralPath;
+import org.ajax4jsf.resource.ResourceContext;
+
+
+public class PanelMenuIconTriangle extends PanelMenuIconBasic {
+
+ protected void paint(ResourceContext context, Graphics2D g2d) {
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
+ g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_ENABLE);
+ GeneralPath path = new GeneralPath();
+
+ Dimension dimension = getDimensions(context);
+ g2d.scale(dimension.getHeight()/128,dimension.getHeight()/128);
+ g2d.translate(47,30);
+ path.moveTo(0,0);
+ path.lineTo(33,33);
+ path.lineTo(33,34);
+ path.lineTo(0,67);
+ path.closePath();
+ g2d.setColor((Color)(((Object[]) restoreData(context))[1]));
+ g2d.fill(path);
+ }
}
\ No newline at end of file
Modified:
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangleDown.java
===================================================================
---
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangleDown.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangleDown.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -1,57 +1,57 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.iconimages;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.geom.GeneralPath;
-import org.ajax4jsf.framework.resource.ResourceContext;
-
-
-
-public class PanelMenuIconTriangleDown extends PanelMenuIconBasic {
-
- protected void paint(ResourceContext context, Graphics2D g2d) {
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_ENABLE);
- GeneralPath path = new GeneralPath();
-
- Dimension dimension = getDimensions(context);
-
- g2d.scale(dimension.getHeight()/128,dimension.getHeight()/128);
- g2d.translate(31,54);
-
- path.moveTo(0,0);
- path.lineTo(33,33);
- path.lineTo(34,33);
- path.lineTo(67,0);
- path.closePath();
- Object [] data = (Object[]) restoreData(context);
- Color col = (Color)data[1];
-
- g2d.setColor(col);
- g2d.fill(path);
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.iconimages;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.GeneralPath;
+import org.ajax4jsf.resource.ResourceContext;
+
+
+
+public class PanelMenuIconTriangleDown extends PanelMenuIconBasic {
+
+ protected void paint(ResourceContext context, Graphics2D g2d) {
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
+ g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_ENABLE);
+ GeneralPath path = new GeneralPath();
+
+ Dimension dimension = getDimensions(context);
+
+ g2d.scale(dimension.getHeight()/128,dimension.getHeight()/128);
+ g2d.translate(31,54);
+
+ path.moveTo(0,0);
+ path.lineTo(33,33);
+ path.lineTo(34,33);
+ path.lineTo(67,0);
+ path.closePath();
+ Object [] data = (Object[]) restoreData(context);
+ Color col = (Color)data[1];
+
+ g2d.setColor(col);
+ g2d.fill(path);
+ }
+}
Modified:
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangleUp.java
===================================================================
---
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangleUp.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangleUp.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -1,56 +1,56 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.iconimages;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.geom.GeneralPath;
-import org.ajax4jsf.framework.resource.ResourceContext;
-
-
-
-public class PanelMenuIconTriangleUp extends PanelMenuIconBasic {
-
- protected void paint(ResourceContext context, Graphics2D g2d) {
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_ENABLE);
- GeneralPath path = new GeneralPath();
-
- Dimension dimension = getDimensions(context);
-
- g2d.scale(dimension.getHeight()/128,dimension.getHeight()/128);
- g2d.translate(31,47);
- path.moveTo(0,33);
- path.lineTo(33,0);
- path.lineTo(34,0);
- path.lineTo(67,33);
- path.closePath();
- Object [] data = (Object[]) restoreData(context);
- Color col = (Color)data[1];
-
- g2d.setColor(col);
- g2d.fill(path);
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.iconimages;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.GeneralPath;
+import org.ajax4jsf.resource.ResourceContext;
+
+
+
+public class PanelMenuIconTriangleUp extends PanelMenuIconBasic {
+
+ protected void paint(ResourceContext context, Graphics2D g2d) {
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
+ g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_ENABLE);
+ GeneralPath path = new GeneralPath();
+
+ Dimension dimension = getDimensions(context);
+
+ g2d.scale(dimension.getHeight()/128,dimension.getHeight()/128);
+ g2d.translate(31,47);
+ path.moveTo(0,33);
+ path.lineTo(33,0);
+ path.lineTo(34,0);
+ path.lineTo(67,33);
+ path.closePath();
+ Object [] data = (Object[]) restoreData(context);
+ Color col = (Color)data[1];
+
+ g2d.setColor(col);
+ g2d.fill(path);
+ }
+}
Modified:
trunk/sandbox/ui/panelmenu/src/test/java/org/richfaces/component/PanelMenuComponentTest.java
===================================================================
---
trunk/sandbox/ui/panelmenu/src/test/java/org/richfaces/component/PanelMenuComponentTest.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/panelmenu/src/test/java/org/richfaces/component/PanelMenuComponentTest.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -1,322 +1,322 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.component;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.faces.component.UIForm;
-import javax.faces.component.html.HtmlForm;
-import javax.servlet.http.HttpServletResponse;
-
-import org.ajax4jsf.framework.resource.InternetResource;
-import org.ajax4jsf.framework.resource.InternetResourceBuilder;
-import org.ajax4jsf.framework.resource.ResourceBuilderImpl;
-import org.ajax4jsf.framework.util.image.ImageInfo;
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.apache.commons.lang.StringUtils;
-import org.richfaces.component.UIPanelMenu;
-import org.richfaces.component.UIPanelMenuGroup;
-import org.richfaces.component.UIPanelMenuItem;
-
-import com.gargoylesoftware.htmlunit.Page;
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlScript;
-
-/**
- * Unit test for simple Component.
- */
-public class PanelMenuComponentTest extends AbstractAjax4JsfTestCase {
- private static Set javaScripts = new HashSet();
-
- private String[] imageResources = new String[]{
- "org.richfaces.renderkit.html.iconimages.PanelMenuIconChevron",
-
"org.richfaces.renderkit.html.iconimages.PanelMenuIconChevronDown",
- "org.richfaces.renderkit.html.iconimages.PanelMenuIconChevronUp",
- "org.richfaces.renderkit.html.iconimages.PanelMenuIconDisc",
- "org.richfaces.renderkit.html.iconimages.PanelMenuIconGrid",
- "org.richfaces.renderkit.html.iconimages.PanelMenuIconSpacer",
- "org.richfaces.renderkit.html.iconimages.PanelMenuIconTriangle",
-
"org.richfaces.renderkit.html.iconimages.PanelMenuIconTriangleDown",
- "org.richfaces.renderkit.html.iconimages.PanelMenuIconTriangleUp"
- };
-
- static {
- javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
- javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
- javaScripts.add("org/richfaces/renderkit/html/scripts/utils.js");
- javaScripts.add("org/richfaces/renderkit/html/scripts/panelMenu.js");
- }
-
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public PanelMenuComponentTest( String testName )
- {
- super( testName );
- }
-
- private UIForm form;
- private UIPanelMenu panelMenu;
- private UIPanelMenuGroup group1;
- private UIPanelMenuGroup group2;
- private UIPanelMenuGroup group3;
- private UIPanelMenuItem item1;
- private UIPanelMenuItem item2;
-
- public void setUp() throws Exception {
- super.setUp();
-
- application.addComponent("org.richfaces.panelMenu",
"org.richfaces.component.html.HtmlPanelMenu");
- application.addComponent("org.richfaces.panelMenuGroup",
"org.richfaces.component.html.HtmlPanelMenuGroup");
- application.addComponent("org.richfaces.panelMenuItem",
"org.richfaces.component.html.HtmlPanelMenuItem");
-
- form = new HtmlForm();
- form.setId("form");
- facesContext.getViewRoot().getChildren().add(form);
-
- panelMenu =
(UIPanelMenu)application.createComponent("org.richfaces.panelMenu");
- panelMenu.setId("panelMenu");
- form.getChildren().add(panelMenu);
-
- group1 =
(UIPanelMenuGroup)application.createComponent("org.richfaces.panelMenuGroup");
- group1.setId("group1");
- group1.setDisabled(true);
- panelMenu.getChildren().add(group1);
-
- group2 =
(UIPanelMenuGroup)application.createComponent("org.richfaces.panelMenuGroup");
- group2.setId("group2");
- panelMenu.getChildren().add(group2);
-
- item1 =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
- item1.setId("item1");
- group1.getChildren().add(item1);
-
- group3 =
(UIPanelMenuGroup)application.createComponent("org.richfaces.panelMenuGroup");
- group3.setId("subgroup");
- group2.getChildren().add(group3);
-
- item2 =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
- item2.setId("item2");
- item2.setDisabled(true);
- group2.getChildren().add(item2);
-
- // Items for testing standard icons.
- UIPanelMenuItem item =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
- item.setIcon("triangle");
- group2.getChildren().add(item);
-
- item =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
- item.setIcon("spacer");
- group2.getChildren().add(item);
-
- item =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
- item.setIcon("triangleDown");
- group2.getChildren().add(item);
-
- item =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
- item.setIcon("triangleUp");
- group2.getChildren().add(item);
-
- item =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
- item.setIcon("chevron");
- group2.getChildren().add(item);
-
- item =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
- item.setIcon("chevronUp");
- group2.getChildren().add(item);
-
- item =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
- item.setIcon("chevronDown");
- group2.getChildren().add(item);
-
- item =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
- item.setIcon("disc");
- group2.getChildren().add(item);
-
- item =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
- item.setIcon("grid");
- group2.getChildren().add(item);
-
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
-
- item1 = null;
- item2 = null;
- group1 = null;
- group2 = null;
- form = null;
- }
-
- /**
- * Test component rendering
- *
- * @throws Exception
- */
- public void testRender() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
- System.out.println(page.asXml());
-
- HtmlElement div = page.getHtmlElementById(panelMenu.getClientId(facesContext));
- assertNotNull(div);
- assertEquals("div", div.getNodeName());
-
- HtmlElement firstGroupDiv = page.getHtmlElementById("tdhide" +
group1.getClientId(facesContext));
- assertNotNull(firstGroupDiv);
- assertEquals("div", firstGroupDiv.getNodeName());
-
- String styleClass = firstGroupDiv.getAttributeValue("class");
- assertTrue(styleClass.contains("dr-pmenu-group-div"));
-
- HtmlElement firstGroupHide = page.getHtmlElementById("tablehide" +
group1.getClientId(facesContext));
- assertNotNull(firstGroupHide);
- assertEquals("table", firstGroupHide.getNodeName());
-
- styleClass = firstGroupHide.getAttributeValue("class");
- assertTrue(styleClass.contains("dr-pmenu-top-group"));
- assertTrue(styleClass.contains("rich-pmenu-group"));
- assertTrue(styleClass.contains("rich-pmenu-disabled-element"));
- assertTrue(styleClass.contains("dr-pmenu-disabled-element"));
-
- HtmlElement subGroupDiv = page.getHtmlElementById("tdhide" +
group3.getClientId(facesContext));
- assertNotNull(subGroupDiv);
- assertEquals("div", subGroupDiv.getNodeName());
-
- HtmlElement subGroupHide = page.getHtmlElementById("tablehide" +
group3.getClientId(facesContext));
- assertNotNull(subGroupHide);
- assertEquals("table", subGroupHide.getNodeName());
-
- styleClass = subGroupHide.getAttributeValue("class");
- assertTrue(styleClass.contains("dr-pmenu-group"));
- assertTrue(styleClass.contains("rich-pmenu-group"));
-
- HtmlElement leftIcon = page.getHtmlElementById("leftIcon" +
group1.getClientId(facesContext));
- assertNotNull(leftIcon);
- assertEquals("img", leftIcon.getNodeName());
-
- HtmlElement rightIcon = page.getHtmlElementById("rightIcon" +
group1.getClientId(facesContext));
- assertNotNull(rightIcon);
- assertEquals("img", rightIcon.getNodeName());
-
- HtmlElement firstItemHide = page.getHtmlElementById("tablehide" +
item1.getClientId(facesContext));
- assertNotNull(firstItemHide);
- assertEquals("table", firstItemHide.getNodeName());
-
- styleClass = firstItemHide.getAttributeValue("class");
- assertTrue(styleClass.contains("dr-pmenu-item"));
- assertTrue(styleClass.contains("rich-pmenu-item"));
-
- leftIcon = page.getHtmlElementById("leftIcon" +
item1.getClientId(facesContext));
- assertNotNull(leftIcon);
- assertEquals("img", leftIcon.getNodeName());
-
- rightIcon = page.getHtmlElementById("rightIcon" +
item1.getClientId(facesContext));
- assertNotNull(rightIcon);
- assertEquals("img", rightIcon.getNodeName());
-
- HtmlElement secondItemHide = page.getHtmlElementById("tablehide" +
item2.getClientId(facesContext));
- assertNotNull(secondItemHide);
- assertEquals("table", secondItemHide.getNodeName());
-
- styleClass = secondItemHide.getAttributeValue("class");
- assertTrue(styleClass.contains("rich-pmenu-disabled-element"));
- }
-
- /**
- * Test style rendering
- *
- * @throws Exception
- */
- public void testRenderStyle() throws Exception {
- HtmlPage view = renderView();
- assertNotNull(view);
- List links =
view.getDocumentElement().getHtmlElementsByTagName("link");
- assertEquals(1, links.size());
- HtmlElement link = (HtmlElement) links.get(0);
-
assertTrue(link.getAttributeValue("href").contains("css/panelMenu.xcss"));
-
- InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
- InternetResource resource =
builder.getResource("org/richfaces/renderkit/html/css/panelMenu.xcss");
- assertNotNull(resource);
- String uri = "http:" + resource.getUri(facesContext, null);
- Page page = webClient.getPage(uri);
- assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
- }
-
- /**
- * Test script rendering
- *
- * @throws Exception
- */
- public void testRenderScript() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
- List scripts =
page.getDocumentElement().getHtmlElementsByTagName("script");
- for (Iterator it = scripts.iterator(); it.hasNext();) {
- HtmlScript item = (HtmlScript) it.next();
- String srcAttr = item.getSrcAttribute();
-
- if (StringUtils.isNotBlank(srcAttr)) {
- boolean found = false;
- for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();)
- {
- String src = (String) srcIt.next();
-
- found = srcAttr.contains(src);
- if (found) {
- break;
- }
- }
-
- assertTrue(found);
- }
- }
- }
-
- public void testRenderImages() throws Exception {
- HtmlPage view = renderView();
- assertNotNull(view);
-
- InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
-
- for (int i = 0; i < imageResources.length; i++) {
- InternetResource resource = builder.getResource(imageResources[i]);
- assertNotNull(resource);
- String uri = "http:" + resource.getUri(facesContext, null);
- Page page = webClient.getPage(uri);
- assertTrue(page.getWebResponse().getStatusCode() ==
HttpServletResponse.SC_OK);
- ImageInfo info = new ImageInfo();
- info.setInput(page.getWebResponse().getContentAsStream());
- //image recognizable?
- assertTrue(info.check());
- assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
- }
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.html.HtmlForm;
+import javax.servlet.http.HttpServletResponse;
+
+import org.ajax4jsf.resource.InternetResource;
+import org.ajax4jsf.resource.InternetResourceBuilder;
+import org.ajax4jsf.resource.ResourceBuilderImpl;
+import org.ajax4jsf.resource.image.ImageInfo;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.apache.commons.lang.StringUtils;
+import org.richfaces.component.UIPanelMenu;
+import org.richfaces.component.UIPanelMenuGroup;
+import org.richfaces.component.UIPanelMenuItem;
+
+import com.gargoylesoftware.htmlunit.Page;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlScript;
+
+/**
+ * Unit test for simple Component.
+ */
+public class PanelMenuComponentTest extends AbstractAjax4JsfTestCase {
+ private static Set javaScripts = new HashSet();
+
+ private String[] imageResources = new String[]{
+ "org.richfaces.renderkit.html.iconimages.PanelMenuIconChevron",
+
"org.richfaces.renderkit.html.iconimages.PanelMenuIconChevronDown",
+ "org.richfaces.renderkit.html.iconimages.PanelMenuIconChevronUp",
+ "org.richfaces.renderkit.html.iconimages.PanelMenuIconDisc",
+ "org.richfaces.renderkit.html.iconimages.PanelMenuIconGrid",
+ "org.richfaces.renderkit.html.iconimages.PanelMenuIconSpacer",
+ "org.richfaces.renderkit.html.iconimages.PanelMenuIconTriangle",
+
"org.richfaces.renderkit.html.iconimages.PanelMenuIconTriangleDown",
+ "org.richfaces.renderkit.html.iconimages.PanelMenuIconTriangleUp"
+ };
+
+ static {
+ javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
+ javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
+ javaScripts.add("org/richfaces/renderkit/html/scripts/utils.js");
+ javaScripts.add("org/richfaces/renderkit/html/scripts/panelMenu.js");
+ }
+
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public PanelMenuComponentTest( String testName )
+ {
+ super( testName );
+ }
+
+ private UIForm form;
+ private UIPanelMenu panelMenu;
+ private UIPanelMenuGroup group1;
+ private UIPanelMenuGroup group2;
+ private UIPanelMenuGroup group3;
+ private UIPanelMenuItem item1;
+ private UIPanelMenuItem item2;
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ application.addComponent("org.richfaces.panelMenu",
"org.richfaces.component.html.HtmlPanelMenu");
+ application.addComponent("org.richfaces.panelMenuGroup",
"org.richfaces.component.html.HtmlPanelMenuGroup");
+ application.addComponent("org.richfaces.panelMenuItem",
"org.richfaces.component.html.HtmlPanelMenuItem");
+
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ panelMenu =
(UIPanelMenu)application.createComponent("org.richfaces.panelMenu");
+ panelMenu.setId("panelMenu");
+ form.getChildren().add(panelMenu);
+
+ group1 =
(UIPanelMenuGroup)application.createComponent("org.richfaces.panelMenuGroup");
+ group1.setId("group1");
+ group1.setDisabled(true);
+ panelMenu.getChildren().add(group1);
+
+ group2 =
(UIPanelMenuGroup)application.createComponent("org.richfaces.panelMenuGroup");
+ group2.setId("group2");
+ panelMenu.getChildren().add(group2);
+
+ item1 =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item1.setId("item1");
+ group1.getChildren().add(item1);
+
+ group3 =
(UIPanelMenuGroup)application.createComponent("org.richfaces.panelMenuGroup");
+ group3.setId("subgroup");
+ group2.getChildren().add(group3);
+
+ item2 =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item2.setId("item2");
+ item2.setDisabled(true);
+ group2.getChildren().add(item2);
+
+ // Items for testing standard icons.
+ UIPanelMenuItem item =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item.setIcon("triangle");
+ group2.getChildren().add(item);
+
+ item =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item.setIcon("spacer");
+ group2.getChildren().add(item);
+
+ item =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item.setIcon("triangleDown");
+ group2.getChildren().add(item);
+
+ item =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item.setIcon("triangleUp");
+ group2.getChildren().add(item);
+
+ item =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item.setIcon("chevron");
+ group2.getChildren().add(item);
+
+ item =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item.setIcon("chevronUp");
+ group2.getChildren().add(item);
+
+ item =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item.setIcon("chevronDown");
+ group2.getChildren().add(item);
+
+ item =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item.setIcon("disc");
+ group2.getChildren().add(item);
+
+ item =
(UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item.setIcon("grid");
+ group2.getChildren().add(item);
+
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+
+ item1 = null;
+ item2 = null;
+ group1 = null;
+ group2 = null;
+ form = null;
+ }
+
+ /**
+ * Test component rendering
+ *
+ * @throws Exception
+ */
+ public void testRender() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ System.out.println(page.asXml());
+
+ HtmlElement div = page.getHtmlElementById(panelMenu.getClientId(facesContext));
+ assertNotNull(div);
+ assertEquals("div", div.getNodeName());
+
+ HtmlElement firstGroupDiv = page.getHtmlElementById("tdhide" +
group1.getClientId(facesContext));
+ assertNotNull(firstGroupDiv);
+ assertEquals("div", firstGroupDiv.getNodeName());
+
+ String styleClass = firstGroupDiv.getAttributeValue("class");
+ assertTrue(styleClass.contains("dr-pmenu-group-div"));
+
+ HtmlElement firstGroupHide = page.getHtmlElementById("tablehide" +
group1.getClientId(facesContext));
+ assertNotNull(firstGroupHide);
+ assertEquals("table", firstGroupHide.getNodeName());
+
+ styleClass = firstGroupHide.getAttributeValue("class");
+ assertTrue(styleClass.contains("dr-pmenu-top-group"));
+ assertTrue(styleClass.contains("rich-pmenu-group"));
+ assertTrue(styleClass.contains("rich-pmenu-disabled-element"));
+ assertTrue(styleClass.contains("dr-pmenu-disabled-element"));
+
+ HtmlElement subGroupDiv = page.getHtmlElementById("tdhide" +
group3.getClientId(facesContext));
+ assertNotNull(subGroupDiv);
+ assertEquals("div", subGroupDiv.getNodeName());
+
+ HtmlElement subGroupHide = page.getHtmlElementById("tablehide" +
group3.getClientId(facesContext));
+ assertNotNull(subGroupHide);
+ assertEquals("table", subGroupHide.getNodeName());
+
+ styleClass = subGroupHide.getAttributeValue("class");
+ assertTrue(styleClass.contains("dr-pmenu-group"));
+ assertTrue(styleClass.contains("rich-pmenu-group"));
+
+ HtmlElement leftIcon = page.getHtmlElementById("leftIcon" +
group1.getClientId(facesContext));
+ assertNotNull(leftIcon);
+ assertEquals("img", leftIcon.getNodeName());
+
+ HtmlElement rightIcon = page.getHtmlElementById("rightIcon" +
group1.getClientId(facesContext));
+ assertNotNull(rightIcon);
+ assertEquals("img", rightIcon.getNodeName());
+
+ HtmlElement firstItemHide = page.getHtmlElementById("tablehide" +
item1.getClientId(facesContext));
+ assertNotNull(firstItemHide);
+ assertEquals("table", firstItemHide.getNodeName());
+
+ styleClass = firstItemHide.getAttributeValue("class");
+ assertTrue(styleClass.contains("dr-pmenu-item"));
+ assertTrue(styleClass.contains("rich-pmenu-item"));
+
+ leftIcon = page.getHtmlElementById("leftIcon" +
item1.getClientId(facesContext));
+ assertNotNull(leftIcon);
+ assertEquals("img", leftIcon.getNodeName());
+
+ rightIcon = page.getHtmlElementById("rightIcon" +
item1.getClientId(facesContext));
+ assertNotNull(rightIcon);
+ assertEquals("img", rightIcon.getNodeName());
+
+ HtmlElement secondItemHide = page.getHtmlElementById("tablehide" +
item2.getClientId(facesContext));
+ assertNotNull(secondItemHide);
+ assertEquals("table", secondItemHide.getNodeName());
+
+ styleClass = secondItemHide.getAttributeValue("class");
+ assertTrue(styleClass.contains("rich-pmenu-disabled-element"));
+ }
+
+ /**
+ * Test style rendering
+ *
+ * @throws Exception
+ */
+ public void testRenderStyle() throws Exception {
+ HtmlPage view = renderView();
+ assertNotNull(view);
+ List links =
view.getDocumentElement().getHtmlElementsByTagName("link");
+ assertEquals(1, links.size());
+ HtmlElement link = (HtmlElement) links.get(0);
+
assertTrue(link.getAttributeValue("href").contains("css/panelMenu.xcss"));
+
+ InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
+ InternetResource resource =
builder.getResource("org/richfaces/renderkit/html/css/panelMenu.xcss");
+ assertNotNull(resource);
+ String uri = "http:" + resource.getUri(facesContext, null);
+ Page page = webClient.getPage(uri);
+ assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
+ }
+
+ /**
+ * Test script rendering
+ *
+ * @throws Exception
+ */
+ public void testRenderScript() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ List scripts =
page.getDocumentElement().getHtmlElementsByTagName("script");
+ for (Iterator it = scripts.iterator(); it.hasNext();) {
+ HtmlScript item = (HtmlScript) it.next();
+ String srcAttr = item.getSrcAttribute();
+
+ if (StringUtils.isNotBlank(srcAttr)) {
+ boolean found = false;
+ for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();)
+ {
+ String src = (String) srcIt.next();
+
+ found = srcAttr.contains(src);
+ if (found) {
+ break;
+ }
+ }
+
+ assertTrue(found);
+ }
+ }
+ }
+
+ public void testRenderImages() throws Exception {
+ HtmlPage view = renderView();
+ assertNotNull(view);
+
+ InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
+
+ for (int i = 0; i < imageResources.length; i++) {
+ InternetResource resource = builder.getResource(imageResources[i]);
+ assertNotNull(resource);
+ String uri = "http:" + resource.getUri(facesContext, null);
+ Page page = webClient.getPage(uri);
+ assertTrue(page.getWebResponse().getStatusCode() ==
HttpServletResponse.SC_OK);
+ ImageInfo info = new ImageInfo();
+ info.setInput(page.getWebResponse().getContentAsStream());
+ //image recognizable?
+ assertTrue(info.check());
+ assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
+ }
+ }
+}
Added: trunk/sandbox/ui/pom.xml
===================================================================
--- trunk/sandbox/ui/pom.xml (rev 0)
+++ trunk/sandbox/ui/pom.xml 2007-07-13 16:42:27 UTC (rev 1622)
@@ -0,0 +1,21 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>ui</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.sandbox</groupId>
+ <packaging>pom</packaging>
+ <artifactId>ui</artifactId>
+ <name>Richfaces Sandbox UI</name>
+ <modules>
+ <module>calendar</module>
+ <module>panelmenu</module>
+ <module>panel2</module>
+ <!--module>scrollable-grid</module-->
+ <module>simpleTogglePanel2</module>
+ </modules>
+</project>
\ No newline at end of file
Modified: trunk/sandbox/ui/scrollable-grid/pom.xml
===================================================================
--- trunk/sandbox/ui/scrollable-grid/pom.xml 2007-07-13 13:14:47 UTC (rev 1621)
+++ trunk/sandbox/ui/scrollable-grid/pom.xml 2007-07-13 16:42:27 UTC (rev 1622)
@@ -1,13 +1,12 @@
<?xml version="1.0"?><project>
<parent>
- <artifactId>sandbox-parent</artifactId>
- <groupId>org.richfaces</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>ui</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
+ <version>3.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.sandbox.ui</groupId>
<artifactId>scrollable-grid</artifactId>
- <version>1.0.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
@@ -62,14 +61,9 @@
</build>
<dependencies>
<dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>ajax4jsf</artifactId>
- <version>3.1.0-SNAPSHOT</version>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>impl</artifactId>
+ <version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces</artifactId>
- <version>3.1.0-SNAPSHOT</version>
- </dependency>
</dependencies>
</project>
\ No newline at end of file
Modified:
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
===================================================================
---
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -16,14 +16,14 @@
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
-import org.ajax4jsf.ajax.repeat.DataComponentState;
-import org.ajax4jsf.ajax.repeat.DataVisitor;
-import org.ajax4jsf.ajax.repeat.ExtendedDataModel;
-import org.ajax4jsf.ajax.repeat.Range;
-import org.ajax4jsf.ajax.repeat.UIDataAdaptor;
-import org.ajax4jsf.framework.ajax.AjaxComponent;
-import org.ajax4jsf.framework.ajax.AjaxContext;
-import org.ajax4jsf.framework.ajax.AjaxEvent;
+import org.ajax4jsf.model.DataComponentState;
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
+import org.ajax4jsf.component.UIDataAdaptor;
+import org.ajax4jsf.component.AjaxComponent;
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.event.AjaxEvent;
import org.apache.commons.collections.iterators.IteratorChain;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified:
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java
===================================================================
---
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -8,6 +8,8 @@
import org.richfaces.event.sort.SortListener;
import org.richfaces.event.sort.SortSource;
+import javax.faces.UIColumn;
+
/**
* @author Anton Belevich
*
Modified: trunk/sandbox/ui/simpleTogglePanel2/pom.xml
===================================================================
--- trunk/sandbox/ui/simpleTogglePanel2/pom.xml 2007-07-13 13:14:47 UTC (rev 1621)
+++ trunk/sandbox/ui/simpleTogglePanel2/pom.xml 2007-07-13 16:42:27 UTC (rev 1622)
@@ -1,11 +1,11 @@
<?xml version="1.0"?><project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>ui</artifactId>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.sandbox</groupId>
<version>3.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.sandbox.ui</groupId>
<artifactId>simpleTogglePanel2</artifactId>
<name>Toggle panel</name>
<build>
@@ -42,8 +42,8 @@
</build>
<dependencies>
<dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>common</artifactId>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>impl</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
Modified:
trunk/sandbox/ui/simpleTogglePanel2/src/main/config/component/simpleTogglePanel2.xml
===================================================================
---
trunk/sandbox/ui/simpleTogglePanel2/src/main/config/component/simpleTogglePanel2.xml 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/simpleTogglePanel2/src/main/config/component/simpleTogglePanel2.xml 2007-07-13
16:42:27 UTC (rev 1622)
@@ -23,7 +23,7 @@
<name>simpleTogglePanel2</name>
<classname>org.richfaces.taglib.SimpleTogglePanel2Tag</classname>
<superclass>
- org.ajax4jsf.framework.taglib.HtmlComponentTagBase
+ org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
</superclass>
</tag>
Modified:
trunk/sandbox/ui/simpleTogglePanel2/src/main/java/org/richfaces/component/UISimpleTogglePanel2.java
===================================================================
---
trunk/sandbox/ui/simpleTogglePanel2/src/main/java/org/richfaces/component/UISimpleTogglePanel2.java 2007-07-13
13:14:47 UTC (rev 1621)
+++
trunk/sandbox/ui/simpleTogglePanel2/src/main/java/org/richfaces/component/UISimpleTogglePanel2.java 2007-07-13
16:42:27 UTC (rev 1622)
@@ -21,9 +21,9 @@
package org.richfaces.component;
-import org.ajax4jsf.framework.ajax.AjaxActionComponent;
-import org.ajax4jsf.framework.ajax.AjaxComponent;
-import org.ajax4jsf.framework.ajax.AjaxSource;
+import org.ajax4jsf.component.AjaxActionComponent;
+import org.ajax4jsf.component.AjaxComponent;
+import org.ajax4jsf.event.AjaxSource;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import javax.faces.component.ActionSource;
Copied: trunk/sandbox/ui/tooltip (from rev 1621, trunk/sandbox/tooltip)