JBoss Rich Faces SVN: r6016 - management/design/progressBar/markup.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2008-02-11 13:24:55 -0500 (Mon, 11 Feb 2008)
New Revision: 6016
Modified:
management/design/progressBar/markup/ProgressBar.html
Log:
Modified: management/design/progressBar/markup/ProgressBar.html
===================================================================
--- management/design/progressBar/markup/ProgressBar.html 2008-02-11 18:12:10 UTC (rev 6015)
+++ management/design/progressBar/markup/ProgressBar.html 2008-02-11 18:24:55 UTC (rev 6016)
@@ -8,22 +8,22 @@
legend{font-weight : bold}
body{margin : 20px}
-*{font-family : verdana; font-size : 11px}
+*!{font-family : verdana; font-size : 11px}
.pbar_block{ white-space : nowrap;}
.pbar_bar_height{height : 13px;}
.pbar_bar_width{width : 200px}
-.pbar_bar_uploaded{width : 99px; background : #FF9409/*selectControlColor*/; background-image : url(images/bg_ProgressBar_perm.gif);background-repeat : repeat-x;}
+.pbar_bar_uploaded{width : 99px; background : #FF9409/*selectControlColor*/; background-image : url(images/bg_ProgressBar_perm.gif);background-repeat : repeat-x;font-family : verdana/*generalFamilyFont*/; font-size : 11px/*generalSizeFont*/}
.pbar_bar_shell{margin-bottom : 2px; background : #FFFFFF /*controlBackgroundColor*/; border : 1px solid #c0c0c0/*panelBorderColor*/;}
.pbar_bar_height_dig{height:}
-.pbar_bar_uploaded_dig{width : 99px; overflow : hidden; position : absolute; top : 0px; left : 0px;}
-.pbar_bar_shell_dig{position : relative; margin-bottom : 2px; border : 1px solid #c0c0c0/*panelBorderColor*/;}
-.pbar_bar_track_dig{background : #FFFFFF /*controlBackgroundColor*/; text-align : center; color : #000000 /*controlTextColor*/; font-weight : bold; position : relative;}
-.pbar_bar_ststusline_dig{background : #FF9409/*selectControlColor*/; text-align : center; color : #FFFFFF /*controlBackgroundColor*/; font-weight : bold; background-image : url(images/bg_ProgressBar_perm.gif);background-repeat : repeat-x;}
+.pbar_bar_uploaded_dig{width : 99px; overflow : hidden; position : absolute; top : 0px; left : 0px;font-family : verdana/*generalFamilyFont*/; font-size : 11px/*generalSizeFont*/}
+.pbar_bar_shell_dig{position : relative; margin-bottom : 2px; border : 1px solid #c0c0c0/*panelBorderColor*/;font-family : verdana/*generalFamilyFont*/; font-size : 11px/*generalSizeFont*/}
+.pbar_bar_track_dig{background : #FFFFFF /*controlBackgroundColor*/; text-align : center;font-family : verdana/*generalFamilyFont*/; font-size : 11px/*generalSizeFont*/; color : #000000 /*controlTextColor*/; font-weight : bold; position : relative;}
+.pbar_bar_ststusline_dig{background : #FF9409/*selectControlColor*/; text-align : center;font-family : verdana/*generalFamilyFont*/; font-size : 11px/*generalSizeFont*/; color : #000000 /*controlTextColor*/; font-weight : bold; background-image : url(images/bg_ProgressBar_perm.gif);background-repeat : repeat-x;}
.pbar_bar_padding{padding: 0px}
-.pbar_name_padding{padding : 0px 0px 2px 0px; font-size : 10px}
+.pbar_name_padding{padding : 0px 0px 2px 0px;font-family : verdana/*generalFamilyFont*/; font-size : 11px/*generalSizeFont*/}
</style>
</head>
@@ -39,7 +39,6 @@
</div>
<div class="pbar_block pbar_bar_width pbar_bar_shell">
<div class="pbar_bar_height pbar_bar_uploaded">
-
</div>
</div>
<div class="pbar_name_padding">
18 years, 2 months
JBoss Rich Faces SVN: r6015 - in trunk: samples and 30 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-02-11 13:12:10 -0500 (Mon, 11 Feb 2008)
New Revision: 6015
Added:
trunk/samples/jira-data/
trunk/samples/jira-data/pom.xml
trunk/samples/jira-data/src/
trunk/samples/jira-data/src/main/
trunk/samples/jira-data/src/main/java/
trunk/samples/jira-data/src/main/java/META-INF/
trunk/samples/jira-data/src/main/java/META-INF/MANIFEST.MF
trunk/samples/jira-data/src/main/java/org/
trunk/samples/jira-data/src/main/java/org/richfaces/
trunk/samples/jira-data/src/main/java/org/richfaces/demo/
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/bean/
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Channel.java
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Issue.java
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/JiraUser.java
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Key.java
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Priority.java
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Rss.java
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Status.java
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Type.java
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/service/
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/service/JiraService.java
trunk/samples/jira-data/src/main/resources/
trunk/samples/jira-data/src/main/resources/META-INF/
trunk/samples/jira-data/src/main/resources/META-INF/faces-config.xml
trunk/samples/jira-data/src/main/resources/jira-issues.jar
trunk/samples/jira-data/src/test/
trunk/samples/jira-data/src/test/java/
trunk/samples/jira-data/src/test/java/org/
trunk/samples/jira-data/src/test/java/org/richfaces/
trunk/samples/jira-data/src/test/java/org/richfaces/demo/
trunk/samples/jira-data/src/test/java/org/richfaces/demo/datagrid/
trunk/samples/jira-data/src/test/java/org/richfaces/demo/datagrid/service/
trunk/samples/jira-data/src/test/java/org/richfaces/demo/datagrid/service/JiraServiceTest.java
Removed:
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Channel.java
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Issue.java
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/JiraUser.java
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Key.java
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Priority.java
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Rss.java
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Status.java
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Type.java
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/service/JiraService.java
trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/lib/jira-issues.jar
Modified:
trunk/
trunk/samples/pom.xml
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml
trunk/samples/scrollableDataTableDemo/pom.xml
trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox/samples/
trunk/sandbox/samples/sortingFilteringDemo/pom.xml
trunk/sandbox/samples/sortingFilteringDemo/src/main/webapp/pages/index.jsp
trunk/ui/scrollableDataTable/src/main/java/META-INF/MANIFEST.MF
Log:
refactored scrollable data table demo
Property changes on: trunk
___________________________________________________________________
Name: svn:ignore
- .project
.checkstyle
target
+ .project
.checkstyle
target
.metadata
Property changes on: trunk/samples/jira-data
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.classpath
.*
Added: trunk/samples/jira-data/pom.xml
===================================================================
--- trunk/samples/jira-data/pom.xml (rev 0)
+++ trunk/samples/jira-data/pom.xml 2008-02-11 18:12:10 UTC (rev 6015)
@@ -0,0 +1,20 @@
+<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>samples</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.samples</groupId>
+ <artifactId>jira-data</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <name>webapp Maven Webapp</name>
+ <dependencies>
+ <dependency>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <version>1.8</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/samples/jira-data/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/samples/jira-data/src/main/java/META-INF/MANIFEST.MF (rev 0)
+++ trunk/samples/jira-data/src/main/java/META-INF/MANIFEST.MF 2008-02-11 18:12:10 UTC (rev 6015)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Channel.java
===================================================================
--- trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Channel.java (rev 0)
+++ trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Channel.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -0,0 +1,309 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Channel.java,v $
+ * $Revision: 1.8 $
+ */
+
+package org.richfaces.demo.datagrid.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.richfaces.model.SortField;
+import org.richfaces.model.SortOrder;
+
+
+
+/**
+ * @author Maksim Kaszynski
+ * @modified by Anton Belevich
+ *
+ */
+public class Channel {
+
+ private static final Log log = LogFactory.getLog(Channel.class);
+
+ private static final Comparator<Issue> byIdDesc = new Comparator<Issue>(){
+ public int compare(Issue o1, Issue o2) {
+ return o2.getIndex() - o1.getIndex();
+ }
+ };
+ private static final Comparator<Issue> byIdAsc = new Comparator<Issue>(){
+ public int compare(Issue o1, Issue o2) {
+ return o1.getIndex() - o2.getIndex();
+ }
+ };
+
+ private static final Comparator<Issue> byPriAsc = new Comparator<Issue>(){
+ public int compare(Issue o1, Issue o2) {
+ return o1.getPriority().getId() - o2.getPriority().getId();
+ }
+ };
+ private static final Comparator<Issue> byPriDesc = new Comparator<Issue>(){
+ public int compare(Issue o1, Issue o2) {
+ return o2.getPriority().getId() - o1.getPriority().getId();
+ }
+ };
+
+ private static final Comparator<JiraUser> jiraUserComparator = new Comparator<JiraUser> () {
+ public int compare(JiraUser o1, JiraUser o2) {
+ return o1.getName().compareTo(o2.getName());
+ }
+ };
+
+ private static final Comparator<Issue> byAssigneeAsc = new Comparator<Issue>(){
+ public int compare(Issue o1, Issue o2) {
+ return jiraUserComparator.compare(o1.getAssignee(), o2.getAssignee());
+ }
+ };
+ private static final Comparator<Issue> byAssigneeDesc = new Comparator<Issue>(){
+ public int compare(Issue o1, Issue o2) {
+ return -byAssigneeAsc.compare(o1, o2);
+ }
+ };
+
+ static final Comparator<Issue> byReporterAsc = new Comparator<Issue>(){
+ public int compare(Issue o1, Issue o2) {
+ return jiraUserComparator.compare(o1.getReporter(), o2.getReporter());
+ }
+ };
+ static final Comparator<Issue> byReporterDesc = new Comparator<Issue>(){
+ public int compare(Issue o1, Issue o2) {
+ return -byReporterAsc.compare(o1, o2);
+ }
+ };
+
+ static final Comparator<Issue> byStatusAsc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return o1.getStatus().getId() - o2.getStatus().getId();
+ };
+ };
+
+ static final Comparator<Issue> byStatusDesc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return -byStatusAsc.compare(o1, o2);
+ };
+ };
+
+ static final Comparator<Issue> byKeyAsc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return o1.getKey().compareTo(o2.getKey());
+ };
+ };
+
+ static final Comparator<Issue> byKeyDesc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return -byKeyAsc.compare(o1, o2);
+ };
+ };
+
+ static final Comparator<Issue> byResolutionDesc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return -byResolutionAsc.compare(o1, o2);
+ };
+ };
+
+ static final Comparator<Issue> byResolutionAsc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return o1.getResolution().compareTo(o2.getResolution());
+ };
+ };
+
+ static final Comparator<Issue> bySummaryDesc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return -bySummaryAsc.compare(o1, o2);
+ };
+ };
+
+ static final Comparator<Issue> bySummaryAsc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return o1.getSummary().compareTo(o2.getSummary());
+ };
+ };
+
+
+ private List<Issue> issues = new ArrayList<Issue>();
+ private String title;
+ private String description;
+ private String link;
+ private String language;
+
+ private Map <Integer, Issue> index = new HashMap<Integer, Issue>();
+
+
+
+
+ public int size() {
+ return issues.size();
+ }
+
+ /**
+ * Execute query. Care for sorting
+ * @param startRow
+ * @param endRow
+ * @param sortOrder
+ * @return
+ */
+ public List <Issue> executeQuery(int startRow, int endRow, SortOrder sortOrder) {
+ log.trace("Channel.executeQuery()");
+ List <Issue> copy = getIssues();
+ if (sortOrder != null) {
+ copy = new ArrayList<Issue>(getIssues());
+ Comparator<Issue> comparator = createComparator(sortOrder);
+ if (comparator != null) {
+ Collections.sort(copy, comparator);
+ }
+ }
+ List <Issue> issuz = new ArrayList<Issue>(endRow - startRow + 1);
+ for(int i = startRow; i < endRow; i++ ) {
+ issuz.add(copy.get(i));
+ }
+ return issuz;
+ }
+
+
+ /**
+ * @return the language
+ */
+ public String getLanguage() {
+ return language;
+ }
+ /**
+ * @param language the language to set
+ */
+ public void setLanguage(String language) {
+ this.language = language;
+ }
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+ /**
+ * @param description the description to set
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+ /**
+ * @return the link
+ */
+ public String getLink() {
+ return link;
+ }
+ /**
+ * @param link the link to set
+ */
+ public void setLink(String link) {
+ this.link = link;
+ }
+ /**
+ * @return the title
+ */
+ public String getTitle() {
+ return title;
+ }
+ /**
+ * @param title the title to set
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+ /**
+ * @return the issues
+ */
+ public List<Issue> getIssues() {
+ return issues;
+ }
+ /**
+ * @param issues the issues to set
+ */
+ public void setIssues(List<Issue> issues) {
+ this.issues = issues;
+ }
+
+ public void addIssue(Issue issue) {
+ if (issues.size() > 5) {
+ return;
+ }
+ issues.add(issue);
+ index.put(issue.getIndex(), issue);
+ }
+ /**
+ * @return the index
+ */
+ public Map<Integer, Issue> getIndex() {
+ return index;
+ }
+ /**
+ * @param index the index to set
+ */
+ public void setIndex(Map<Integer, Issue> index) {
+ this.index = index;
+ }
+
+
+ protected Comparator <Issue> createComparator(SortOrder sortOrder) {
+
+ SortField [] fields = sortOrder.getFields();
+ if (fields != null && fields.length > 0) {
+ SortField field = fields[0];
+ int prop = field.getIndex();
+ boolean asc = field.getAscending().booleanValue();
+
+ switch (prop) {
+ case 0:
+ return asc ? byIdAsc : byIdDesc;
+ case 1:
+ return asc ? byKeyAsc : byKeyDesc;
+ case 2:
+ return asc ? bySummaryAsc : bySummaryDesc;
+ case 3:
+ return asc ? byAssigneeAsc : byAssigneeDesc;
+ case 4:
+ return asc ? byStatusAsc : byStatusDesc;
+ case 5:
+ return asc ? byReporterAsc : byReporterDesc;
+ case 6:
+ return asc ? byPriAsc: byPriDesc;
+ case 7:
+ return asc ? byResolutionAsc : byResolutionDesc;
+ }
+ }
+
+ return null;
+ }
+
+ public Issue findById(Integer id) {
+ return getIndex().get(id);
+ }
+
+ public Issue findIssueByKey(Object id) {
+
+ for (Issue issue : getIssues()) {
+ if (issue.getId().equals(id)) {
+ return issue;
+ }
+ }
+
+ return null;
+ }
+
+ public void replace(Integer id, List<Issue> list) {
+ Issue issue = issues.get(id.intValue());
+ issues.removeAll(list);
+ issues.addAll(issues.indexOf(issue)+1, list);
+ }
+}
Added: trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Issue.java
===================================================================
--- trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Issue.java (rev 0)
+++ trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Issue.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -0,0 +1,383 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Issue.java,v $
+ * $Revision: 1.6 $
+ */
+
+package org.richfaces.demo.datagrid.model;
+
+import java.io.Serializable;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class Issue {
+ private static int issueIndex = 0;
+
+ private int index = ++issueIndex;
+
+ private String title;
+ private String link;
+ private String description;
+ private String environment;
+ private Key key;
+ private Type type;
+ private Priority priority;
+ private JiraUser assignee;
+ private JiraUser reporter;
+ private String summary;
+ private Status status;
+ private String resolution;
+ private String created;
+ private String updated;
+ private String version;
+ private String component;
+ private String due;
+ private String votes;
+ private String customfields;
+
+ //TODO: provide correct mapping
+ private String comments;
+ private String fixVersion;
+ private String timeestimate;
+ private String timespent;
+
+ //TODO: provide correct mapping
+ private String issuelinks;
+
+ private String timeoriginalestimate;
+
+ /**
+ * @return the timeoriginalestimate
+ */
+ public String getTimeoriginalestimate() {
+ return timeoriginalestimate;
+ }
+ /**
+ * @param timeoriginalestimate the timeoriginalestimate to set
+ */
+ public void setTimeoriginalestimate(String timeoriginalestimate) {
+ this.timeoriginalestimate = timeoriginalestimate;
+ }
+ /**
+ * @return the timespent
+ */
+ public String getTimespent() {
+ return timespent;
+ }
+ /**
+ * @param timespent the timespent to set
+ */
+ public void setTimespent(String timespent) {
+ this.timespent = timespent;
+ }
+ /**
+ * @return the comments
+ */
+ public String getComments() {
+ return comments;
+ }
+ /**
+ * @param comments the comments to set
+ */
+ public void setComments(String comments) {
+ this.comments = comments;
+ }
+ /**
+ * @return the customfields
+ */
+ public String getCustomfields() {
+ return customfields;
+ }
+ /**
+ * @param customfields the customfields to set
+ */
+ public void setCustomfields(String customfields) {
+ this.customfields = customfields;
+ }
+ /**
+ * @return the votes
+ */
+ public String getVotes() {
+ return votes;
+ }
+ /**
+ * @param votes the votes to set
+ */
+ public void setVotes(String votes) {
+ this.votes = votes;
+ }
+ /**
+ * @return the due
+ */
+ public String getDue() {
+ return due;
+ }
+ /**
+ * @param due the due to set
+ */
+ public void setDue(String due) {
+ this.due = due;
+ }
+ /**
+ * @return the component
+ */
+ public String getComponent() {
+ return component;
+ }
+ /**
+ * @param component the component to set
+ */
+ public void setComponent(String component) {
+ this.component = component;
+ }
+ /**
+ * @return the version
+ */
+ public String getVersion() {
+ return version;
+ }
+ /**
+ * @param version the version to set
+ */
+ public void setVersion(String version) {
+ this.version = version;
+ }
+ /**
+ * @return the created
+ */
+ public String getCreated() {
+ return created;
+ }
+ /**
+ * @param created the created to set
+ */
+ public void setCreated(String created) {
+ this.created = created;
+ }
+ /**
+ * @return the updated
+ */
+ public String getUpdated() {
+ return updated;
+ }
+ /**
+ * @param updated the updated to set
+ */
+ public void setUpdated(String updated) {
+ this.updated = updated;
+ }
+ /**
+ * @return the resolution
+ */
+ public String getResolution() {
+ return resolution;
+ }
+ /**
+ * @param resolution the resolution to set
+ */
+ public void setResolution(String resolution) {
+ this.resolution = resolution;
+ }
+ /**
+ * @return the status
+ */
+ public Status getStatus() {
+ return status;
+ }
+ /**
+ * @param status the status to set
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+ /**
+ * @return the summary
+ */
+ public String getSummary() {
+ return summary;
+ }
+ /**
+ * @param summary the summary to set
+ */
+ public void setSummary(String summary) {
+ this.summary = summary;
+ }
+ /**
+ * @return the assignee
+ */
+ public JiraUser getAssignee() {
+ return assignee;
+ }
+ /**
+ * @param assignee the assignee to set
+ */
+ public void setAssignee(JiraUser assignee) {
+ this.assignee = assignee;
+ }
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+ /**
+ * @param description the description to set
+ */
+ public void setDescription(String description) {
+ /*if (description != null && description.length() > 2000) {
+ description = description.substring(0, 2000);
+ }*/
+ this.description = description;
+ }
+ /**
+ * @return the environment
+ */
+ public String getEnvironment() {
+ return environment;
+ }
+ /**
+ * @param environment the environment to set
+ */
+ public void setEnvironment(String environment) {
+ this.environment = environment;
+ }
+ /**
+ * @return the key
+ */
+ public Key getKey() {
+ return key;
+ }
+ /**
+ * @param key the key to set
+ */
+ public void setKey(Key key) {
+ this.key = key;
+ }
+ /**
+ * @return the link
+ */
+ public String getLink() {
+ return link;
+ }
+ /**
+ * @param link the link to set
+ */
+ public void setLink(String link) {
+ this.link = link;
+ }
+ /**
+ * @return the priority
+ */
+ public Priority getPriority() {
+ return priority;
+ }
+ /**
+ * @param priority the priority to set
+ */
+ public void setPriority(Priority priority) {
+ this.priority = priority;
+ }
+ /**
+ * @return the reporter
+ */
+ public JiraUser getReporter() {
+ return reporter;
+ }
+ /**
+ * @param reporter the reporter to set
+ */
+ public void setReporter(JiraUser reporter) {
+ this.reporter = reporter;
+ }
+ /**
+ * @return the title
+ */
+ public String getTitle() {
+ return title;
+ }
+ /**
+ * @param title the title to set
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+ /**
+ * @return the type
+ */
+ public Type getType() {
+ return type;
+ }
+ /**
+ * @param type the type to set
+ */
+ public void setType(Type type) {
+ this.type = type;
+ }
+ /**
+ * @return the fixVersion
+ */
+ public String getFixVersion() {
+ return fixVersion;
+ }
+ /**
+ * @param fixVersion the fixVersion to set
+ */
+ public void setFixVersion(String fixVersion) {
+ this.fixVersion = fixVersion;
+ }
+ /**
+ * @return the timeestimate
+ */
+ public String getTimeestimate() {
+ return timeestimate;
+ }
+ /**
+ * @param timeestimate the timeestimate to set
+ */
+ public void setTimeestimate(String timeestimate) {
+ this.timeestimate = timeestimate;
+ }
+ /**
+ * @return the issuelinks
+ */
+ public String getIssuelinks() {
+ return issuelinks;
+ }
+ /**
+ * @param issuelinks the issuelinks to set
+ */
+ public void setIssuelinks(String issuelinks) {
+ this.issuelinks = issuelinks;
+ }
+ /**
+ * @return the index
+ */
+ public int getIndex() {
+ return (index);
+ }
+ /**
+ * @param index the index to set
+ */
+ public void setIndex(int index) {
+ this.index = index;
+ }
+ /**
+ * @return
+ * @see com.exadel.jsf.demo.datagrid.model.Priority#getId()
+ */
+ public int getPriorityId() {
+ return getPriority().getId();
+ }
+
+ public Serializable getId() {
+ // TODO Auto-generated method stub
+ return getKey();
+ }
+
+}
Added: trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/JiraUser.java
===================================================================
--- trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/JiraUser.java (rev 0)
+++ trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/JiraUser.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -0,0 +1,45 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/JiraUser.java,v $
+ * $Revision: 1.1 $
+ */
+
+package org.richfaces.demo.datagrid.model;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class JiraUser {
+ private String username;
+ private String name;
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+ /**
+ * @return the username
+ */
+ public String getUsername() {
+ return username;
+ }
+ /**
+ * @param username the username to set
+ */
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+}
Added: trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Key.java
===================================================================
--- trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Key.java (rev 0)
+++ trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Key.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -0,0 +1,71 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Key.java,v $
+ * $Revision: 1.2 $
+ */
+
+package org.richfaces.demo.datagrid.model;
+
+import java.io.Serializable;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class Key implements Comparable<Key>, Serializable{
+ private int id;
+ private String value;
+ /**
+ * @return the id
+ */
+ public int getId() {
+ return id;
+ }
+ /**
+ * @param id the id to set
+ */
+ public void setId(int id) {
+ this.id = id;
+ }
+ /**
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+ /**
+ * @param value the value to set
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /**
+ * @see java.lang.Comparable#compareTo(java.lang.Object)
+ */
+ public int compareTo(Key o) {
+ return id - o.id;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof Key) {
+ return ((Key) obj).id == id;
+ }
+ return super.equals(obj);
+ }
+
+ @Override
+ public int hashCode() {
+ return id;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(id);
+ }
+}
Added: trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Priority.java
===================================================================
--- trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Priority.java (rev 0)
+++ trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Priority.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -0,0 +1,64 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Priority.java,v $
+ * $Revision: 1.2 $
+ */
+
+package org.richfaces.demo.datagrid.model;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class Priority {
+ private int id;
+ private String name;
+ /**
+ * @return the id
+ */
+ public int getId() {
+ return id;
+ }
+ /**
+ * @param id the id to set
+ */
+ public void setId(int id) {
+ this.id = id;
+ }
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof Priority) {
+ Priority priority = (Priority) obj;
+ return priority.id == id;
+ }
+ return false;
+ }
+
+ /**
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return id;
+ }
+}
Added: trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Rss.java
===================================================================
--- trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Rss.java (rev 0)
+++ trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Rss.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -0,0 +1,19 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Rss.java,v $
+ * $Revision: 1.1 $
+ */
+
+package org.richfaces.demo.datagrid.model;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class Rss {
+
+}
Added: trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Status.java
===================================================================
--- trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Status.java (rev 0)
+++ trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Status.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -0,0 +1,64 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Status.java,v $
+ * $Revision: 1.1 $
+ */
+
+package org.richfaces.demo.datagrid.model;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class Status {
+ private String name;
+ private int id;
+ /**
+ * @return the id
+ */
+ public int getId() {
+ return id;
+ }
+ /**
+ * @param id the id to set
+ */
+ public void setId(int id) {
+ this.id = id;
+ }
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof Status) {
+ Status status = (Status) obj;
+ return status.id == id;
+ }
+ return false;
+ }
+ /**
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return id;
+ }
+
+}
Added: trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Type.java
===================================================================
--- trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Type.java (rev 0)
+++ trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Type.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -0,0 +1,44 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Type.java,v $
+ * $Revision: 1.1 $
+ */
+
+package org.richfaces.demo.datagrid.model;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class Type {
+ private int id;
+ private String name;
+ /**
+ * @return the id
+ */
+ public int getId() {
+ return id;
+ }
+ /**
+ * @param id the id to set
+ */
+ public void setId(int id) {
+ this.id = id;
+ }
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Added: trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/service/JiraService.java
===================================================================
--- trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/service/JiraService.java (rev 0)
+++ trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/service/JiraService.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -0,0 +1,192 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/service/JiraService.java,v $
+ * $Revision: 1.5 $
+ */
+
+package org.richfaces.demo.datagrid.service;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
+
+import javax.el.ELContext;
+import javax.el.ELResolver;
+import javax.faces.context.FacesContext;
+
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.digester.Digester;
+import org.apache.commons.digester.ExtendedBaseRules;
+import org.apache.commons.digester.Rule;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.richfaces.demo.datagrid.model.Channel;
+import org.richfaces.demo.datagrid.model.Issue;
+import org.richfaces.demo.datagrid.model.JiraUser;
+import org.richfaces.demo.datagrid.model.Key;
+import org.richfaces.demo.datagrid.model.Priority;
+import org.richfaces.demo.datagrid.model.Status;
+import org.richfaces.demo.datagrid.model.Type;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class JiraService {
+
+ private static final String KEY = "jiraService";
+
+ private static final Log log = LogFactory.getLog(JiraService.class);
+
+ /**
+ *
+ */
+ public JiraService() {
+ super();
+ log.trace("---> JiraService.JiraService()");
+ init();
+ }
+
+ private Channel channel = null;
+ public Channel getChannel() {
+
+ if (channel == null) {
+ init();
+ }
+
+ return channel;
+ }
+ public void setChannel(Channel channel) {
+ this.channel = channel;
+ }
+
+
+ static class JiraCursedRule extends Rule {
+
+ private String propertyName;
+
+ public JiraCursedRule(String propertyName) {
+ super();
+ this.propertyName = propertyName;
+ }
+
+ @Override
+ public void body(String namespace, String name, String text) throws Exception {
+ Object bean = digester.peek();
+ PropertyUtils.setSimpleProperty(bean, propertyName, text.trim());
+
+ }
+
+ @Override
+ public void finish() throws Exception {
+ // TODO Auto-generated method stub
+ super.finish();
+ }
+ }
+
+
+ private void init() {
+ System.out.println("JiraService.init()");
+ channel = new Channel();
+ Digester digester = new Digester();
+ digester.setValidating(false);
+ digester.setNamespaceAware(false);
+ digester.setEntityResolver(new EntityResolver() {
+ public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ });
+ digester.setRules(new ExtendedBaseRules());
+
+ digester.push(channel);
+
+ String path = "rss/channel";
+ digester.addBeanPropertySetter(path + "/?");
+
+ path = path + "/item";
+ String issuePath = path;
+ digester.addObjectCreate(path, Issue.class);
+ digester.addSetProperties(path);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetNext(path, "addIssue");
+
+ path = issuePath + "/key";
+ digester.addObjectCreate(path, Key.class);
+ digester.addSetProperties(path);
+ digester.addRule(path, new JiraCursedRule("value"));
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetNext(path, "setKey");
+
+ path = issuePath + "/priority";
+ digester.addObjectCreate(path, Priority.class);
+ digester.addSetProperties(path);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addRule(path, new JiraCursedRule("name"));
+ digester.addSetNext(path, "setPriority");
+
+ path = issuePath + "/status";
+ digester.addObjectCreate(path, Status.class);
+ digester.addSetProperties(path);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addRule(path, new JiraCursedRule("name"));
+ digester.addSetNext(path, "setStatus");
+
+ path = issuePath + "/assignee";
+ digester.addObjectCreate(path, JiraUser.class);
+ digester.addSetProperties(path);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addRule(path, new JiraCursedRule("name"));
+ digester.addSetNext(path, "setAssignee");
+
+ path = issuePath + "/reporter";
+ digester.addObjectCreate(path, JiraUser.class);
+ digester.addSetProperties(path);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addRule(path, new JiraCursedRule("name"));
+ digester.addSetNext(path, "setReporter");
+
+ path = issuePath + "/type";
+ digester.addObjectCreate(path, Type.class);
+ digester.addSetProperties(path);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addRule(path, new JiraCursedRule("name"));
+ digester.addSetNext(path, "setType");
+ try {
+ //InputStream stream; //= Thread.currentThread().getContextClassLoader().getResourceAsStream();
+ //stream = FacesContext.getCurrentInstance().getExternalContext().getResourceAsStream("/WEB-INF/xmldata/jira.xml");
+ //JarInputStream stream = getXMLInputStream();
+ InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("jira-issues.jar");
+ JarInputStream jarInputStream = new JarInputStream(stream);
+ JarEntry entry = null;
+
+ while((entry = jarInputStream.getNextJarEntry()) != null) {
+ String name = entry.getName();
+ if ("jira.xml".equals(name)) {
+ digester.parse(jarInputStream);
+ break;
+ }
+ }
+ jarInputStream.close();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ public static final JiraService getInstance() {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ ELContext elContext = facesContext.getELContext();
+ ELResolver resolver = elContext.getELResolver();
+ Object value = resolver.getValue(elContext, null, KEY);
+ return (JiraService) value;
+ }
+}
Added: trunk/samples/jira-data/src/main/resources/META-INF/faces-config.xml
===================================================================
--- trunk/samples/jira-data/src/main/resources/META-INF/faces-config.xml (rev 0)
+++ trunk/samples/jira-data/src/main/resources/META-INF/faces-config.xml 2008-02-11 18:12:10 UTC (rev 6015)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>jiraService</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.datagrid.service.JiraService</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
+</faces-config>
\ No newline at end of file
Added: trunk/samples/jira-data/src/main/resources/jira-issues.jar
===================================================================
(Binary files differ)
Property changes on: trunk/samples/jira-data/src/main/resources/jira-issues.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/jira-data/src/test/java/org/richfaces/demo/datagrid/service/JiraServiceTest.java
===================================================================
--- trunk/samples/jira-data/src/test/java/org/richfaces/demo/datagrid/service/JiraServiceTest.java (rev 0)
+++ trunk/samples/jira-data/src/test/java/org/richfaces/demo/datagrid/service/JiraServiceTest.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -0,0 +1,35 @@
+package org.richfaces.demo.datagrid.service;
+
+import org.richfaces.demo.datagrid.model.Channel;
+import org.richfaces.demo.datagrid.service.JiraService;
+
+import junit.framework.TestCase;
+
+public class JiraServiceTest extends TestCase {
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testJiraService() {
+ //fail("Not yet implemented");
+ }
+
+ public void testGetChannel() {
+ Channel channel = new JiraService().getChannel();
+ assertNotNull(channel);
+ }
+
+ public void testSetChannel() {
+ //fail("Not yet implemented");
+ }
+
+ public void testGetInstance() {
+ //fail("Not yet implemented");
+ }
+
+}
Modified: trunk/samples/pom.xml
===================================================================
--- trunk/samples/pom.xml 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/samples/pom.xml 2008-02-11 18:12:10 UTC (rev 6015)
@@ -463,6 +463,7 @@
<module>combobox-sample</module>
<module>pickList-sample</module>
<module>progressBarDemo</module>
+ <module>jira-data</module>
</modules>
</project>
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml 2008-02-11 18:12:10 UTC (rev 6015)
@@ -43,14 +43,14 @@
<param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
<param-value>NEKO</param-value>
</context-param>
- <context-param>
+ <!--context-param>
<param-name>org.richfaces.LoadStyleStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>ALL</param-value>
- </context-param>
+ </context-param-->
<filter>
<display-name>Ajax4jsf Filter</display-name>
Modified: trunk/samples/scrollableDataTableDemo/pom.xml
===================================================================
--- trunk/samples/scrollableDataTableDemo/pom.xml 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/samples/scrollableDataTableDemo/pom.xml 2008-02-11 18:12:10 UTC (rev 6015)
@@ -23,6 +23,11 @@
<artifactId>skins</artifactId>
<version>3.2.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.richfaces.samples</groupId>
+ <artifactId>jira-data</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>core</artifactId>
Deleted: trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Channel.java
===================================================================
--- trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Channel.java 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Channel.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -1,309 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Channel.java,v $
- * $Revision: 1.8 $
- */
-
-package org.richfaces.demo.datagrid.model;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.richfaces.model.SortField;
-import org.richfaces.model.SortOrder;
-
-
-
-/**
- * @author Maksim Kaszynski
- * @modified by Anton Belevich
- *
- */
-public class Channel {
-
- private static final Log log = LogFactory.getLog(Channel.class);
-
- private static final Comparator<Issue> byIdDesc = new Comparator<Issue>(){
- public int compare(Issue o1, Issue o2) {
- return o2.getIndex() - o1.getIndex();
- }
- };
- private static final Comparator<Issue> byIdAsc = new Comparator<Issue>(){
- public int compare(Issue o1, Issue o2) {
- return o1.getIndex() - o2.getIndex();
- }
- };
-
- private static final Comparator<Issue> byPriAsc = new Comparator<Issue>(){
- public int compare(Issue o1, Issue o2) {
- return o1.getPriority().getId() - o2.getPriority().getId();
- }
- };
- private static final Comparator<Issue> byPriDesc = new Comparator<Issue>(){
- public int compare(Issue o1, Issue o2) {
- return o2.getPriority().getId() - o1.getPriority().getId();
- }
- };
-
- private static final Comparator<JiraUser> jiraUserComparator = new Comparator<JiraUser> () {
- public int compare(JiraUser o1, JiraUser o2) {
- return o1.getName().compareTo(o2.getName());
- }
- };
-
- private static final Comparator<Issue> byAssigneeAsc = new Comparator<Issue>(){
- public int compare(Issue o1, Issue o2) {
- return jiraUserComparator.compare(o1.getAssignee(), o2.getAssignee());
- }
- };
- private static final Comparator<Issue> byAssigneeDesc = new Comparator<Issue>(){
- public int compare(Issue o1, Issue o2) {
- return -byAssigneeAsc.compare(o1, o2);
- }
- };
-
- static final Comparator<Issue> byReporterAsc = new Comparator<Issue>(){
- public int compare(Issue o1, Issue o2) {
- return jiraUserComparator.compare(o1.getReporter(), o2.getReporter());
- }
- };
- static final Comparator<Issue> byReporterDesc = new Comparator<Issue>(){
- public int compare(Issue o1, Issue o2) {
- return -byReporterAsc.compare(o1, o2);
- }
- };
-
- static final Comparator<Issue> byStatusAsc = new Comparator<Issue>() {
- public int compare(Issue o1, Issue o2) {
- return o1.getStatus().getId() - o2.getStatus().getId();
- };
- };
-
- static final Comparator<Issue> byStatusDesc = new Comparator<Issue>() {
- public int compare(Issue o1, Issue o2) {
- return -byStatusAsc.compare(o1, o2);
- };
- };
-
- static final Comparator<Issue> byKeyAsc = new Comparator<Issue>() {
- public int compare(Issue o1, Issue o2) {
- return o1.getKey().compareTo(o2.getKey());
- };
- };
-
- static final Comparator<Issue> byKeyDesc = new Comparator<Issue>() {
- public int compare(Issue o1, Issue o2) {
- return -byKeyAsc.compare(o1, o2);
- };
- };
-
- static final Comparator<Issue> byResolutionDesc = new Comparator<Issue>() {
- public int compare(Issue o1, Issue o2) {
- return -byResolutionAsc.compare(o1, o2);
- };
- };
-
- static final Comparator<Issue> byResolutionAsc = new Comparator<Issue>() {
- public int compare(Issue o1, Issue o2) {
- return o1.getResolution().compareTo(o2.getResolution());
- };
- };
-
- static final Comparator<Issue> bySummaryDesc = new Comparator<Issue>() {
- public int compare(Issue o1, Issue o2) {
- return -bySummaryAsc.compare(o1, o2);
- };
- };
-
- static final Comparator<Issue> bySummaryAsc = new Comparator<Issue>() {
- public int compare(Issue o1, Issue o2) {
- return o1.getSummary().compareTo(o2.getSummary());
- };
- };
-
-
- private List<Issue> issues = new ArrayList<Issue>();
- private String title;
- private String description;
- private String link;
- private String language;
-
- private Map <Integer, Issue> index = new HashMap<Integer, Issue>();
-
-
-
-
- public int size() {
- return issues.size();
- }
-
- /**
- * Execute query. Care for sorting
- * @param startRow
- * @param endRow
- * @param sortOrder
- * @return
- */
- public List <Issue> executeQuery(int startRow, int endRow, SortOrder sortOrder) {
- log.trace("Channel.executeQuery()");
- List <Issue> copy = getIssues();
- if (sortOrder != null) {
- copy = new ArrayList<Issue>(getIssues());
- Comparator<Issue> comparator = createComparator(sortOrder);
- if (comparator != null) {
- Collections.sort(copy, comparator);
- }
- }
- List <Issue> issuz = new ArrayList<Issue>(endRow - startRow + 1);
- for(int i = startRow; i < endRow; i++ ) {
- issuz.add(copy.get(i));
- }
- return issuz;
- }
-
-
- /**
- * @return the language
- */
- public String getLanguage() {
- return language;
- }
- /**
- * @param language the language to set
- */
- public void setLanguage(String language) {
- this.language = language;
- }
- /**
- * @return the description
- */
- public String getDescription() {
- return description;
- }
- /**
- * @param description the description to set
- */
- public void setDescription(String description) {
- this.description = description;
- }
- /**
- * @return the link
- */
- public String getLink() {
- return link;
- }
- /**
- * @param link the link to set
- */
- public void setLink(String link) {
- this.link = link;
- }
- /**
- * @return the title
- */
- public String getTitle() {
- return title;
- }
- /**
- * @param title the title to set
- */
- public void setTitle(String title) {
- this.title = title;
- }
- /**
- * @return the issues
- */
- public List<Issue> getIssues() {
- return issues;
- }
- /**
- * @param issues the issues to set
- */
- public void setIssues(List<Issue> issues) {
- this.issues = issues;
- }
-
- public void addIssue(Issue issue) {
- if (issues.size() > 5) {
- return;
- }
- issues.add(issue);
- index.put(issue.getIndex(), issue);
- }
- /**
- * @return the index
- */
- public Map<Integer, Issue> getIndex() {
- return index;
- }
- /**
- * @param index the index to set
- */
- public void setIndex(Map<Integer, Issue> index) {
- this.index = index;
- }
-
-
- protected Comparator <Issue> createComparator(SortOrder sortOrder) {
-
- SortField [] fields = sortOrder.getFields();
- if (fields != null && fields.length > 0) {
- SortField field = fields[0];
- int prop = field.getIndex();
- boolean asc = field.getAscending().booleanValue();
-
- switch (prop) {
- case 0:
- return asc ? byIdAsc : byIdDesc;
- case 1:
- return asc ? byKeyAsc : byKeyDesc;
- case 2:
- return asc ? bySummaryAsc : bySummaryDesc;
- case 3:
- return asc ? byAssigneeAsc : byAssigneeDesc;
- case 4:
- return asc ? byStatusAsc : byStatusDesc;
- case 5:
- return asc ? byReporterAsc : byReporterDesc;
- case 6:
- return asc ? byPriAsc: byPriDesc;
- case 7:
- return asc ? byResolutionAsc : byResolutionDesc;
- }
- }
-
- return null;
- }
-
- public Issue findById(Integer id) {
- return getIndex().get(id);
- }
-
- public Issue findIssueByKey(Object id) {
-
- for (Issue issue : getIssues()) {
- if (issue.getId().equals(id)) {
- return issue;
- }
- }
-
- return null;
- }
-
- public void replace(Integer id, List<Issue> list) {
- Issue issue = issues.get(id.intValue());
- issues.removeAll(list);
- issues.addAll(issues.indexOf(issue)+1, list);
- }
-}
Deleted: trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Issue.java
===================================================================
--- trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Issue.java 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Issue.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -1,383 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Issue.java,v $
- * $Revision: 1.6 $
- */
-
-package org.richfaces.demo.datagrid.model;
-
-import java.io.Serializable;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class Issue {
- private static int issueIndex = 0;
-
- private int index = ++issueIndex;
-
- private String title;
- private String link;
- private String description;
- private String environment;
- private Key key;
- private Type type;
- private Priority priority;
- private JiraUser assignee;
- private JiraUser reporter;
- private String summary;
- private Status status;
- private String resolution;
- private String created;
- private String updated;
- private String version;
- private String component;
- private String due;
- private String votes;
- private String customfields;
-
- //TODO: provide correct mapping
- private String comments;
- private String fixVersion;
- private String timeestimate;
- private String timespent;
-
- //TODO: provide correct mapping
- private String issuelinks;
-
- private String timeoriginalestimate;
-
- /**
- * @return the timeoriginalestimate
- */
- public String getTimeoriginalestimate() {
- return timeoriginalestimate;
- }
- /**
- * @param timeoriginalestimate the timeoriginalestimate to set
- */
- public void setTimeoriginalestimate(String timeoriginalestimate) {
- this.timeoriginalestimate = timeoriginalestimate;
- }
- /**
- * @return the timespent
- */
- public String getTimespent() {
- return timespent;
- }
- /**
- * @param timespent the timespent to set
- */
- public void setTimespent(String timespent) {
- this.timespent = timespent;
- }
- /**
- * @return the comments
- */
- public String getComments() {
- return comments;
- }
- /**
- * @param comments the comments to set
- */
- public void setComments(String comments) {
- this.comments = comments;
- }
- /**
- * @return the customfields
- */
- public String getCustomfields() {
- return customfields;
- }
- /**
- * @param customfields the customfields to set
- */
- public void setCustomfields(String customfields) {
- this.customfields = customfields;
- }
- /**
- * @return the votes
- */
- public String getVotes() {
- return votes;
- }
- /**
- * @param votes the votes to set
- */
- public void setVotes(String votes) {
- this.votes = votes;
- }
- /**
- * @return the due
- */
- public String getDue() {
- return due;
- }
- /**
- * @param due the due to set
- */
- public void setDue(String due) {
- this.due = due;
- }
- /**
- * @return the component
- */
- public String getComponent() {
- return component;
- }
- /**
- * @param component the component to set
- */
- public void setComponent(String component) {
- this.component = component;
- }
- /**
- * @return the version
- */
- public String getVersion() {
- return version;
- }
- /**
- * @param version the version to set
- */
- public void setVersion(String version) {
- this.version = version;
- }
- /**
- * @return the created
- */
- public String getCreated() {
- return created;
- }
- /**
- * @param created the created to set
- */
- public void setCreated(String created) {
- this.created = created;
- }
- /**
- * @return the updated
- */
- public String getUpdated() {
- return updated;
- }
- /**
- * @param updated the updated to set
- */
- public void setUpdated(String updated) {
- this.updated = updated;
- }
- /**
- * @return the resolution
- */
- public String getResolution() {
- return resolution;
- }
- /**
- * @param resolution the resolution to set
- */
- public void setResolution(String resolution) {
- this.resolution = resolution;
- }
- /**
- * @return the status
- */
- public Status getStatus() {
- return status;
- }
- /**
- * @param status the status to set
- */
- public void setStatus(Status status) {
- this.status = status;
- }
- /**
- * @return the summary
- */
- public String getSummary() {
- return summary;
- }
- /**
- * @param summary the summary to set
- */
- public void setSummary(String summary) {
- this.summary = summary;
- }
- /**
- * @return the assignee
- */
- public JiraUser getAssignee() {
- return assignee;
- }
- /**
- * @param assignee the assignee to set
- */
- public void setAssignee(JiraUser assignee) {
- this.assignee = assignee;
- }
- /**
- * @return the description
- */
- public String getDescription() {
- return description;
- }
- /**
- * @param description the description to set
- */
- public void setDescription(String description) {
- /*if (description != null && description.length() > 2000) {
- description = description.substring(0, 2000);
- }*/
- this.description = description;
- }
- /**
- * @return the environment
- */
- public String getEnvironment() {
- return environment;
- }
- /**
- * @param environment the environment to set
- */
- public void setEnvironment(String environment) {
- this.environment = environment;
- }
- /**
- * @return the key
- */
- public Key getKey() {
- return key;
- }
- /**
- * @param key the key to set
- */
- public void setKey(Key key) {
- this.key = key;
- }
- /**
- * @return the link
- */
- public String getLink() {
- return link;
- }
- /**
- * @param link the link to set
- */
- public void setLink(String link) {
- this.link = link;
- }
- /**
- * @return the priority
- */
- public Priority getPriority() {
- return priority;
- }
- /**
- * @param priority the priority to set
- */
- public void setPriority(Priority priority) {
- this.priority = priority;
- }
- /**
- * @return the reporter
- */
- public JiraUser getReporter() {
- return reporter;
- }
- /**
- * @param reporter the reporter to set
- */
- public void setReporter(JiraUser reporter) {
- this.reporter = reporter;
- }
- /**
- * @return the title
- */
- public String getTitle() {
- return title;
- }
- /**
- * @param title the title to set
- */
- public void setTitle(String title) {
- this.title = title;
- }
- /**
- * @return the type
- */
- public Type getType() {
- return type;
- }
- /**
- * @param type the type to set
- */
- public void setType(Type type) {
- this.type = type;
- }
- /**
- * @return the fixVersion
- */
- public String getFixVersion() {
- return fixVersion;
- }
- /**
- * @param fixVersion the fixVersion to set
- */
- public void setFixVersion(String fixVersion) {
- this.fixVersion = fixVersion;
- }
- /**
- * @return the timeestimate
- */
- public String getTimeestimate() {
- return timeestimate;
- }
- /**
- * @param timeestimate the timeestimate to set
- */
- public void setTimeestimate(String timeestimate) {
- this.timeestimate = timeestimate;
- }
- /**
- * @return the issuelinks
- */
- public String getIssuelinks() {
- return issuelinks;
- }
- /**
- * @param issuelinks the issuelinks to set
- */
- public void setIssuelinks(String issuelinks) {
- this.issuelinks = issuelinks;
- }
- /**
- * @return the index
- */
- public int getIndex() {
- return (index-1001);
- }
- /**
- * @param index the index to set
- */
- public void setIndex(int index) {
- this.index = index;
- }
- /**
- * @return
- * @see com.exadel.jsf.demo.datagrid.model.Priority#getId()
- */
- public int getPriorityId() {
- return getPriority().getId();
- }
-
- public Serializable getId() {
- // TODO Auto-generated method stub
- return getKey();
- }
-
-}
Deleted: trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/JiraUser.java
===================================================================
--- trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/JiraUser.java 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/JiraUser.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -1,45 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/JiraUser.java,v $
- * $Revision: 1.1 $
- */
-
-package org.richfaces.demo.datagrid.model;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class JiraUser {
- private String username;
- private String name;
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
- /**
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
- /**
- * @return the username
- */
- public String getUsername() {
- return username;
- }
- /**
- * @param username the username to set
- */
- public void setUsername(String username) {
- this.username = username;
- }
-
-}
Deleted: trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Key.java
===================================================================
--- trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Key.java 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Key.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -1,71 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Key.java,v $
- * $Revision: 1.2 $
- */
-
-package org.richfaces.demo.datagrid.model;
-
-import java.io.Serializable;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class Key implements Comparable<Key>, Serializable{
- private int id;
- private String value;
- /**
- * @return the id
- */
- public int getId() {
- return id;
- }
- /**
- * @param id the id to set
- */
- public void setId(int id) {
- this.id = id;
- }
- /**
- * @return the value
- */
- public String getValue() {
- return value;
- }
- /**
- * @param value the value to set
- */
- public void setValue(String value) {
- this.value = value;
- }
-
- /**
- * @see java.lang.Comparable#compareTo(java.lang.Object)
- */
- public int compareTo(Key o) {
- return id - o.id;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof Key) {
- return ((Key) obj).id == id;
- }
- return super.equals(obj);
- }
-
- @Override
- public int hashCode() {
- return id;
- }
-
- @Override
- public String toString() {
- return String.valueOf(id);
- }
-}
Deleted: trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Priority.java
===================================================================
--- trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Priority.java 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Priority.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -1,64 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Priority.java,v $
- * $Revision: 1.2 $
- */
-
-package org.richfaces.demo.datagrid.model;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class Priority {
- private int id;
- private String name;
- /**
- * @return the id
- */
- public int getId() {
- return id;
- }
- /**
- * @param id the id to set
- */
- public void setId(int id) {
- this.id = id;
- }
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
- /**
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof Priority) {
- Priority priority = (Priority) obj;
- return priority.id == id;
- }
- return false;
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return id;
- }
-}
Deleted: trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Rss.java
===================================================================
--- trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Rss.java 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Rss.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -1,19 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Rss.java,v $
- * $Revision: 1.1 $
- */
-
-package org.richfaces.demo.datagrid.model;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class Rss {
-
-}
Deleted: trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Status.java
===================================================================
--- trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Status.java 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Status.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -1,64 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Status.java,v $
- * $Revision: 1.1 $
- */
-
-package org.richfaces.demo.datagrid.model;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class Status {
- private String name;
- private int id;
- /**
- * @return the id
- */
- public int getId() {
- return id;
- }
- /**
- * @param id the id to set
- */
- public void setId(int id) {
- this.id = id;
- }
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
- /**
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof Status) {
- Status status = (Status) obj;
- return status.id == id;
- }
- return false;
- }
- /**
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return id;
- }
-
-}
Deleted: trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Type.java
===================================================================
--- trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Type.java 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Type.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -1,44 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Type.java,v $
- * $Revision: 1.1 $
- */
-
-package org.richfaces.demo.datagrid.model;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class Type {
- private int id;
- private String name;
- /**
- * @return the id
- */
- public int getId() {
- return id;
- }
- /**
- * @param id the id to set
- */
- public void setId(int id) {
- this.id = id;
- }
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
- /**
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
-}
Deleted: trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/service/JiraService.java
===================================================================
--- trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/service/JiraService.java 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/service/JiraService.java 2008-02-11 18:12:10 UTC (rev 6015)
@@ -1,175 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/service/JiraService.java,v $
- * $Revision: 1.5 $
- */
-
-package org.richfaces.demo.datagrid.service;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.apache.commons.beanutils.PropertyUtils;
-import org.apache.commons.digester.Digester;
-import org.apache.commons.digester.ExtendedBaseRules;
-import org.apache.commons.digester.Rule;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.richfaces.demo.datagrid.model.Channel;
-import org.richfaces.demo.datagrid.model.Issue;
-import org.richfaces.demo.datagrid.model.JiraUser;
-import org.richfaces.demo.datagrid.model.Key;
-import org.richfaces.demo.datagrid.model.Priority;
-import org.richfaces.demo.datagrid.model.Status;
-import org.richfaces.demo.datagrid.model.Type;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class JiraService {
-
- private static final String KEY = "jiraService";
-
- private static final Log log = LogFactory.getLog(JiraService.class);
-
- private static final JiraService instance = new JiraService();
-
- /**
- *
- */
- public JiraService() {
- super();
- log.trace("---> JiraService.JiraService()");
- init();
- }
-
- private Channel channel = null;
- public Channel getChannel() {
-
- if (channel == null) {
- init();
- }
-
- return channel;
- }
- public void setChannel(Channel channel) {
- this.channel = channel;
- }
-
-
- static class JiraCursedRule extends Rule {
-
- private String propertyName;
-
- public JiraCursedRule(String propertyName) {
- super();
- this.propertyName = propertyName;
- }
-
- @Override
- public void body(String namespace, String name, String text) throws Exception {
- Object bean = digester.peek();
- PropertyUtils.setSimpleProperty(bean, propertyName, text.trim());
-
- }
-
- @Override
- public void finish() throws Exception {
- // TODO Auto-generated method stub
- super.finish();
- }
- }
-
-
- private void init() {
- System.out.println("JiraService.init()");
- channel = new Channel();
- Digester digester = new Digester();
- digester.setValidating(false);
- digester.setNamespaceAware(false);
- digester.setEntityResolver(new EntityResolver() {
- public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
- // TODO Auto-generated method stub
- return null;
- }
- });
- digester.setRules(new ExtendedBaseRules());
-
- digester.push(channel);
-
- String path = "rss/channel";
- digester.addBeanPropertySetter(path + "/?");
-
- path = path + "/item";
- String issuePath = path;
- digester.addObjectCreate(path, Issue.class);
- digester.addSetProperties(path);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetNext(path, "addIssue");
-
- path = issuePath + "/key";
- digester.addObjectCreate(path, Key.class);
- digester.addSetProperties(path);
- digester.addRule(path, new JiraCursedRule("value"));
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetNext(path, "setKey");
-
- path = issuePath + "/priority";
- digester.addObjectCreate(path, Priority.class);
- digester.addSetProperties(path);
- digester.addBeanPropertySetter(path + "/?");
- digester.addRule(path, new JiraCursedRule("name"));
- digester.addSetNext(path, "setPriority");
-
- path = issuePath + "/status";
- digester.addObjectCreate(path, Status.class);
- digester.addSetProperties(path);
- digester.addBeanPropertySetter(path + "/?");
- digester.addRule(path, new JiraCursedRule("name"));
- digester.addSetNext(path, "setStatus");
-
- path = issuePath + "/assignee";
- digester.addObjectCreate(path, JiraUser.class);
- digester.addSetProperties(path);
- digester.addBeanPropertySetter(path + "/?");
- digester.addRule(path, new JiraCursedRule("name"));
- digester.addSetNext(path, "setAssignee");
-
- path = issuePath + "/reporter";
- digester.addObjectCreate(path, JiraUser.class);
- digester.addSetProperties(path);
- digester.addBeanPropertySetter(path + "/?");
- digester.addRule(path, new JiraCursedRule("name"));
- digester.addSetNext(path, "setReporter");
-
- path = issuePath + "/type";
- digester.addObjectCreate(path, Type.class);
- digester.addSetProperties(path);
- digester.addBeanPropertySetter(path + "/?");
- digester.addRule(path, new JiraCursedRule("name"));
- digester.addSetNext(path, "setType");
- try {
- //InputStream stream; //= Thread.currentThread().getContextClassLoader().getResourceAsStream();
- //stream = FacesContext.getCurrentInstance().getExternalContext().getResourceAsStream("/WEB-INF/xmldata/jira.xml");
- //JarInputStream stream = getXMLInputStream();
- InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("jira.xml");
- digester.parse(stream);
- stream.close();
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- public static final JiraService getInstance() {
- return instance;
- }
-}
Modified: trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/faces-config.xml 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/faces-config.xml 2008-02-11 18:12:10 UTC (rev 6015)
@@ -197,11 +197,11 @@
</managed-bean>
- <managed-bean>
+ <!--managed-bean>
<managed-bean-name>jiraService</managed-bean-name>
<managed-bean-class>org.richfaces.demo.datagrid.service.JiraService</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
- </managed-bean>
+ </managed-bean-->
<managed-bean>
<managed-bean-name>dataModel2</managed-bean-name>
Deleted: trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/lib/jira-issues.jar
===================================================================
(Binary files differ)
Property changes on: trunk/sandbox/samples
___________________________________________________________________
Name: svn:ignore
- target
+ target
combobox-sample
Modified: trunk/sandbox/samples/sortingFilteringDemo/pom.xml
===================================================================
--- trunk/sandbox/samples/sortingFilteringDemo/pom.xml 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/sandbox/samples/sortingFilteringDemo/pom.xml 2008-02-11 18:12:10 UTC (rev 6015)
@@ -29,5 +29,15 @@
<artifactId>dataTable</artifactId>
<version>3.2.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.richfaces.samples</groupId>
+ <artifactId>skins</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.samples</groupId>
+ <artifactId>jira-data</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: trunk/sandbox/samples/sortingFilteringDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/sortingFilteringDemo/src/main/webapp/pages/index.jsp 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/sandbox/samples/sortingFilteringDemo/src/main/webapp/pages/index.jsp 2008-02-11 18:12:10 UTC (rev 6015)
@@ -8,14 +8,31 @@
</head>
<body>
<f:view>
- <dt:dataTable value="" >
- <dt:column sortable="true" sortExpression="">
+ <dt:dataTable value="#{jiraService.issues}" var="issue">
+ <dt:column>
<f:facet name="header">
- <h:outputText value=""></h:outputText>
+ <h:outputText value="Key"></h:outputText>
</f:facet>
+ <h:outputText value="#{issue.key}"></h:outputText>
</dt:column>
- <dt:column sortable="">
+ <dt:column>
+ <f:facet name="header">
+ <h:outputText value="Summary"></h:outputText>
+ </f:facet>
+ <h:outputText value="#{issue.summary}"></h:outputText>
</dt:column>
+ <dt:column>
+ <f:facet name="header">
+ <h:outputText value="Assignee"></h:outputText>
+ </f:facet>
+ <h:outputText value="#{issue.assignee.name}"></h:outputText>
+ </dt:column>
+ <dt:column>
+ <f:facet name="header">
+ <h:outputText value="Reporter"></h:outputText>
+ </f:facet>
+ <h:outputText value="#{issue.assignee.name}"></h:outputText>
+ </dt:column>
</dt:dataTable>
</f:view>
</body>
Modified: trunk/ui/scrollableDataTable/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/META-INF/MANIFEST.MF 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/ui/scrollableDataTable/src/main/java/META-INF/MANIFEST.MF 2008-02-11 18:12:10 UTC (rev 6015)
@@ -1,3 +1,2 @@
Manifest-Version: 1.0
-Class-Path:
18 years, 2 months
JBoss Rich Faces SVN: r6014 - in management/design: inplaceSelect and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2008-02-11 13:07:41 -0500 (Mon, 11 Feb 2008)
New Revision: 6014
Added:
management/design/inplaceSelect/design/
management/design/inplaceSelect/design/images/
management/design/inplaceSelect/design/images/bg_btn.png
management/design/inplaceSelect/design/images/bg_press.png
management/design/inplaceSelect/design/images/bg_shadow.png
management/design/inplaceSelect/design/images/ico_cancel.gif
management/design/inplaceSelect/design/images/ico_ok.gif
management/design/inplaceSelect/design/images/mark_list.gif
management/design/inplaceSelect/design/images/mark_open.gif
management/design/inplaceSelect/design/images/spacer.gif
management/design/inplaceSelect/design/inplaceSelect.html
Modified:
management/design/inplaceInput/design/inplaceInput.html
Log:
Modified: management/design/inplaceInput/design/inplaceInput.html
===================================================================
--- management/design/inplaceInput/design/inplaceInput.html 2008-02-11 17:37:55 UTC (rev 6013)
+++ management/design/inplaceInput/design/inplaceInput.html 2008-02-11 18:07:41 UTC (rev 6014)
@@ -41,7 +41,7 @@
<fieldset><legend>Default State</legend><br><br>
<div style="width : 300px;">
Fresh off his victory in the Florida primary, Sen. John McCain is poised to take another big prize. Former
- <span class="is_default_state">New York</span> Mayor Rudy Giuliani plans to drop out and endorse McCain, two GOP sources said. That would give McCain added momentum heading into a debate Wednesday and next week's Super Tuesday contests
+ <span class="is_default_state"><a href="#"><span style="width : 1px; height : 1px; position : relative"></span></a>New York</span> Mayor Rudy Giuliani plans to drop out and endorse McCain, two GOP sources said. That would give McCain added momentum heading into a debate Wednesday and next week's Super Tuesday contests
</div>
</fieldset>
@@ -89,7 +89,7 @@
<fieldset><legend>Changed State</legend><br><br>
<div style="width : 300px;">
Fresh off his victory in the Florida primary, Sen. John McCain is poised to take another big prize. Former
- <span class="is_default_state is_changed_state">New York</span> Mayor Rudy Giuliani plans to drop out and endorse McCain, two GOP sources said. That would give McCain added momentum heading into a debate Wednesday and next week's Super Tuesday contests
+ <span class="is_default_state is_changed_state"><a href="#"><span style="width : 1px; height : 1px; position : relative"></span></a>New York</span> Mayor Rudy Giuliani plans to drop out and endorse McCain, two GOP sources said. That would give McCain added momentum heading into a debate Wednesday and next week's Super Tuesday contests
</div>
</fieldset>
Added: management/design/inplaceSelect/design/images/bg_btn.png
===================================================================
(Binary files differ)
Property changes on: management/design/inplaceSelect/design/images/bg_btn.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/inplaceSelect/design/images/bg_press.png
===================================================================
(Binary files differ)
Property changes on: management/design/inplaceSelect/design/images/bg_press.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/inplaceSelect/design/images/bg_shadow.png
===================================================================
(Binary files differ)
Property changes on: management/design/inplaceSelect/design/images/bg_shadow.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/inplaceSelect/design/images/ico_cancel.gif
===================================================================
(Binary files differ)
Property changes on: management/design/inplaceSelect/design/images/ico_cancel.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/inplaceSelect/design/images/ico_ok.gif
===================================================================
(Binary files differ)
Property changes on: management/design/inplaceSelect/design/images/ico_ok.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/inplaceSelect/design/images/mark_list.gif
===================================================================
(Binary files differ)
Property changes on: management/design/inplaceSelect/design/images/mark_list.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/inplaceSelect/design/images/mark_open.gif
===================================================================
(Binary files differ)
Property changes on: management/design/inplaceSelect/design/images/mark_open.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/inplaceSelect/design/images/spacer.gif
===================================================================
(Binary files differ)
Property changes on: management/design/inplaceSelect/design/images/spacer.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/inplaceSelect/design/inplaceSelect.html
===================================================================
--- management/design/inplaceSelect/design/inplaceSelect.html (rev 0)
+++ management/design/inplaceSelect/design/inplaceSelect.html 2008-02-11 18:07:41 UTC (rev 6014)
@@ -0,0 +1,101 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+ <title>Untitled</title>
+ <style>
+*{font-family : verdana; font-size:11px;}
+body{padding : 30px;}
+fieldset{padding : 30px; border : 1px solid #c0c0c0;}
+legend{font-weight : bold}
+
+
+
+.insel_default_state{white-space : nowrap; background-color : #f1f1f1; border-bottom : 1px dashed #000000; padding-left : 3px; padding-right : 3px;}
+.insel_changed_state{background-image:url(images/mark_open.gif); background-position : top left; background-repeat : no-repeat;}
+.insel_edit_state{background-color : #FFF281;position : relative; width : 100px;background-image:url(images/mark_list.gif); background-position : right; background-repeat : no-repeat;}
+.insel_field{background : #FFF281; padding : 0px 0px 0px 3px; border : 0px; margin : 0px; width : 90px; position : absolute; top:0px; left : 0px;}
+.insel_btn{
+ background : url(images/bg_btn.png) #FFFFFF;
+ border : 1px outset #BED6F8;
+ padding : 0px;
+ margin : 0px;}
+.insel_btn_press{
+ background : url(images/bg_press.png) #FFFFFF;
+ border : 1px inset #BED6F8;
+ padding : 0px;
+ margin : 0px;}
+.insel_btn_set{ position : absolute; top:0px; left : 100px; white-space : nowrap}
+.insel_shadow{ top:-7; left:-5; position : absolute;}
+.insel_shadow_size{ width : 36px; height : 26px;}
+.insel_shadow_tl{ background : url(images/bg_shadow.png) repeat-x top left;}
+.insel_shadow_tr{ background : url(images/bg_shadow.png) repeat-x top right;}
+.insel_shadow_bl{ background : url(images/bg_shadow.png) repeat-x bottom left;}
+.insel_shadow_br{ background : url(images/bg_shadow.png) repeat-x bottom right;}
+
+ </style>
+</head>
+
+<body>
+
+<fieldset><legend>Default State</legend><br><br>
+<div style="width : 300px;">
+ Fresh off his victory in the Florida primary, Sen. John McCain is poised to take another big prize. Former
+ <span class="insel_default_state"><a href="#"><span style="width : 1px; height : 1px; position : relative"></span></a>New York</span> Mayor Rudy Giuliani plans to drop out and endorse McCain, two GOP sources said. That would give McCain added momentum heading into a debate Wednesday and next week's Super Tuesday contests
+</div>
+</fieldset>
+
+
+
+
+<fieldset><legend>Edit State</legend><br><br>
+<div style="width : 300px;">
+ Fresh off his victory in the Florida primary, Sen. John McCain is poised to take another big prize. Former
+ <span class="insel_edit_state">
+ <input type="Text" value="New York" class="insel_field">
+ <div class="insel_btn_set">
+ <div class="insel_shadow">
+ <table cellpadding="0" cellspacing="0" border="0" class="insel_shadow_size">
+ <tr>
+ <td class="insel_shadow_tl">
+ <img src="images/spacer.gif" width="10" height="1" alt="" border="0"><br>
+ </td>
+ <td class="insel_shadow_tr">
+ <img src="images/spacer.gif" width="1" height="10" alt="" border="0"><br>
+ </td>
+ </tr>
+ <tr>
+ <td class="insel_shadow_bl">
+ <img src="images/spacer.gif" width="1" height="10" alt="" border="0"><br>
+ </td>
+ <td class="insel_shadow_br">
+ <img src="images/spacer.gif" width="10" height="1" alt="" border="0"><br>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div style="position : relative">
+ <input type="image" src="images/ico_ok.gif" class="insel_btn" onmousedown="this.className='insel_btn_press'" onmouseout="this.className='insel_btn'" onmouseup="this.className='insel_btn'"><input type="image" src="images/ico_cancel.gif" class="insel_btn" onmousedown="this.className='insel_btn_press'" onmouseout="this.className='insel_btn'" onmouseup="this.className='insel_btn'">
+ </div>
+ </div>
+ <span style="width : 1px; position : relative;">
+ <img src="images/spacer.gif" width="100" height="1" alt="" border="0">
+ <div style="position : absolute; background : red; width :300px; height : 300px;left : 0px; top: 13px"></div>
+ </span>
+ </span>
+
+ Mayor Rudy Giuliani plans to drop out and endorse McCain, two GOP sources said. That would give McCain added momentum heading into a debate Wednesday and next week's Super Tuesday contests
+</div>
+</fieldset>
+
+
+<fieldset><legend>Changed State</legend><br><br>
+<div style="width : 300px;">
+ Fresh off his victory in the Florida primary, Sen. John McCain is poised to take another big prize. Former
+ <span class="insel_default_state insel_changed_state"><a href="#"><span style="width : 1px; height : 1px; position : relative"></span></a>New York</span> Mayor Rudy Giuliani plans to drop out and endorse McCain, two GOP sources said. That would give McCain added momentum heading into a debate Wednesday and next week's Super Tuesday contests
+</div>
+</fieldset>
+
+
+</body>
+</html>
18 years, 2 months
JBoss Rich Faces SVN: r6013 - in trunk/ui: dataTable/src/main/java/org/richfaces/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-02-11 12:37:55 -0500 (Mon, 11 Feb 2008)
New Revision: 6013
Modified:
trunk/ui/dataTable/src/main/config/component/column.xml
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/component/html/MockColumns.java
Log:
RF-1741
Modified: trunk/ui/dataTable/src/main/config/component/column.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/column.xml 2008-02-11 17:35:41 UTC (rev 6012)
+++ trunk/ui/dataTable/src/main/config/component/column.xml 2008-02-11 17:37:55 UTC (rev 6013)
@@ -85,6 +85,11 @@
<description>SortOrder is an enumeration of the possible sort orderings.</description>
<defaultvalue>Ordering.UNSORTED</defaultvalue>
</property>
+ <property>
+ <name>comparator</name>
+ <classname>java.util.Comparator</classname>
+ <description></description>
+ </property>
<property elonly="true">
<name>filterExpression</name>
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-02-11 17:35:41 UTC (rev 6012)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-02-11 17:37:55 UTC (rev 6013)
@@ -175,23 +175,24 @@
UIComponent component = iterator.next();
if (component instanceof org.richfaces.component.UIColumn) {
Column column = (Column) component;
+ MethodExpression filterMethod = column.getFilterMethod();
ValueExpression filterExpression = component.getValueExpression("filterExpression");
- if (filterExpression != null) {
- filterFields.add(new FilterField(filterExpression));
- }
- MethodExpression filterMethod = column.getFilterMethod();
+ ValueExpression filterBy = component.getValueExpression("filterBy");
+ String filterValue = column.getFilterValue();
if (filterMethod != null) {
filterFields.add(new FilterField(filterMethod));
- }
- ValueExpression filterBy = component.getValueExpression("filterBy");
- String filterValue = (String)component.getAttributes().get("filterValue");
- if (filterBy != null) {
+ } else if (filterExpression != null) {
+ filterFields.add(new FilterField(filterExpression));
+ } else if (filterBy != null) {
filterFields.add(new ExtendedFilterField(filterBy, filterValue));
}
- if (column.isSortable() && !Ordering.UNSORTED.equals(column.getSortOrder())) {
+ if (!Ordering.UNSORTED.equals(column.getSortOrder())) {
+ ValueExpression comparator = component.getValueExpression("comparator");
ValueExpression sortExpression = component.getValueExpression("sortExpression");
- if (sortExpression != null) {
- sortFields.add(new SortField2(factory.createValueExpression(context, sortExpression.getExpressionString(), Object.class), column.getSortOrder()));
+ if (comparator != null) {
+ sortFields.add(new SortField2(comparator, column.getSortOrder()));
+ } else if (sortExpression != null) {
+ sortFields.add(new SortField2(sortExpression, column.getSortOrder()));
}
}
}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-02-11 17:35:41 UTC (rev 6012)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-02-11 17:37:55 UTC (rev 6013)
@@ -173,7 +173,10 @@
if (facet != null) {
renderChild(context, facet);
}
- if (column.getValueExpression("filterBy") != null) {
+ if (column instanceof org.richfaces.component.UIColumn
+ && ((org.richfaces.component.UIColumn)column).getFilterMethod() == null
+ && column.getValueExpression("filterExpression") == null
+ && column.getValueExpression("filterBy") != null) {
UIComponent table = column.getParent();
String id = table.getClientId(context);
JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(table, context);
Modified: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/component/html/MockColumns.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/component/html/MockColumns.java 2008-02-11 17:35:41 UTC (rev 6012)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/component/html/MockColumns.java 2008-02-11 17:37:55 UTC (rev 6013)
@@ -95,4 +95,14 @@
this.methodExpression = methodExpression;
}
+
+ public String getFilterValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setFilterValue(String filterValue) {
+ // TODO Auto-generated method stub
+
+ }
}
18 years, 2 months
JBoss Rich Faces SVN: r6012 - in trunk/framework: impl/src/main/java/org/richfaces/model/impl/expressive and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-02-11 12:35:41 -0500 (Mon, 11 Feb 2008)
New Revision: 6012
Modified:
trunk/framework/api/src/main/java/org/richfaces/component/Column.java
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanComparator2.java
Log:
RF-1741
Modified: trunk/framework/api/src/main/java/org/richfaces/component/Column.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/Column.java 2008-02-11 17:02:53 UTC (rev 6011)
+++ trunk/framework/api/src/main/java/org/richfaces/component/Column.java 2008-02-11 17:35:41 UTC (rev 6012)
@@ -73,4 +73,8 @@
public abstract void setFilterMethod(MethodExpression methodExpression);
public abstract MethodExpression getFilterMethod();
+
+ public abstract void setFilterValue(String filterValue);
+ public abstract String getFilterValue();
+
}
Modified: trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanComparator2.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanComparator2.java 2008-02-11 17:02:53 UTC (rev 6011)
+++ trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanComparator2.java 2008-02-11 17:35:41 UTC (rev 6012)
@@ -31,7 +31,6 @@
@SuppressWarnings("unchecked")
private int compare(JavaBeanWrapper w1, JavaBeanWrapper w2) {
-
int result = 0;
for (Iterator<SortField2> iterator = sortFields.iterator(); iterator.hasNext() && result == 0;) {
@@ -42,8 +41,9 @@
if (ordering != null) {
Object p1 = w1.getProperty(prop);
Object p2 = w2.getProperty(prop);
-
- if (p1 instanceof Comparable && p2 instanceof Comparable) {
+ if (p1 == p2 && p1 instanceof Comparator) {
+ result = ((Comparator<Object>)p1).compare(w1.getWrappedObject(), w2.getWrappedObject());
+ } else if (p1 instanceof Comparable && p2 instanceof Comparable) {
result = ((Comparable<Object>) p1).compareTo(p2);
} else if (p1 == null && p2 != null) {
result = 1;
18 years, 2 months
JBoss Rich Faces SVN: r6011 - in trunk/sandbox/ui/inplaceInput/src/main: resources/org/richfaces/renderkit/html/css and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-02-11 12:02:53 -0500 (Mon, 11 Feb 2008)
New Revision: 6011
Modified:
trunk/sandbox/ui/inplaceInput/src/main/config/component/inplaceinput.xml
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
inplaceInput functionality
Modified: trunk/sandbox/ui/inplaceInput/src/main/config/component/inplaceinput.xml
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/config/component/inplaceinput.xml 2008-02-11 15:55:43 UTC (rev 6010)
+++ trunk/sandbox/ui/inplaceInput/src/main/config/component/inplaceinput.xml 2008-02-11 17:02:53 UTC (rev 6011)
@@ -67,6 +67,11 @@
<classname>java.lang.String</classname>
<defaultvalue><![CDATA["click"]]></defaultvalue>
</property>
+ <property>
+ <name>controlsPosition</name>
+ <classname>java.lang.String</classname>
+ <defaultvalue><![CDATA["right"]]></defaultvalue>
+ </property>
<property>
<name>oneditactivation</name>
Modified: trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-02-11 15:55:43 UTC (rev 6010)
+++ trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-02-11 17:02:53 UTC (rev 6011)
@@ -29,7 +29,7 @@
}
.rich-inplace-edit {
- /*position:relative;*/
+ position:relative;
width:100px;
}
@@ -43,6 +43,37 @@
padding:0px 0px 0px 3px;
width:100px;
}
+
+/* mock-up styles */
+
+*{font-family : verdana; font-size:11px;}
+body{padding : 30px;}
+fieldset{padding : 30px; border : 1px solid #c0c0c0;}
+legend{font-weight : bold}
+
+
+
+.is_default_state{white-space : nowrap; background-color : #f1f1f1; border-bottom : 1px dashed #000000; padding-left : 3px; padding-right : 3px;}
+.is_changed_state{background-image:url(images/mark_open.gif); background-position : top left; background-repeat : no-repeat;}
+.is_edit_state{position : relative; width : 100px;}
+.is_field{background : #FFF281; padding : 0px 0px 0px 3px; border : 0px; margin : 0px; width : 100px; position : absolute; top:0px; left : 0px;}
+.is_btn{
+ background : url(images/bg_btn.png) #FFFFFF;
+ border : 1px outset #BED6F8;
+ padding : 0px;
+ margin : 0px;}
+.is_btn_press{
+ background : url(images/bg_press.png) #FFFFFF;
+ border : 1px inset #BED6F8;
+ padding : 0px;
+ margin : 0px;}
+.is_btn_set{ /*position : absolute; top:0px; left : 100px;*/ white-space : nowrap}
+.is_shadow{ top:-7; left:-5; position : absolute;}
+.is_shadow_size{ width : 36px; height : 26px;}
+.is_shadow_tl{ background : url(images/bg_shadow.png) repeat-x top left;}
+.is_shadow_tr{ background : url(images/bg_shadow.png) repeat-x top right;}
+.is_shadow_bl{ background : url(images/bg_shadow.png) repeat-x bottom left;}
+.is_shadow_br{ background : url(images/bg_shadow.png) repeat-x bottom right;}
]]>
</f:verbatim>
Modified: trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-02-11 15:55:43 UTC (rev 6010)
+++ trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-02-11 17:02:53 UTC (rev 6011)
@@ -4,7 +4,7 @@
Richfaces.InplaceInput.prototype = {
- initialize: function(clientId, temValueKeepId, valueKeepId, attributes, events, classes) {
+ initialize: function(clientId, temValueKeepId, valueKeepId, attributes, events, classes, barParams) {
this.inplaceInput = $(clientId);
this.tempValueKeeper = $(temValueKeepId);
this.valueKeeper = $(valueKeepId);
@@ -17,6 +17,13 @@
this.currentState = Richfaces.InplaceInput.STATES[0];
+ this.initDimensions();
+ if (this.attributes.showControls) {
+ this.bar = new Richfaces.InplaceInputBar(barParams[0], barParams[1], barParams[2], barParams[3],
+ this.attributes.controlsPosition,
+ {width: this.INPUT_WIDTH, height: this.INPUT_HEIGHT},
+ this.inputProcessing, this.cancel);
+ }
this.initHandlers();
this.initEvents();
},
@@ -34,6 +41,18 @@
}
},
+ initDimensions : function() {
+
+ this.valueKeeper.style.visibility = "hidden";
+ this.valueKeeper.show();
+
+ this.INPUT_WIDTH = this.valueKeeper.offsetWidth;
+ this.INPUT_HEIGHT = this.valueKeeper.offsetHeight;
+
+ this.valueKeeper.hide();
+ this.valueKeeper.style.visibility = "visible";
+ },
+
/*
* HANDLERS
*/
@@ -61,20 +80,9 @@
},
tmpValueBlurHandler : function() {
- var userValue = this.tempValueKeeper.value;
- if (this.events.onviewactivation) {
- this.inplaceInput.fire("rich:onviewactivation", {});
+ if (!this.attributes.apllyFromControlsOnly) {
+ this.inputProcessing();
}
- this.endEditableState();
- this.applyUserValue();
- if (this.valueKeeper.value != userValue) {
- this.startChangedState();
- } else {
- this.startViewState();
- }
- if (this.events.onviewactivated) {
- this.inplaceInput.fire("rich:onviewactivated", {});
- }
},
/**
@@ -85,6 +93,9 @@
},
endEditableState : function() {
+ if (this.bar) {
+ this.bar.hide();
+ }
this.tempValueKeeper.hide();
},
@@ -94,6 +105,9 @@
startEditableState : function() {
this.currentState = Richfaces.InplaceInput.STATES[1];
+ if (this.bar) {
+ this.bar.show();
+ }
this.inplaceInput.className = this.classes.COMPONENT.EDITABLE;
this.tempValueKeeper.show();
this.tempValueKeeper.focus();
@@ -117,27 +131,54 @@
/**
* UTILITIES
*/
- applyUserValue : function() {
+
+ cancel : function() {
+
+ },
+
+ inputProcessing : function() {
+ var userValue = this.tempValueKeeper.value;
+ var value = this.valueKeeper.value;
+ if (this.events.onviewactivation) {
+ this.inplaceInput.fire("rich:onviewactivation", {});
+ }
+ this.endEditableState();
+ //this.applyUserValue();
+ if (userValue == "") {
+ this.setDefaultText();
+ this.valueKeeper.value = "";
+ this.startViewState();
+ } else if (userValue != value) {
+ this.currentText = userValue;
+ this.valueKeeper.value = userValue;
+ this.startChangedState();
+ } else {
+ this.startViewState();
+ }
+ if (this.events.onviewactivated) {
+ this.inplaceInput.fire("rich:onviewactivated", {});
+ }
+ },
+
+ /*applyUserValue : function() {
var newValue = this.tempValueKeeper.value;
if (newValue == "") {
- this.setDefaultText();
- this.valueKeeper.value = "";
} else if (newValue != this.valueKeeper.value) {
this.currentText = newValue;
this.valueKeeper.value = newValue;
}
- },
+ },*/
setDefaultText : function() {
this.currentText = this.attributes.defaultLabel;
},
deleteViewArtifacts : function () {
- this.inplaceInput.removeChild(this.inplaceInput.childNodes[2]);
+ this.inplaceInput.removeChild(this.inplaceInput.childNodes[3]);
},
getCurrentText : function() {
- return this.inplaceInput.childNodes[2];
+ return this.inplaceInput.childNodes[3];
},
createNewText : function(text) {
@@ -146,6 +187,71 @@
};
+Richfaces.InplaceInputBar = Class.create();
+Richfaces.InplaceInputBar.prototype = {
+ initialize : function(barId, okId, cancelId, buttonsPanelId, position, intDims, okHandler, cancelHandler) {
+ this.bar = $(barId);
+ this.ok = $(okId);
+ this.cancel = $(cancelId);
+ this.bsPanel = $(buttonsPanelId);
+
+ this.position = position;
+ this.initHandlers(okHandler, cancelHandler);
+ this.initDimensions();
+ this.positioning(intDims);
+ },
+
+ initHandlers : function(okHandler, cancelHandler) {
+ //this.ok.observe("click", function(e){okHandler}.bindAsEventListener(this));
+ //this.cancel.observe("click", function(e){cancelHandler}.bindAsEventListener(this));
+ },
+
+ initDimensions : function() {
+
+ /*this.bar.style.visibility = "hidden";
+ this.bar.show();*/
+
+ //var dim = this.bsPanel.getDimensions();
+ this.BAR_WIDTH = 28;
+ this.BAR_HEIGHT = 12;
+
+ /*this.bar.hide();
+ this.bar.style.visibility = "visible";*/
+ },
+
+ show : function() {
+ this.bar.show();
+ },
+
+ hide : function() {
+ this.bar.hide();
+ },
+
+ positioning : function(intDims) {
+ this.bar.style.position = "absolute";
+ this.bsPanel.style.position = "relative";
+ var bs = this.bar.style;
+ switch (this.position) {
+ case "top" :
+ bs.top = -this.BAR_HEIGHT + "px";
+ bs.left = "0px";
+ break;
+ case "bottom" :
+ bs.top = intDims.height + "px";
+ bs.left = "0px";
+ break;
+ case "left" :
+ bs.top = "0px";
+ bs.left = -this.BAR_WIDTH + "px";
+ break;
+ case "reight" :
+ bs.top = "0px";
+ bs.left = intDims.width + "px";
+ break;
+ }
+ }
+};
+
Richfaces.InplaceInput.STATES = [0, 1, 2];// 0 - view, 1- editable, 2 - changed
Richfaces.InplaceInput.CLASSES = {
COMPONENT : {CHANGED : "rich-inplace rich-inplace-changed",
Modified: trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-02-11 15:55:43 UTC (rev 6010)
+++ trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-02-11 17:02:53 UTC (rev 6011)
@@ -42,22 +42,50 @@
size='#{component.attributes["inputSize"]}'
maxlength='#{component.attributes["inputMaxLength"]}'
minlength='#{component.attributes["inputMinLength"]}'
+ autocomplete="off"
value='#{fieldValue}'/>
<input id='#{clientId}value' type='hidden' value='#{fieldValue}'/>
+ <div id="#{clientId}bar" class="is_btn_set" style="display:none;">
+ <div class="is_shadow">
+ <table class="is_shadow_size" cellspacing="0" cellpadding="0" border="0">
+ <tbody>
+ <tr>
+ <td class="is_shadow_tl">
+ <img width="10" height="1" border="0" alt="" src="/inplaceInput-sample/images/spacer.gif"/>
+ <br/>
+ </td>
+ <td class="is_shadow_tr">
+ </td>
+ </tr>
+ <tr>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div id="#{clientId}buttons">
+ <input id="#{clientId}ok" class="is_btn" type="image" onmouseup="this.className='is_btn'"
+ onmouseout="this.className='is_btn'" onmousedown="this.className='is_btn_press'"
+ src="/inplaceInput-sample/images/ico_ok.gif"/>
+ <input id="#{clientId}cancel" class="is_btn" type="image" onmouseup="this.className='is_btn'"
+ onmouseout="this.className='is_btn'" onmousedown="this.className='is_btn_press'"
+ src="/inplaceInput-sample/images/ico_cancel.gif"/>
+ </div>
+ </div>
#{value}
</span>
<script type="text/javascript">
var attributes = {defaultLabel : '#{component.attributes["defaultLabel"]}',
- showControls : '#{component.attributes["showControls"]}',
- apllyFromControlsOnly : '#{component.attributes["apllyFromControlsOnly"]}',
+ showControls : #{component.attributes["showControls"]},
+ apllyFromControlsOnly : #{component.attributes["apllyFromControlsOnly"]},
editEvent : '#{component.attributes["editEvent"]}',
- selectOnEdit : '#{component.attributes["selectOnEdit"]}'};
+ selectOnEdit : #{component.attributes["selectOnEdit"]},
+ controlsPosition : '#{component.attributes["controlsPosition"]}'};
var events = {oneditactivation : #{this:getAsEventHandler(context, component, "oneditactivation")},
onviewactivation : #{this:getAsEventHandler(context, component, "onviewactivation")},
oneditactivated : #{this:getAsEventHandler(context, component, "oneditactivated")},
onviewactivated : #{this:getAsEventHandler(context, component, "onviewactivated")}};
-
- var inplaceInput = new Richfaces.InplaceInput('#{clientId}', '#{clientId}tempValue', '#{clientId}value', attributes, events, Richfaces.InplaceInput.CLASSES);
+
+ var inplaceInput = new Richfaces.InplaceInput('#{clientId}', '#{clientId}tempValue', '#{clientId}value', attributes, events, Richfaces.InplaceInput.CLASSES, ['#{clientId}bar', '#{clientId}ok', '#{clientId}cancel', '#{clientId}buttons']);
</script>
</f:root>
\ No newline at end of file
18 years, 2 months
JBoss Rich Faces SVN: r6010 - in management/design: inplaceSelect and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-02-11 10:55:43 -0500 (Mon, 11 Feb 2008)
New Revision: 6010
Added:
management/design/inplaceSelect/FuncSpec - InplaceSelect.doc
Modified:
management/design/inplaceInput/FuncSpec - InplaceInput.doc
Log:
Modified: management/design/inplaceInput/FuncSpec - InplaceInput.doc
===================================================================
(Binary files differ)
Added: management/design/inplaceSelect/FuncSpec - InplaceSelect.doc
===================================================================
(Binary files differ)
Property changes on: management/design/inplaceSelect/FuncSpec - InplaceSelect.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
18 years, 2 months
JBoss Rich Faces SVN: r6009 - in trunk/test-applications/qa/Test Plan: 3.2.0 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-02-11 10:48:39 -0500 (Mon, 11 Feb 2008)
New Revision: 6009
Added:
trunk/test-applications/qa/Test Plan/3.2.0/
trunk/test-applications/qa/Test Plan/3.2.0/TestPlan-RF-3.2.0.doc
Removed:
trunk/test-applications/qa/Test Plan/TestPlan-RF.doc
Log:
Added: trunk/test-applications/qa/Test Plan/3.2.0/TestPlan-RF-3.2.0.doc
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/qa/Test Plan/3.2.0/TestPlan-RF-3.2.0.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/test-applications/qa/Test Plan/TestPlan-RF.doc
===================================================================
(Binary files differ)
18 years, 2 months
JBoss Rich Faces SVN: r6008 - management/design/inplaceInput.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-02-11 10:19:17 -0500 (Mon, 11 Feb 2008)
New Revision: 6008
Modified:
management/design/inplaceInput/FuncSpec - InplaceInput.doc
Log:
Modified: management/design/inplaceInput/FuncSpec - InplaceInput.doc
===================================================================
(Binary files differ)
18 years, 2 months
JBoss Rich Faces SVN: r6007 - in trunk/sandbox/ui/inplaceInput/src/main: java/org/richfaces/renderkit and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-02-11 09:18:39 -0500 (Mon, 11 Feb 2008)
New Revision: 6007
Modified:
trunk/sandbox/ui/inplaceInput/src/main/config/component/inplaceinput.xml
trunk/sandbox/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
inplaceInput functionality
Modified: trunk/sandbox/ui/inplaceInput/src/main/config/component/inplaceinput.xml
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/config/component/inplaceinput.xml 2008-02-11 14:05:40 UTC (rev 6006)
+++ trunk/sandbox/ui/inplaceInput/src/main/config/component/inplaceinput.xml 2008-02-11 14:18:39 UTC (rev 6007)
@@ -63,11 +63,6 @@
<defaultvalue>false</defaultvalue>
</property>
<property>
- <name>apllyFromControlsOnly</name>
- <classname>boolean</classname>
- <defaultvalue>false</defaultvalue>
- </property>
- <property>
<name>editEvent</name>
<classname>java.lang.String</classname>
<defaultvalue><![CDATA["click"]]></defaultvalue>
@@ -89,6 +84,11 @@
<name>onviewactivated</name>
<classname>java.lang.String</classname>
</property>
+ <property>
+ <name>selectOnEdit</name>
+ <classname>boolean</classname>
+ <defaultvalue>false</defaultvalue>
+ </property>
</properties>
</component>
</components>
Modified: trunk/sandbox/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2008-02-11 14:05:40 UTC (rev 6006)
+++ trunk/sandbox/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2008-02-11 14:18:39 UTC (rev 6007)
@@ -1,5 +1,13 @@
package org.richfaces.renderkit;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+import org.ajax4jsf.javascript.JSFunctionDefinition;
+import org.ajax4jsf.javascript.JSReference;
+import org.ajax4jsf.javascript.ScriptString;
+import org.ajax4jsf.javascript.ScriptUtils;
import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -19,4 +27,44 @@
protected Class<UIInplaceInput> getComponentClass() {
return UIInplaceInput.class;
}
+
+ public String getAsEventHandler(FacesContext context, UIComponent component, String attributeName) {
+ String event = (String) component.getAttributes().get(attributeName);
+ ScriptString result = JSReference.NULL;
+
+ if (event != null) {
+ event = event.trim();
+
+ if (event.length() != 0) {
+ JSFunctionDefinition function = new JSFunctionDefinition();
+ function.addParameter("event");
+ function.addToBody(event);
+
+ result = function;
+ }
+ }
+ return ScriptUtils.toScript(result);
+ }
+
+ protected String getConvertedStringValue(FacesContext context, UIInplaceInput component, Object value) {
+ Converter converter = component.getConverter();
+
+ if (converter == null) {
+ if (value == null) {
+ return "";
+ } else if (value instanceof String) {
+ return (String) value;
+ }
+
+ Class converterType = value.getClass();
+ if (converterType != null ) {
+ converter = context.getApplication().createConverter(converterType);
+ }
+
+ if (converter == null) {
+ return value.toString();
+ }
+ }
+ return converter.getAsString(context, component, value);
}
+}
Modified: trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-02-11 14:05:40 UTC (rev 6006)
+++ trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-02-11 14:18:39 UTC (rev 6007)
@@ -5,9 +5,47 @@
<f:verbatim>
<![CDATA[
+.rich-inplace {
+}
+.rich-inplace-changed {
+ background-color:#F1F1F1;
+ border-bottom:1px dashed #000000;
+ padding-left:3px;
+ padding-right:3px;
+ white-space:nowrap;
+
+ background-image:url(/inplaceInput-sample/images/mark_open.gif);
+ background-position:left top;
+ background-repeat:no-repeat;
+}
+
+.rich-inplace-view {
+ background-color:#F1F1F1;
+ border-bottom:1px dashed #000000;
+ padding-left:3px;
+ padding-right:3px;
+ white-space:nowrap;
+}
+
+.rich-inplace-edit {
+ /*position:relative;*/
+ width:100px;
+}
+
+.rich-inplace-field {
+ background:#FFF281 none repeat scroll 0%;
+ border:0px none;
+ /*left:0px;
+ top:0px;
+ position:absolute;*/
+ margin:0px;
+ padding:0px 0px 0px 3px;
+ width:100px;
+}
]]>
</f:verbatim>
+
</f:template>
Modified: trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-02-11 14:05:40 UTC (rev 6006)
+++ trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-02-11 14:18:39 UTC (rev 6007)
@@ -4,33 +4,165 @@
Richfaces.InplaceInput.prototype = {
- initialize: function(clientId, temValueKeepId, valueKeepId, attributes, events) {
+ initialize: function(clientId, temValueKeepId, valueKeepId, attributes, events, classes) {
this.inplaceInput = $(clientId);
this.tempValueKeeper = $(temValueKeepId);
this.valueKeeper = $(valueKeepId);
this.attributes = attributes;
+ this.events = events;
+ this.classes = classes;
+
+ this.currentText = this.getCurrentText();
+
this.currentState = Richfaces.InplaceInput.STATES[0];
this.initHandlers();
+ this.initEvents();
},
initHandlers : function() {
this.inplaceInput.observe(this.attributes.editEvent, function(e){this.switchingStatesHandler(e);}.bindAsEventListener(this));
+ this.tempValueKeeper.observe("blur", function(e){this.tmpValueBlurHandler(e);}.bindAsEventListener(this));
},
- switchingStatesHandler : function() {
+ initEvents : function() {
+ for (var e in this.events) {
+ if (e) {
+ this.inplaceInput.observe("rich:" + e, this.events[e]);
+ }
+ }
+ },
+
+ /*
+ * HANDLERS
+ */
+ switchingStatesHandler : function(e) {
+ var target;
+ if (e.target) {
+ target = e.target;
+ } else if (target = e.srcElement) {
+ target = e.srcElement;
+ } else {
+ //TO DO: to catch this exception
+ }
+ if (target.tagName.toLowerCase() == "input") {
+ return;
+ }
+
+ if (this.events.oneditactivation) {
+ this.inplaceInput.fire("rich:oneditactivation", {});
+ }
this.endViewState();
+ this.startEditableState();
+ if (this.events.oneditactivated) {
+ this.inplaceInput.fire("rich:oneditactivated", {});
+ }
+ },
+
+ tmpValueBlurHandler : function() {
+ var userValue = this.tempValueKeeper.value;
+ if (this.events.onviewactivation) {
+ this.inplaceInput.fire("rich:onviewactivation", {});
+ }
+ this.endEditableState();
+ this.applyUserValue();
+ if (this.valueKeeper.value != userValue) {
+ this.startChangedState();
+ } else {
+ this.startViewState();
+ }
+ if (this.events.onviewactivated) {
+ this.inplaceInput.fire("rich:onviewactivated", {});
+ }
+ },
+
+ /**
+ * STATE'S API
+ */
+ endViewState : function() {
+ this.deleteViewArtifacts();
+ },
+
+ endEditableState : function() {
+ this.tempValueKeeper.hide();
+ },
+
+ endChangedState : function() {
+ this.deleteViewArtifacts();
+ },
+
+ startEditableState : function() {
+ this.currentState = Richfaces.InplaceInput.STATES[1];
+ this.inplaceInput.className = this.classes.COMPONENT.EDITABLE;
this.tempValueKeeper.show();
-
- this.currentState = Richfaces.InplaceInput.STATES[1];
+ this.tempValueKeeper.focus();
+ if (this.attributes.selectOnEdit) {
+ Richfaces.InplaceInput.textboxSelect(this.tempValueKeeper, 0, this.tempValueKeeper.value.length);
+ }
},
- endViewState : function() {
- var viewValue = (this.inplaceInput.textContent) ? this.inplaceInput.textContent : this.inplaceInput.textNode;
- this.inplaceInput.removeNode(viewValue);
+ startViewState : function() {
+ this.currentState = Richfaces.InplaceInput.STATES[0];
+ this.createNewText(this.currentText);
+ this.inplaceInput.className = this.classes.COMPONENT.VIEW;
+ },
+
+ startChangedState : function () {
+ this.currentState = Richfaces.InplaceInput.STATES[2];
+ this.createNewText(this.valueKeeper.value);
+ this.inplaceInput.className = this.classes.COMPONENT.CHANGED;
+ },
+
+ /**
+ * UTILITIES
+ */
+ applyUserValue : function() {
+ var newValue = this.tempValueKeeper.value;
+ if (newValue == "") {
+ this.setDefaultText();
+ this.valueKeeper.value = "";
+ } else if (newValue != this.valueKeeper.value) {
+ this.currentText = newValue;
+ this.valueKeeper.value = newValue;
+ }
+ },
+
+ setDefaultText : function() {
+ this.currentText = this.attributes.defaultLabel;
+ },
+
+ deleteViewArtifacts : function () {
+ this.inplaceInput.removeChild(this.inplaceInput.childNodes[2]);
+ },
+
+ getCurrentText : function() {
+ return this.inplaceInput.childNodes[2];
+ },
+
+ createNewText : function(text) {
+ this.inplaceInput.appendChild(document.createTextNode(text));
}
};
-Richfaces.InplaceInput.STATES = [0, 1, 2];// 0 - view, 1- editable, 2 - changed
\ No newline at end of file
+Richfaces.InplaceInput.STATES = [0, 1, 2];// 0 - view, 1- editable, 2 - changed
+Richfaces.InplaceInput.CLASSES = {
+ COMPONENT : {CHANGED : "rich-inplace rich-inplace-changed",
+ VIEW : "rich-inplace rich-inplace-view",
+ EDITABLE : "rich-inplace rich-inplace-edit"}
+}
+
+Richfaces.InplaceInput.textboxSelect = function(oTextbox, iStart, iEnd) {
+ if (Prototype.Browser.IE) {
+ var oRange = oTextbox.createTextRange();
+ oRange.moveStart("character", iStart);
+ oRange.moveEnd("character", -oTextbox.value.length + iEnd);
+ oRange.select();
+ } else if (Prototype.Browser.Gecko) {
+ oTextbox.setSelectionRange(iStart, iEnd);
+ } else {
+ //FIXME
+ oTextbox.setSelectionRange(iStart, iEnd);
+ }
+}
\ No newline at end of file
Modified: trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-02-11 14:05:40 UTC (rev 6006)
+++ trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-02-11 14:18:39 UTC (rev 6007)
@@ -18,29 +18,46 @@
</h:scripts>
<f:clientid var="clientId" />
- <span id="#{clientId}" class="rich-inplace">
- #{component.attributes["value"]}
- <input id='#{clientId}tempValue"'
- class='rich-inplace-input'
+ <jsp:scriptlet>
+ <![CDATA[
+ Object value = component.getAttributes().get("value");
+ Object fieldValue = component.getAttributes().get("value");
+ value = getConvertedStringValue(context, component,value);
+ if (value == null) {
+ fieldValue = "";
+ value = component.getAttributes().get("defaultLabel");
+ }
+ if (value.equals("")) {
+ value = component.getAttributes().get("defaultLabel");
+ }
+ variables.setVariable("value", value);
+ variables.setVariable("fieldValue", fieldValue);
+ ]]>
+ </jsp:scriptlet>
+ <span id="#{clientId}" class="rich-inplace rich-inplace-view">
+ <input id='#{clientId}tempValue'
+ class='rich-inplace-field'
style='display:none;'
type='text'
size='#{component.attributes["inputSize"]}'
maxlength='#{component.attributes["inputMaxLength"]}'
minlength='#{component.attributes["inputMinLength"]}'
- value='#{component.attributes["value"]}'/>
- <input id='#{clientId}value' type='hidden' value='#{component.attributes["value"]}'/>
+ value='#{fieldValue}'/>
+ <input id='#{clientId}value' type='hidden' value='#{fieldValue}'/>
+ #{value}
</span>
<script type="text/javascript">
var attributes = {defaultLabel : '#{component.attributes["defaultLabel"]}',
showControls : '#{component.attributes["showControls"]}',
apllyFromControlsOnly : '#{component.attributes["apllyFromControlsOnly"]}',
- editEvent : '#{component.attributes["editEvent"]}'};
+ editEvent : '#{component.attributes["editEvent"]}',
+ selectOnEdit : '#{component.attributes["selectOnEdit"]}'};
- var events = {oneditactivation : '#{component.attributes["oneditactivation"]}',
- onviewactivation : '#{component.attributes["onviewactivation"]}',
- oneditactivated : '#{component.attributes["onviewactivation"]}',
- onviewactivated : '#{component.attributes["onviewactivated"]}'};
+ var events = {oneditactivation : #{this:getAsEventHandler(context, component, "oneditactivation")},
+ onviewactivation : #{this:getAsEventHandler(context, component, "onviewactivation")},
+ oneditactivated : #{this:getAsEventHandler(context, component, "oneditactivated")},
+ onviewactivated : #{this:getAsEventHandler(context, component, "onviewactivated")}};
- var inplaceInput = new Richfaces.InplaceInput('#{clientId}', '#{clientId}tempValue', '#{clientId}value', attributes, events);
+ var inplaceInput = new Richfaces.InplaceInput('#{clientId}', '#{clientId}tempValue', '#{clientId}value', attributes, events, Richfaces.InplaceInput.CLASSES);
</script>
</f:root>
\ No newline at end of file
18 years, 2 months