You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2006/08/01 19:44:01 UTC
svn commit: r427657 [27/42] - in /myfaces:
core/trunk/api/src/main/java/javax/faces/component/
core/trunk/api/src/test/java/javax/faces/
core/trunk/api/src/test/java/javax/faces/application/
core/trunk/api/src/test/java/javax/faces/component/ core/trun...
Modified: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/aliasexample/ComponentBindingHolderBase.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/aliasexample/ComponentBindingHolderBase.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/aliasexample/ComponentBindingHolderBase.java (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/aliasexample/ComponentBindingHolderBase.java Tue Aug 1 10:43:28 2006
@@ -1,62 +1,62 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.examples.aliasexample;
-
-import javax.faces.component.html.HtmlPanelGroup;
-import javax.faces.component.html.HtmlOutputText;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-/**
- * @author Martin Marinschek (latest modification by $Author: matzew $)
- * @version $Revision: 167718 $ $Date: 2005-03-24 17:47:11 +0100 (Do, 24 Mär 2005) $
- */
-public abstract class ComponentBindingHolderBase
-{
- protected HtmlPanelGroup _panelGroup;
-
- public HtmlPanelGroup getPanelGroup()
- {
- if(_panelGroup == null)
- {
- _panelGroup = (HtmlPanelGroup) createComponent(HtmlPanelGroup.COMPONENT_TYPE);
- _panelGroup.getChildren().add(createOutputText());
- }
-
- return _panelGroup;
- }
-
- public void setPanelGroup(HtmlPanelGroup panelGroup)
- {
- _panelGroup = panelGroup;
- _panelGroup.getChildren().add(createOutputText());
- }
-
- protected UIComponent createComponent(String type)
- {
- return FacesContext.getCurrentInstance().getApplication().createComponent(type);
- }
-
- private HtmlOutputText createOutputText()
- {
- HtmlOutputText text = (HtmlOutputText) createComponent(HtmlOutputText.COMPONENT_TYPE);
- text.setValue(getText());
- return text;
- }
-
- protected abstract String getText();
-
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.examples.aliasexample;
+
+import javax.faces.component.html.HtmlPanelGroup;
+import javax.faces.component.html.HtmlOutputText;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: matzew $)
+ * @version $Revision: 167718 $ $Date: 2005-03-24 17:47:11 +0100 (Do, 24 Mär 2005) $
+ */
+public abstract class ComponentBindingHolderBase
+{
+ protected HtmlPanelGroup _panelGroup;
+
+ public HtmlPanelGroup getPanelGroup()
+ {
+ if(_panelGroup == null)
+ {
+ _panelGroup = (HtmlPanelGroup) createComponent(HtmlPanelGroup.COMPONENT_TYPE);
+ _panelGroup.getChildren().add(createOutputText());
+ }
+
+ return _panelGroup;
+ }
+
+ public void setPanelGroup(HtmlPanelGroup panelGroup)
+ {
+ _panelGroup = panelGroup;
+ _panelGroup.getChildren().add(createOutputText());
+ }
+
+ protected UIComponent createComponent(String type)
+ {
+ return FacesContext.getCurrentInstance().getApplication().createComponent(type);
+ }
+
+ private HtmlOutputText createOutputText()
+ {
+ HtmlOutputText text = (HtmlOutputText) createComponent(HtmlOutputText.COMPONENT_TYPE);
+ text.setValue(getText());
+ return text;
+ }
+
+ protected abstract String getText();
+
+}
Propchange: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/aliasexample/ComponentBindingHolderBase.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/aliasexample/FirstComponentBindingHolder.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/aliasexample/FirstComponentBindingHolder.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/aliasexample/FirstComponentBindingHolder.java (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/aliasexample/FirstComponentBindingHolder.java Tue Aug 1 10:43:28 2006
@@ -1,19 +1,19 @@
-package org.apache.myfaces.examples.aliasexample;
-
-import javax.faces.component.html.HtmlPanelGroup;
-import javax.faces.component.html.HtmlOutputText;
-
-/**
- * @author Martin Marinschek (latest modification by $Author: matzew $)
- * @version $Revision: 167718 $ $Date: 2005-03-24 17:47:11 +0100 (Do, 24 Mär 2005) $
- */
-public class FirstComponentBindingHolder extends ComponentBindingHolderBase
-{
-
- protected String getText()
- {
- return "first";
- }
-
-
-}
+package org.apache.myfaces.examples.aliasexample;
+
+import javax.faces.component.html.HtmlPanelGroup;
+import javax.faces.component.html.HtmlOutputText;
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: matzew $)
+ * @version $Revision: 167718 $ $Date: 2005-03-24 17:47:11 +0100 (Do, 24 Mär 2005) $
+ */
+public class FirstComponentBindingHolder extends ComponentBindingHolderBase
+{
+
+ protected String getText()
+ {
+ return "first";
+ }
+
+
+}
Propchange: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/aliasexample/FirstComponentBindingHolder.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/aliasexample/SecondComponentBindingHolder.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/aliasexample/SecondComponentBindingHolder.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/aliasexample/SecondComponentBindingHolder.java (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/aliasexample/SecondComponentBindingHolder.java Tue Aug 1 10:43:28 2006
@@ -1,17 +1,17 @@
-package org.apache.myfaces.examples.aliasexample;
-
-import javax.faces.component.html.HtmlPanelGroup;
-import javax.faces.component.html.HtmlOutputText;
-
-/**
- * @author Martin Marinschek (latest modification by $Author: matzew $)
- * @version $Revision: 167718 $ $Date: 2005-03-24 17:47:11 +0100 (Do, 24 Mär 2005) $
- */
-public class SecondComponentBindingHolder extends ComponentBindingHolderBase
-{
-
- protected String getText()
- {
- return "second";
- }
-}
+package org.apache.myfaces.examples.aliasexample;
+
+import javax.faces.component.html.HtmlPanelGroup;
+import javax.faces.component.html.HtmlOutputText;
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: matzew $)
+ * @version $Revision: 167718 $ $Date: 2005-03-24 17:47:11 +0100 (Do, 24 Mär 2005) $
+ */
+public class SecondComponentBindingHolder extends ComponentBindingHolderBase
+{
+
+ protected String getText()
+ {
+ return "second";
+ }
+}
Propchange: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/aliasexample/SecondComponentBindingHolder.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/calendarexample/CalendarBean.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/calendarexample/CalendarBean.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/calendarexample/CalendarBean.java (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/calendarexample/CalendarBean.java Tue Aug 1 10:43:28 2006
@@ -1,103 +1,103 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.examples.calendarexample;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * @author Martin Marinschek
- * @version $Revision: $ $Date: $
- * <p/>
- * $Log: $
- */
-public class CalendarBean implements Serializable
-{
- /**
- * serial id for serialisation
- */
- private static final long serialVersionUID = 1L;
-
- private static Log log = LogFactory.getLog(CalendarBean.class);
-
- private List _dates;
-
- private String _text;
- private Date _firstDate;
- private Date _secondDate;
-
- public List getDates()
- {
- if(_dates == null)
- {
- _dates = new ArrayList();
-
- for(int i=0; i<3; i++)
- _dates.add(new DateHolder());
- }
-
- return _dates;
- }
-
- public void setDates(List dates)
- {
- _dates = dates;
- }
-
- public String getText()
- {
- return _text;
- }
-
- public void setText(String text)
- {
- _text = text;
- }
-
- public Date getFirstDate()
- {
- return _firstDate;
- }
-
- public void setFirstDate(Date firstDate)
- {
- _firstDate = firstDate;
- }
-
- public Date getSecondDate()
- {
- return _secondDate;
- }
-
- public void setSecondDate(Date secondDate)
- {
- _secondDate = secondDate;
- }
-
- public String submitMethod()
- {
- log.info("submit method called");
-
- return "submit";
- }
-
-
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.examples.calendarexample;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author Martin Marinschek
+ * @version $Revision: $ $Date: $
+ * <p/>
+ * $Log: $
+ */
+public class CalendarBean implements Serializable
+{
+ /**
+ * serial id for serialisation
+ */
+ private static final long serialVersionUID = 1L;
+
+ private static Log log = LogFactory.getLog(CalendarBean.class);
+
+ private List _dates;
+
+ private String _text;
+ private Date _firstDate;
+ private Date _secondDate;
+
+ public List getDates()
+ {
+ if(_dates == null)
+ {
+ _dates = new ArrayList();
+
+ for(int i=0; i<3; i++)
+ _dates.add(new DateHolder());
+ }
+
+ return _dates;
+ }
+
+ public void setDates(List dates)
+ {
+ _dates = dates;
+ }
+
+ public String getText()
+ {
+ return _text;
+ }
+
+ public void setText(String text)
+ {
+ _text = text;
+ }
+
+ public Date getFirstDate()
+ {
+ return _firstDate;
+ }
+
+ public void setFirstDate(Date firstDate)
+ {
+ _firstDate = firstDate;
+ }
+
+ public Date getSecondDate()
+ {
+ return _secondDate;
+ }
+
+ public void setSecondDate(Date secondDate)
+ {
+ _secondDate = secondDate;
+ }
+
+ public String submitMethod()
+ {
+ log.info("submit method called");
+
+ return "submit";
+ }
+
+
+}
Propchange: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/calendarexample/CalendarBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/collapsiblepanel/CollapsiblePanelBean.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/collapsiblepanel/CollapsiblePanelBean.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/collapsiblepanel/CollapsiblePanelBean.java (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/collapsiblepanel/CollapsiblePanelBean.java Tue Aug 1 10:43:28 2006
@@ -1,112 +1,112 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.examples.collapsiblepanel;
-
-import java.util.Date;
-import java.util.List;
-import java.util.ArrayList;
-import java.io.Serializable;
-
-/**
- * @author Martin Marinschek
- * @version $Revision: $ $Date: $
- * <p/>
- * $Log: $
- */
-public class CollapsiblePanelBean implements Serializable
-{
-
- /**
- * serial id for serialisation
- */
- private static final long serialVersionUID = 1L;
-
- private boolean _collapsed;
-
- private String _firstName="Hugo";
- private String _surName;
- private Date _birthDate;
- private List _persons;
-
- public boolean isCollapsed()
- {
- return _collapsed;
- }
-
- public void setCollapsed(boolean collapsed)
- {
- _collapsed = collapsed;
- }
-
- public String getFirstName()
- {
- return _firstName;
- }
-
- public void setFirstName(String firstName)
- {
- _firstName = firstName;
- }
-
- public String getSurName()
- {
- return _surName;
- }
-
- public void setSurName(String surName)
- {
- _surName = surName;
- }
-
- public Date getBirthDate()
- {
- return _birthDate;
- }
-
- public void setBirthDate(Date birthDate)
- {
- _birthDate = birthDate;
- }
-
- public List getPersons()
- {
- if(_persons == null)
- {
- _persons = new ArrayList();
-
- Person person = new Person();
- person.setFirstName("Hugo");
- person.setSurName("Portisch");
- _persons.add(person);
- person = new Person();
- person.setFirstName("Anja");
- person.setSurName("Kruse");
- _persons.add(person);
- person = new Person();
- person.setFirstName("Max");
- person.setSurName("Meier");
- _persons.add(person);
- }
-
- return _persons;
-
- }
-
- public void setPersons(List persons)
- {
- _persons = persons;
- }
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.examples.collapsiblepanel;
+
+import java.util.Date;
+import java.util.List;
+import java.util.ArrayList;
+import java.io.Serializable;
+
+/**
+ * @author Martin Marinschek
+ * @version $Revision: $ $Date: $
+ * <p/>
+ * $Log: $
+ */
+public class CollapsiblePanelBean implements Serializable
+{
+
+ /**
+ * serial id for serialisation
+ */
+ private static final long serialVersionUID = 1L;
+
+ private boolean _collapsed;
+
+ private String _firstName="Hugo";
+ private String _surName;
+ private Date _birthDate;
+ private List _persons;
+
+ public boolean isCollapsed()
+ {
+ return _collapsed;
+ }
+
+ public void setCollapsed(boolean collapsed)
+ {
+ _collapsed = collapsed;
+ }
+
+ public String getFirstName()
+ {
+ return _firstName;
+ }
+
+ public void setFirstName(String firstName)
+ {
+ _firstName = firstName;
+ }
+
+ public String getSurName()
+ {
+ return _surName;
+ }
+
+ public void setSurName(String surName)
+ {
+ _surName = surName;
+ }
+
+ public Date getBirthDate()
+ {
+ return _birthDate;
+ }
+
+ public void setBirthDate(Date birthDate)
+ {
+ _birthDate = birthDate;
+ }
+
+ public List getPersons()
+ {
+ if(_persons == null)
+ {
+ _persons = new ArrayList();
+
+ Person person = new Person();
+ person.setFirstName("Hugo");
+ person.setSurName("Portisch");
+ _persons.add(person);
+ person = new Person();
+ person.setFirstName("Anja");
+ person.setSurName("Kruse");
+ _persons.add(person);
+ person = new Person();
+ person.setFirstName("Max");
+ person.setSurName("Meier");
+ _persons.add(person);
+ }
+
+ return _persons;
+
+ }
+
+ public void setPersons(List persons)
+ {
+ _persons = persons;
+ }
+}
Propchange: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/collapsiblepanel/CollapsiblePanelBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/collapsiblepanel/Person.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/collapsiblepanel/Person.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/collapsiblepanel/Person.java (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/collapsiblepanel/Person.java Tue Aug 1 10:43:28 2006
@@ -1,66 +1,66 @@
-/**
- * Copyright 2004 by Irian Marinschek & Spiegl Software OEG
- */
-package org.apache.myfaces.examples.collapsiblepanel;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.io.Serializable;
-
-/**
- * @author Martin Marinschek
- * @version $Revision: $ $Date: $
- * <p/>
- * $Log: $
- */
-public class Person implements Serializable
-{
-
- /**
- * serial id for serialisation
- */
- private static final long serialVersionUID = 1L;
- private String _surName;
- private String _firstName;
- private boolean _collapsed;
- private static Log log = LogFactory.getLog(Person.class);
-
- public String getSurName()
- {
- return _surName;
- }
-
- public void setSurName(String surName)
- {
- _surName = surName;
- }
-
- public String getFirstName()
- {
- return _firstName;
- }
-
- public void setFirstName(String firstName)
- {
- _firstName = firstName;
- }
-
- public boolean isCollapsed()
- {
- return _collapsed;
- }
-
- public void setCollapsed(boolean collapsed)
- {
- _collapsed = collapsed;
- }
-
-
- public String test()
- {
- log.info("test called for " + Person.class + " with name: "+getFirstName());
- return null;
- }
-
-}
+/**
+ * Copyright 2004 by Irian Marinschek & Spiegl Software OEG
+ */
+package org.apache.myfaces.examples.collapsiblepanel;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.Serializable;
+
+/**
+ * @author Martin Marinschek
+ * @version $Revision: $ $Date: $
+ * <p/>
+ * $Log: $
+ */
+public class Person implements Serializable
+{
+
+ /**
+ * serial id for serialisation
+ */
+ private static final long serialVersionUID = 1L;
+ private String _surName;
+ private String _firstName;
+ private boolean _collapsed;
+ private static Log log = LogFactory.getLog(Person.class);
+
+ public String getSurName()
+ {
+ return _surName;
+ }
+
+ public void setSurName(String surName)
+ {
+ _surName = surName;
+ }
+
+ public String getFirstName()
+ {
+ return _firstName;
+ }
+
+ public void setFirstName(String firstName)
+ {
+ _firstName = firstName;
+ }
+
+ public boolean isCollapsed()
+ {
+ return _collapsed;
+ }
+
+ public void setCollapsed(boolean collapsed)
+ {
+ _collapsed = collapsed;
+ }
+
+
+ public String test()
+ {
+ log.info("test called for " + Person.class + " with name: "+getFirstName());
+ return null;
+ }
+
+}
Propchange: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/collapsiblepanel/Person.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/ColumnHeader.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/ColumnHeader.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/ColumnHeader.java (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/ColumnHeader.java Tue Aug 1 10:43:28 2006
@@ -1,74 +1,74 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.examples.listexample;
-
-public class ColumnHeader
-
-{
- public ColumnHeader()
- {
- }
-
- private String _label;
- private String _width;
- private boolean _editable;
-
- public ColumnHeader(String label, String width, boolean editable)
- {
- _label = label;
- _width = width;
- _editable = editable;
- }
-
- //=========================================================================
- // Getters
- //=========================================================================
-
- public String getLabel()
- {
- return _label;
- }
-
- public String getWidth()
- {
- return _width;
- }
-
- public boolean isEditable()
- {
- return _editable;
- }
-
- //=========================================================================
- // Getters
- //=========================================================================
-
- public void setLabel(String label)
- {
- _label = label;
- }
-
- public void setWidth(String width)
- {
- _width = width;
- }
-
- public void setEditable(boolean editable)
- {
- _editable = editable;
- }
-
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.examples.listexample;
+
+public class ColumnHeader
+
+{
+ public ColumnHeader()
+ {
+ }
+
+ private String _label;
+ private String _width;
+ private boolean _editable;
+
+ public ColumnHeader(String label, String width, boolean editable)
+ {
+ _label = label;
+ _width = width;
+ _editable = editable;
+ }
+
+ //=========================================================================
+ // Getters
+ //=========================================================================
+
+ public String getLabel()
+ {
+ return _label;
+ }
+
+ public String getWidth()
+ {
+ return _width;
+ }
+
+ public boolean isEditable()
+ {
+ return _editable;
+ }
+
+ //=========================================================================
+ // Getters
+ //=========================================================================
+
+ public void setLabel(String label)
+ {
+ _label = label;
+ }
+
+ public void setWidth(String width)
+ {
+ _width = width;
+ }
+
+ public void setEditable(boolean editable)
+ {
+ _editable = editable;
+ }
+
+}
Propchange: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/ColumnHeader.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/DataScrollerActionListener.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/DataScrollerActionListener.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/DataScrollerActionListener.java (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/DataScrollerActionListener.java Tue Aug 1 10:43:28 2006
@@ -1,37 +1,37 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.examples.listexample;
-
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.ActionEvent;
-import javax.faces.event.ActionListener;
-
-/**
- * @author MBroekelmann
- *
- */
-public class DataScrollerActionListener implements ActionListener
-{
-
- /**
- * @see javax.faces.event.ActionListener#processAction(javax.faces.event.ActionEvent)
- */
- public void processAction(ActionEvent actionEvent) throws AbortProcessingException
- {
- System.out.println("process dataScroller ActionEvent");
- }
-
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.examples.listexample;
+
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.ActionListener;
+
+/**
+ * @author MBroekelmann
+ *
+ */
+public class DataScrollerActionListener implements ActionListener
+{
+
+ /**
+ * @see javax.faces.event.ActionListener#processAction(javax.faces.event.ActionEvent)
+ */
+ public void processAction(ActionEvent actionEvent) throws AbortProcessingException
+ {
+ System.out.println("process dataScroller ActionEvent");
+ }
+
+}
Propchange: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/DataScrollerActionListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/OpenDataList.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/OpenDataList.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/OpenDataList.java (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/OpenDataList.java Tue Aug 1 10:43:28 2006
@@ -1,182 +1,182 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.examples.listexample;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import javax.faces.model.DataModel;
-import javax.faces.model.ListDataModel;
-
-public class OpenDataList extends SortableList
-{
- private DataModel data;
- private DataModel columnHeaders;
-
- private static final int SORT_ASCENDING = 1;
- private static final int SORT_DESCENDING = -1;
-
- public OpenDataList()
- {
- super(null);
-
- // create header info
- List headerList = new ArrayList();
- headerList.add(new ColumnHeader("Index","100",false));
- headerList.add(new ColumnHeader("Type","200",true));
- headerList.add(new ColumnHeader("Model","300",true));
- columnHeaders = new ListDataModel(headerList);
-
- // create list of lists (data)
- List rowList = new ArrayList();
- for (int i = 100; i <= 999; i++)
- {
- List colList = new ArrayList();
- colList.add(new Integer(i));
- colList.add("Car Type " + i);
- colList.add((i%2==0) ? "blue" : "green");
- rowList.add(colList);
- }
- data = new ListDataModel(rowList);
- }
-
- //==========================================================================
- // Getters
- //==========================================================================
-
- public DataModel getData()
- {
- sort(getSort(), isAscending());
- return data;
- }
-
- void setData(DataModel datamodel)
- {
- System.out.println("preserved datamodel updated");
- // just here to see if the datamodel is updated if preservedatamodel=true
- }
-
- public DataModel getColumnHeaders()
- {
- return columnHeaders;
- }
-
- //==========================================================================
- // Public Methods
- //==========================================================================
-
- public Object getColumnValue()
- {
- Object columnValue = null;
- if (data.isRowAvailable() && columnHeaders.isRowAvailable())
- {
- columnValue = ((List)data.getRowData()).get(columnHeaders.getRowIndex());
- }
- return columnValue;
- }
-
- public void setColumnValue(Object value)
- {
- if (data.isRowAvailable() && columnHeaders.isRowAvailable())
- {
- ((List)data.getRowData()).set(columnHeaders.getRowIndex(), value);
- }
- }
-
- public String getColumnWidth()
- {
- String columnWidth = null;
- if (data.isRowAvailable() && columnHeaders.isRowAvailable())
- {
- columnWidth = ((ColumnHeader)columnHeaders.getRowData()).getWidth();
- }
- return columnWidth;
- }
-
- public boolean isValueModifiable()
- {
- boolean valueModifiable = false;
- if (data.isRowAvailable() && columnHeaders.isRowAvailable())
- {
- valueModifiable = ((ColumnHeader)columnHeaders.getRowData()).isEditable();
- }
- return valueModifiable;
- }
-
- //==========================================================================
- // Protected Methods
- //==========================================================================
-
- protected boolean isDefaultAscending(String sortColumn)
- {
- return true;
- }
-
- protected void sort(final String column, final boolean ascending)
- {
- if (column != null)
- {
- int columnIndex = getColumnIndex(column);
- int direction = (ascending) ? SORT_ASCENDING : SORT_DESCENDING;
- sort(columnIndex, direction);
- }
- }
-
- protected void sort(final int columnIndex, final int direction)
- {
- Comparator comparator = new Comparator()
- {
- public int compare(Object o1, Object o2)
- {
- int result = 0;
- Object column1 = ((List)o1).get(columnIndex);
- Object column2 = ((List)o2).get(columnIndex);
- if (column1 == null && column2 != null)
- result = -1;
- else if (column1 == null && column2 == null)
- result = 0;
- else if (column1 != null && column2 == null)
- result = 1;
- else
- result = ((Comparable)column1).compareTo(column2) * direction;
- return result;
- }
- };
- Collections.sort((List)data.getWrappedData(), comparator);
- }
-
- //==========================================================================
- // Private Methods
- //==========================================================================
-
- private int getColumnIndex(final String columnName)
- {
- int columnIndex = -1;
- List headers = (List) columnHeaders.getWrappedData();
- for (int i=0;i<headers.size() && columnIndex==-1;i++)
- {
- ColumnHeader header = (ColumnHeader) headers.get(i);
- if (header.getLabel().equals(columnName))
- {
- columnIndex = i;
- }
- }
- return columnIndex;
- }
-
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.examples.listexample;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import javax.faces.model.DataModel;
+import javax.faces.model.ListDataModel;
+
+public class OpenDataList extends SortableList
+{
+ private DataModel data;
+ private DataModel columnHeaders;
+
+ private static final int SORT_ASCENDING = 1;
+ private static final int SORT_DESCENDING = -1;
+
+ public OpenDataList()
+ {
+ super(null);
+
+ // create header info
+ List headerList = new ArrayList();
+ headerList.add(new ColumnHeader("Index","100",false));
+ headerList.add(new ColumnHeader("Type","200",true));
+ headerList.add(new ColumnHeader("Model","300",true));
+ columnHeaders = new ListDataModel(headerList);
+
+ // create list of lists (data)
+ List rowList = new ArrayList();
+ for (int i = 100; i <= 999; i++)
+ {
+ List colList = new ArrayList();
+ colList.add(new Integer(i));
+ colList.add("Car Type " + i);
+ colList.add((i%2==0) ? "blue" : "green");
+ rowList.add(colList);
+ }
+ data = new ListDataModel(rowList);
+ }
+
+ //==========================================================================
+ // Getters
+ //==========================================================================
+
+ public DataModel getData()
+ {
+ sort(getSort(), isAscending());
+ return data;
+ }
+
+ void setData(DataModel datamodel)
+ {
+ System.out.println("preserved datamodel updated");
+ // just here to see if the datamodel is updated if preservedatamodel=true
+ }
+
+ public DataModel getColumnHeaders()
+ {
+ return columnHeaders;
+ }
+
+ //==========================================================================
+ // Public Methods
+ //==========================================================================
+
+ public Object getColumnValue()
+ {
+ Object columnValue = null;
+ if (data.isRowAvailable() && columnHeaders.isRowAvailable())
+ {
+ columnValue = ((List)data.getRowData()).get(columnHeaders.getRowIndex());
+ }
+ return columnValue;
+ }
+
+ public void setColumnValue(Object value)
+ {
+ if (data.isRowAvailable() && columnHeaders.isRowAvailable())
+ {
+ ((List)data.getRowData()).set(columnHeaders.getRowIndex(), value);
+ }
+ }
+
+ public String getColumnWidth()
+ {
+ String columnWidth = null;
+ if (data.isRowAvailable() && columnHeaders.isRowAvailable())
+ {
+ columnWidth = ((ColumnHeader)columnHeaders.getRowData()).getWidth();
+ }
+ return columnWidth;
+ }
+
+ public boolean isValueModifiable()
+ {
+ boolean valueModifiable = false;
+ if (data.isRowAvailable() && columnHeaders.isRowAvailable())
+ {
+ valueModifiable = ((ColumnHeader)columnHeaders.getRowData()).isEditable();
+ }
+ return valueModifiable;
+ }
+
+ //==========================================================================
+ // Protected Methods
+ //==========================================================================
+
+ protected boolean isDefaultAscending(String sortColumn)
+ {
+ return true;
+ }
+
+ protected void sort(final String column, final boolean ascending)
+ {
+ if (column != null)
+ {
+ int columnIndex = getColumnIndex(column);
+ int direction = (ascending) ? SORT_ASCENDING : SORT_DESCENDING;
+ sort(columnIndex, direction);
+ }
+ }
+
+ protected void sort(final int columnIndex, final int direction)
+ {
+ Comparator comparator = new Comparator()
+ {
+ public int compare(Object o1, Object o2)
+ {
+ int result = 0;
+ Object column1 = ((List)o1).get(columnIndex);
+ Object column2 = ((List)o2).get(columnIndex);
+ if (column1 == null && column2 != null)
+ result = -1;
+ else if (column1 == null && column2 == null)
+ result = 0;
+ else if (column1 != null && column2 == null)
+ result = 1;
+ else
+ result = ((Comparable)column1).compareTo(column2) * direction;
+ return result;
+ }
+ };
+ Collections.sort((List)data.getWrappedData(), comparator);
+ }
+
+ //==========================================================================
+ // Private Methods
+ //==========================================================================
+
+ private int getColumnIndex(final String columnName)
+ {
+ int columnIndex = -1;
+ List headers = (List) columnHeaders.getWrappedData();
+ for (int i=0;i<headers.size() && columnIndex==-1;i++)
+ {
+ ColumnHeader header = (ColumnHeader) headers.get(i);
+ if (header.getLabel().equals(columnName))
+ {
+ columnIndex = i;
+ }
+ }
+ return columnIndex;
+ }
+
+}
Propchange: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/OpenDataList.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleAutoSortableCarList.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleAutoSortableCarList.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleAutoSortableCarList.java (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleAutoSortableCarList.java Tue Aug 1 10:43:28 2006
@@ -1,68 +1,68 @@
-/*
- * SimpleSortableCarList2.java
- *
- * Created on April 19, 2006, 11:54 AM
- *
- */
-
-package org.apache.myfaces.examples.listexample;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Catalin Kormos
- */
-public class SimpleAutoSortableCarList
-{
- private List _cars;
- private String sortColumn = null;
- private boolean sortAscending = true;
-
- public SimpleAutoSortableCarList()
- {
- _cars = new ArrayList();
-
- _cars.add(new SimpleCar(1, "car B", "blue"));
- _cars.add(new SimpleCar(2, "car A", "red"));
- _cars.add(new SimpleCar(3, "car D", "yellow"));
- _cars.add(new SimpleCar(4, "car C", "green"));
- _cars.add(new SimpleCar(5, "car E", "orange"));
- _cars.add(new SimpleCar(6, "car J", "blue"));
- _cars.add(new SimpleCar(7, "car I", "gray"));
- _cars.add(new SimpleCar(8, "car M", "lightGray"));
- _cars.add(new SimpleCar(9, "car N", "magenta"));
- _cars.add(new SimpleCar(10, "car K", "unknown"));
- _cars.add(new SimpleCar(11, "car L", "dark blue"));
- }
-
- public List getCars()
- {
- return _cars;
- }
-
- public void setCars(List cars)
- {
- this._cars = cars;
- }
-
- public String getSortColumn()
- {
- return sortColumn;
- }
-
- public void setSortColumn(String sortColumn)
- {
- this.sortColumn = sortColumn;
- }
-
- public boolean isSortAscending()
- {
- return sortAscending;
- }
-
- public void setSortAscending(boolean sortAscending)
- {
- this.sortAscending = sortAscending;
- }
-}
+/*
+ * SimpleSortableCarList2.java
+ *
+ * Created on April 19, 2006, 11:54 AM
+ *
+ */
+
+package org.apache.myfaces.examples.listexample;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Catalin Kormos
+ */
+public class SimpleAutoSortableCarList
+{
+ private List _cars;
+ private String sortColumn = null;
+ private boolean sortAscending = true;
+
+ public SimpleAutoSortableCarList()
+ {
+ _cars = new ArrayList();
+
+ _cars.add(new SimpleCar(1, "car B", "blue"));
+ _cars.add(new SimpleCar(2, "car A", "red"));
+ _cars.add(new SimpleCar(3, "car D", "yellow"));
+ _cars.add(new SimpleCar(4, "car C", "green"));
+ _cars.add(new SimpleCar(5, "car E", "orange"));
+ _cars.add(new SimpleCar(6, "car J", "blue"));
+ _cars.add(new SimpleCar(7, "car I", "gray"));
+ _cars.add(new SimpleCar(8, "car M", "lightGray"));
+ _cars.add(new SimpleCar(9, "car N", "magenta"));
+ _cars.add(new SimpleCar(10, "car K", "unknown"));
+ _cars.add(new SimpleCar(11, "car L", "dark blue"));
+ }
+
+ public List getCars()
+ {
+ return _cars;
+ }
+
+ public void setCars(List cars)
+ {
+ this._cars = cars;
+ }
+
+ public String getSortColumn()
+ {
+ return sortColumn;
+ }
+
+ public void setSortColumn(String sortColumn)
+ {
+ this.sortColumn = sortColumn;
+ }
+
+ public boolean isSortAscending()
+ {
+ return sortAscending;
+ }
+
+ public void setSortAscending(boolean sortAscending)
+ {
+ this.sortAscending = sortAscending;
+ }
+}
Propchange: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleAutoSortableCarList.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleCity.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleCity.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleCity.java (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleCity.java Tue Aug 1 10:43:28 2006
@@ -1,85 +1,85 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.examples.listexample;
-
-import java.io.Serializable;
-
-/**
- * @author MBroekelmann
- *
- */
-public class SimpleCity implements Serializable
-{
- /**
- * serial id for serialisation versioning
- */
- private static final long serialVersionUID = 1L;
- private String mName;
-
- private boolean selected;
-
- public boolean isSelected() {
- return selected;
- }
-
- public void setSelected(boolean selected) {
- this.selected = selected;
- }
-
- public void unselect(){
- setSelected(false);
- }
-
-
- /**
- *
- */
- public SimpleCity(String name)
- {
- mName = name;
- }
-
- /**
- *
- */
- public SimpleCity()
- {
- }
-
- /**
- * @return Returns the name.
- */
- public String getName()
- {
- return mName;
- }
-
- /**
- * @param name The name to set.
- */
- public void setName(String name)
- {
- mName = name;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return getName();
- }
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.examples.listexample;
+
+import java.io.Serializable;
+
+/**
+ * @author MBroekelmann
+ *
+ */
+public class SimpleCity implements Serializable
+{
+ /**
+ * serial id for serialisation versioning
+ */
+ private static final long serialVersionUID = 1L;
+ private String mName;
+
+ private boolean selected;
+
+ public boolean isSelected() {
+ return selected;
+ }
+
+ public void setSelected(boolean selected) {
+ this.selected = selected;
+ }
+
+ public void unselect(){
+ setSelected(false);
+ }
+
+
+ /**
+ *
+ */
+ public SimpleCity(String name)
+ {
+ mName = name;
+ }
+
+ /**
+ *
+ */
+ public SimpleCity()
+ {
+ }
+
+ /**
+ * @return Returns the name.
+ */
+ public String getName()
+ {
+ return mName;
+ }
+
+ /**
+ * @param name The name to set.
+ */
+ public void setName(String name)
+ {
+ mName = name;
+ }
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ public String toString()
+ {
+ return getName();
+ }
+}
Propchange: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleCity.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleDemo.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleDemo.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleDemo.java (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleDemo.java Tue Aug 1 10:43:28 2006
@@ -1,72 +1,72 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.examples.listexample;
-
-import java.io.Serializable;
-
-/**
- * DOCUMENT ME!
- * @author Thomas Spiegl (latest modification by $Author: werpu $)
- * @version $Revision: 371731 $ $Date: 2006-01-24 01:18:44 +0100 (Di, 24 Jan 2006) $
- */
-public class SimpleDemo
- implements Serializable
-{
- /**
- * serial id for serialisation versioning
- */
- private static final long serialVersionUID = 1L;
- private int _id;
- private String _value1;
- private String _value2;
-
- public SimpleDemo(int id, String type, String color)
- {
- _id = id;
- _value1 = type;
- _value2 = color;
- }
-
- public int getId()
- {
- return _id;
- }
-
- public void setId(int id)
- {
- _id = id;
- }
-
- public String getValue1()
- {
- return _value1;
- }
-
- public void setValue1(String value1)
- {
- _value1 = value1;
- }
-
- public String getValue2()
- {
- return _value2;
- }
-
- public void setValue2(String value2)
- {
- _value2 = value2;
- }
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.examples.listexample;
+
+import java.io.Serializable;
+
+/**
+ * DOCUMENT ME!
+ * @author Thomas Spiegl (latest modification by $Author: werpu $)
+ * @version $Revision: 371731 $ $Date: 2006-01-24 01:18:44 +0100 (Di, 24 Jan 2006) $
+ */
+public class SimpleDemo
+ implements Serializable
+{
+ /**
+ * serial id for serialisation versioning
+ */
+ private static final long serialVersionUID = 1L;
+ private int _id;
+ private String _value1;
+ private String _value2;
+
+ public SimpleDemo(int id, String type, String color)
+ {
+ _id = id;
+ _value1 = type;
+ _value2 = color;
+ }
+
+ public int getId()
+ {
+ return _id;
+ }
+
+ public void setId(int id)
+ {
+ _id = id;
+ }
+
+ public String getValue1()
+ {
+ return _value1;
+ }
+
+ public void setValue1(String value1)
+ {
+ _value1 = value1;
+ }
+
+ public String getValue2()
+ {
+ return _value2;
+ }
+
+ public void setValue2(String value2)
+ {
+ _value2 = value2;
+ }
+}
Propchange: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleDemo.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleGroupByList.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleGroupByList.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleGroupByList.java (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleGroupByList.java Tue Aug 1 10:43:28 2006
@@ -1,50 +1,50 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.myfaces.examples.listexample;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class SimpleGroupByList
-{
- private List _demoList = new ArrayList();
-
- private Map _demoListMap = new HashMap();
-
- public SimpleGroupByList()
- {
- for (int i = 0; i < 12; i++)
- {
- Object demo = new SimpleDemo(i, (i < 3 )? "Group 1":(i < 6 ) ? "Group 2": (i < 9)?"Group 3":"Group 4", "Item "+i);
- _demoList.add(demo);
- _demoListMap.put(new Integer(i), demo);
- }
- }
-
- public List getDemoList()
- {
- return _demoList;
- }
-
- public void setDemoList(List demo)
- {
- _demoList = demo;
- }
-
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.myfaces.examples.listexample;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class SimpleGroupByList
+{
+ private List _demoList = new ArrayList();
+
+ private Map _demoListMap = new HashMap();
+
+ public SimpleGroupByList()
+ {
+ for (int i = 0; i < 12; i++)
+ {
+ Object demo = new SimpleDemo(i, (i < 3 )? "Group 1":(i < 6 ) ? "Group 2": (i < 9)?"Group 3":"Group 4", "Item "+i);
+ _demoList.add(demo);
+ _demoListMap.put(new Integer(i), demo);
+ }
+ }
+
+ public List getDemoList()
+ {
+ return _demoList;
+ }
+
+ public void setDemoList(List demo)
+ {
+ _demoList = demo;
+ }
+
+}
Propchange: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/listexample/SimpleGroupByList.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/schedule/AddEntryHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/schedule/AddEntryHandler.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/schedule/AddEntryHandler.java (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/schedule/AddEntryHandler.java Tue Aug 1 10:43:28 2006
@@ -1,132 +1,132 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.examples.schedule;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-
-import org.apache.commons.lang.RandomStringUtils;
-import org.apache.myfaces.custom.schedule.model.DefaultScheduleEntry;
-import org.apache.myfaces.custom.schedule.model.ScheduleModel;
-
-/**
- * Handler class for manually adding an entry to the example schedule model.
- *
- * @author Jurgen Lust (latest modification by $Author$)
- * @version $Revision$
- */
-public class AddEntryHandler implements Serializable
-{
- private static final long serialVersionUID = -4253400845605088699L;
-
- private Date from;
-
- private Date until;
-
- private String title;
-
- private String location;
-
- private String comments;
-
- private ScheduleModel model;
-
- public String getComments()
- {
- return comments;
- }
-
- public void setComments(String comments)
- {
- this.comments = comments;
- }
-
- public Date getFrom()
- {
- return from;
- }
-
- public void setFrom(Date from)
- {
- this.from = from;
- }
-
- public String getLocation()
- {
- return location;
- }
-
- public void setLocation(String location)
- {
- this.location = location;
- }
-
- public ScheduleModel getModel()
- {
- return model;
- }
-
- public void setModel(ScheduleModel model)
- {
- this.model = model;
- }
-
- public String getTitle()
- {
- return title;
- }
-
- public void setTitle(String title)
- {
- this.title = title;
- }
-
- public Date getUntil()
- {
- return until;
- }
-
- public void setUntil(Date until)
- {
- this.until = until;
- }
-
- public String add()
- {
- if (!from.before(until))
- {
- FacesContext.getCurrentInstance().addMessage(
- null,
- new FacesMessage(FacesMessage.SEVERITY_ERROR,
- "start time must be before end time", null));
- return "failure";
- }
- DefaultScheduleEntry entry = new DefaultScheduleEntry();
- entry.setId(RandomStringUtils.randomNumeric(32));
- entry.setStartTime(from);
- entry.setEndTime(until);
- entry.setTitle(title);
- entry.setSubtitle(location);
- entry.setDescription(comments);
- model.addEntry(entry);
- model.refresh();
- return "success";
- }
-
-}
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.examples.schedule;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+import org.apache.commons.lang.RandomStringUtils;
+import org.apache.myfaces.custom.schedule.model.DefaultScheduleEntry;
+import org.apache.myfaces.custom.schedule.model.ScheduleModel;
+
+/**
+ * Handler class for manually adding an entry to the example schedule model.
+ *
+ * @author Jurgen Lust (latest modification by $Author$)
+ * @version $Revision$
+ */
+public class AddEntryHandler implements Serializable
+{
+ private static final long serialVersionUID = -4253400845605088699L;
+
+ private Date from;
+
+ private Date until;
+
+ private String title;
+
+ private String location;
+
+ private String comments;
+
+ private ScheduleModel model;
+
+ public String getComments()
+ {
+ return comments;
+ }
+
+ public void setComments(String comments)
+ {
+ this.comments = comments;
+ }
+
+ public Date getFrom()
+ {
+ return from;
+ }
+
+ public void setFrom(Date from)
+ {
+ this.from = from;
+ }
+
+ public String getLocation()
+ {
+ return location;
+ }
+
+ public void setLocation(String location)
+ {
+ this.location = location;
+ }
+
+ public ScheduleModel getModel()
+ {
+ return model;
+ }
+
+ public void setModel(ScheduleModel model)
+ {
+ this.model = model;
+ }
+
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+ public Date getUntil()
+ {
+ return until;
+ }
+
+ public void setUntil(Date until)
+ {
+ this.until = until;
+ }
+
+ public String add()
+ {
+ if (!from.before(until))
+ {
+ FacesContext.getCurrentInstance().addMessage(
+ null,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR,
+ "start time must be before end time", null));
+ return "failure";
+ }
+ DefaultScheduleEntry entry = new DefaultScheduleEntry();
+ entry.setId(RandomStringUtils.randomNumeric(32));
+ entry.setStartTime(from);
+ entry.setEndTime(until);
+ entry.setTitle(title);
+ entry.setSubtitle(location);
+ entry.setDescription(comments);
+ model.addEntry(entry);
+ model.refresh();
+ return "success";
+ }
+
+}
Propchange: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/schedule/AddEntryHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/schedule/BindingScheduleExampleHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/schedule/BindingScheduleExampleHandler.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/schedule/BindingScheduleExampleHandler.java (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/schedule/BindingScheduleExampleHandler.java Tue Aug 1 10:43:28 2006
@@ -1,91 +1,91 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.myfaces.examples.schedule;
-
-import java.io.Serializable;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.custom.schedule.HtmlSchedule;
-import org.apache.myfaces.custom.schedule.ScheduleMouseEvent;
-
-/**
- * Handler class for demonstrating the schedule mouse events.
- *
- * @author Jurgen Lust (latest modification by $Author$)
- * @version $Revision$
- */
-public class BindingScheduleExampleHandler extends ScheduleExampleHandler
- implements Serializable
-{
- private static final long serialVersionUID = 763734566918182549L;
- private static final Log log = LogFactory
- .getLog(BindingScheduleExampleHandler.class);
- private HtmlSchedule schedule;
- private String mouseActionText;
-
- public String getMouseActionText()
- {
- return mouseActionText;
- }
-
- public HtmlSchedule getSchedule()
- {
- return schedule;
- }
-
- public void setSchedule(HtmlSchedule schedule)
- {
- this.schedule = schedule;
- }
-
- public String getLastClickedDate()
- {
- if (getSchedule() == null
- || getSchedule().getLastClickedDateAndTime() == null)
- return "no date/time clicked";
- return getSchedule().getLastClickedDateAndTime().toString();
- }
-
- public String scheduleAction()
- {
- log.debug("The schedule was clicked");
- return "success";
- }
-
- public void scheduleClicked(ScheduleMouseEvent event)
- {
- StringBuffer buffer = new StringBuffer();
- switch (event.getEventType())
- {
- case ScheduleMouseEvent.SCHEDULE_BODY_CLICKED:
- buffer.append("schedule body was clicked: ");
- buffer.append(event.getClickedTime());
- break;
- case ScheduleMouseEvent.SCHEDULE_HEADER_CLICKED:
- buffer.append("schedule header was clicked: ");
- buffer.append(event.getClickedDate());
- break;
- case ScheduleMouseEvent.SCHEDULE_ENTRY_CLICKED:
- buffer.append("schedule entry was clicked.");
- break;
- default:
- buffer.append("no schedule mouse events registered");
- }
- mouseActionText = buffer.toString();
- }
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.myfaces.examples.schedule;
+
+import java.io.Serializable;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.custom.schedule.HtmlSchedule;
+import org.apache.myfaces.custom.schedule.ScheduleMouseEvent;
+
+/**
+ * Handler class for demonstrating the schedule mouse events.
+ *
+ * @author Jurgen Lust (latest modification by $Author$)
+ * @version $Revision$
+ */
+public class BindingScheduleExampleHandler extends ScheduleExampleHandler
+ implements Serializable
+{
+ private static final long serialVersionUID = 763734566918182549L;
+ private static final Log log = LogFactory
+ .getLog(BindingScheduleExampleHandler.class);
+ private HtmlSchedule schedule;
+ private String mouseActionText;
+
+ public String getMouseActionText()
+ {
+ return mouseActionText;
+ }
+
+ public HtmlSchedule getSchedule()
+ {
+ return schedule;
+ }
+
+ public void setSchedule(HtmlSchedule schedule)
+ {
+ this.schedule = schedule;
+ }
+
+ public String getLastClickedDate()
+ {
+ if (getSchedule() == null
+ || getSchedule().getLastClickedDateAndTime() == null)
+ return "no date/time clicked";
+ return getSchedule().getLastClickedDateAndTime().toString();
+ }
+
+ public String scheduleAction()
+ {
+ log.debug("The schedule was clicked");
+ return "success";
+ }
+
+ public void scheduleClicked(ScheduleMouseEvent event)
+ {
+ StringBuffer buffer = new StringBuffer();
+ switch (event.getEventType())
+ {
+ case ScheduleMouseEvent.SCHEDULE_BODY_CLICKED:
+ buffer.append("schedule body was clicked: ");
+ buffer.append(event.getClickedTime());
+ break;
+ case ScheduleMouseEvent.SCHEDULE_HEADER_CLICKED:
+ buffer.append("schedule header was clicked: ");
+ buffer.append(event.getClickedDate());
+ break;
+ case ScheduleMouseEvent.SCHEDULE_ENTRY_CLICKED:
+ buffer.append("schedule entry was clicked.");
+ break;
+ default:
+ buffer.append("no schedule mouse events registered");
+ }
+ mouseActionText = buffer.toString();
+ }
+}
Propchange: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/schedule/BindingScheduleExampleHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/schedule/RandomColorScheduleEntryRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/schedule/RandomColorScheduleEntryRenderer.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/schedule/RandomColorScheduleEntryRenderer.java (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/schedule/RandomColorScheduleEntryRenderer.java Tue Aug 1 10:43:28 2006
@@ -1,60 +1,60 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.myfaces.examples.schedule;
-
-import java.util.HashMap;
-import java.util.Random;
-
-import javax.faces.context.FacesContext;
-
-import org.apache.myfaces.custom.schedule.HtmlSchedule;
-import org.apache.myfaces.custom.schedule.model.ScheduleEntry;
-import org.apache.myfaces.custom.schedule.renderer.DefaultScheduleEntryRenderer;
-
-/**
- * An example ScheduleEntryRenderer that assigns a random color to each
- * entry.
- *
- * @author Jurgen Lust (latest modification by $Author$)
- * @version $Revision$
- */
-public class RandomColorScheduleEntryRenderer extends
- DefaultScheduleEntryRenderer
-{
- private static final long serialVersionUID = -4594648204963119057L;
- private HashMap colors = new HashMap();
-
- public String getColor(FacesContext context, HtmlSchedule schedule,
- ScheduleEntry entry, boolean selected)
- {
- if (colors.containsKey(entry.getId()))
- return (String) colors.get(entry.getId());
- StringBuffer color = new StringBuffer();
- Random random = new Random();
- color.append("rgb(");
- color.append(random.nextInt(255));
- color.append(",");
- color.append(random.nextInt(255));
- color.append(",");
- color.append(random.nextInt(255));
- color.append(")");
- String colorString = color.toString();
- colors.put(entry.getId(), colorString);
- return colorString;
- }
-
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.myfaces.examples.schedule;
+
+import java.util.HashMap;
+import java.util.Random;
+
+import javax.faces.context.FacesContext;
+
+import org.apache.myfaces.custom.schedule.HtmlSchedule;
+import org.apache.myfaces.custom.schedule.model.ScheduleEntry;
+import org.apache.myfaces.custom.schedule.renderer.DefaultScheduleEntryRenderer;
+
+/**
+ * An example ScheduleEntryRenderer that assigns a random color to each
+ * entry.
+ *
+ * @author Jurgen Lust (latest modification by $Author$)
+ * @version $Revision$
+ */
+public class RandomColorScheduleEntryRenderer extends
+ DefaultScheduleEntryRenderer
+{
+ private static final long serialVersionUID = -4594648204963119057L;
+ private HashMap colors = new HashMap();
+
+ public String getColor(FacesContext context, HtmlSchedule schedule,
+ ScheduleEntry entry, boolean selected)
+ {
+ if (colors.containsKey(entry.getId()))
+ return (String) colors.get(entry.getId());
+ StringBuffer color = new StringBuffer();
+ Random random = new Random();
+ color.append("rgb(");
+ color.append(random.nextInt(255));
+ color.append(",");
+ color.append(random.nextInt(255));
+ color.append(",");
+ color.append(random.nextInt(255));
+ color.append(")");
+ String colorString = color.toString();
+ colors.put(entry.getId(), colorString);
+ return colorString;
+ }
+
+}
Propchange: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/schedule/RandomColorScheduleEntryRenderer.java
------------------------------------------------------------------------------
svn:eol-style = native