Author: nbelaevski
Date: 2007-05-02 22:34:26 -0400 (Wed, 02 May 2007)
New Revision: 619
Removed:
trunk/richfaces/tabPanel/src/main/java/org/richfaces/model/Tab.java
trunk/richfaces/tabPanel/src/test/java/org/richfaces/model/TabTest.java
Modified:
trunk/richfaces/drag-drop/src/main/java/org/richfaces/component/UIDragIndicator.java
trunk/richfaces/tabPanel/src/main/java/org/richfaces/component/UITabPanel.java
trunk/richfaces/tabPanel/src/main/java/org/richfaces/renderkit/TabHeaderRendererBase.java
Log:
Orphan functions killed, imports optimized
Modified:
trunk/richfaces/drag-drop/src/main/java/org/richfaces/component/UIDragIndicator.java
===================================================================
---
trunk/richfaces/drag-drop/src/main/java/org/richfaces/component/UIDragIndicator.java 2007-05-03
01:43:26 UTC (rev 618)
+++
trunk/richfaces/drag-drop/src/main/java/org/richfaces/component/UIDragIndicator.java 2007-05-03
02:34:26 UTC (rev 619)
@@ -68,23 +68,4 @@
public static final String DEFAULT_INDICATOR_ID = "_dragIndicator";
- public static UIDragIndicator getDefaultIndicator() {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- Application application = facesContext.getApplication();
-
- UIDragIndicator indicator = (UIDragIndicator)
application.createComponent(UIDragIndicator.COMPONENT_TYPE);
- indicator.setId(DEFAULT_INDICATOR_ID);
- indicator.setTransient(true);
- Map facets = indicator.getFacets();
-
- UIOutput single = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
- single.setValue("Single item");
- facets.put("single", single);
-
- UIOutput multi = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
- multi.setValue("{count} items");
- facets.put("multi", multi);
-
- return indicator;
- }
}
Modified: trunk/richfaces/tabPanel/src/main/java/org/richfaces/component/UITabPanel.java
===================================================================
---
trunk/richfaces/tabPanel/src/main/java/org/richfaces/component/UITabPanel.java 2007-05-03
01:43:26 UTC (rev 618)
+++
trunk/richfaces/tabPanel/src/main/java/org/richfaces/component/UITabPanel.java 2007-05-03
02:34:26 UTC (rev 619)
@@ -21,10 +21,9 @@
package org.richfaces.component;
-import org.richfaces.model.Tab;
+import java.util.Iterator;
import javax.faces.component.UIComponent;
-import java.util.Iterator;
/**
* JSF component class
Deleted: trunk/richfaces/tabPanel/src/main/java/org/richfaces/model/Tab.java
===================================================================
--- trunk/richfaces/tabPanel/src/main/java/org/richfaces/model/Tab.java 2007-05-03
01:43:26 UTC (rev 618)
+++ trunk/richfaces/tabPanel/src/main/java/org/richfaces/model/Tab.java 2007-05-03
02:34:26 UTC (rev 619)
@@ -1,152 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.model;
-
-/**
- * Tab model bean represent a single tab in list of tabs for panel.
- *
- * @author shura (latest modification by $Author: ishabalov $)
- * @version $Revision: 1.3 $ $Date: 2007/02/21 20:35:05 $
- */
-public class Tab implements TabModel {
-
- private Object _name;
- private String _label;
- private boolean _disabled;
- private String _labelWidth;
- private String _switchType;
- private String _title;
-
- /**
- * No-argument constructor for JavaBean contract.
- */
- public Tab() {
- super();
- }
-
- public Tab(Object value) {
- this(value, value.toString(), false, null, null);
- }
-
- /**
- * @param value
- * @param label
- * @param disabled
- * @param labelWidth
- * @param title
- */
- public Tab(Object value, String label, boolean disabled, String labelWidth, String
title) {
- super();
- this._name = value;
- this._label = label;
- this._disabled = disabled;
- this._labelWidth = labelWidth;
- this._title = title;
- }
-
- /**
- * @return Returns the disabled.
- */
- public boolean isDisabled() {
- return this._disabled;
- }
-
- /**
- * @param disabled The disabled to set.
- */
- public void setDisabled(boolean disabled) {
- this._disabled = disabled;
- }
-
- /**
- * @return Returns the label.
- */
- public String getLabel() {
- return this._label;
- }
-
- /**
- * @param label The label to set.
- */
- public void setLabel(String label) {
- this._label = label;
- }
-
- /**
- * @return Returns the labelWidth.
- */
- public String getLabelWidth() {
- return this._labelWidth;
- }
-
- /**
- * @param labelWidth The labelWidth to set.
- */
- public void setLabelWidth(String labelWidth) {
- this._labelWidth = labelWidth;
- }
-
- /**
- * @return Returns the value.
- */
- public Object getName() {
- return this._name;
- }
-
- /**
- * @param value The value to set.
- */
- public void setName(Object value) {
- if (value == null) {
- throw new NullPointerException("value for tab set to null");
- }
- this._name = value;
- }
-
- /**
- * @return Returns the switchType.
- */
- public String getSwitchType() {
- return _switchType;
- }
-
- /**
- * @param switchType The switchType to set.
- */
- public void setSwitchType(String switchType) {
- _switchType = switchType;
- }
-
- /**
- * @return Returns the title.
- */
- public String getTitle() {
- return _title;
- }
-
- /**
- * @param newvalue The title to set.
- */
- public void setTitle(String newvalue) {
- this._title = newvalue;
- }
-}
Modified:
trunk/richfaces/tabPanel/src/main/java/org/richfaces/renderkit/TabHeaderRendererBase.java
===================================================================
---
trunk/richfaces/tabPanel/src/main/java/org/richfaces/renderkit/TabHeaderRendererBase.java 2007-05-03
01:43:26 UTC (rev 618)
+++
trunk/richfaces/tabPanel/src/main/java/org/richfaces/renderkit/TabHeaderRendererBase.java 2007-05-03
02:34:26 UTC (rev 619)
@@ -129,22 +129,6 @@
writer.writeAttribute(HTML.class_ATTRIBUTE, labelClass, null);
}
- /**
- * Hook method for create AJAX command script, in non-ajax state -simple write script
attributes
- *
- * @param writer
- * @param context
- * @param component
- * @throws IOException
- */
- protected void writeTabElementScript(ResponseWriter writer, FacesContext context,
UIComponent component) throws IOException {
- getUtils().encodeAttribute(context, component, HTML.onclick_ATTRIBUTE);
- getUtils().encodeAttribute(context, component, HTML.ondblclick_ATTRIBUTE);
- getUtils().encodeAttribute(context, component, HTML.onkeydown_ATTRIBUTE);
- getUtils().encodeAttribute(context, component, HTML.onkeyup_ATTRIBUTE);
- getUtils().encodeAttribute(context, component, HTML.onkeypress_ATTRIBUTE);
- }
-
public void writeLabel(FacesContext context, UITab tab) throws IOException {
ResponseWriter writer = context.getResponseWriter();
Deleted: trunk/richfaces/tabPanel/src/test/java/org/richfaces/model/TabTest.java
===================================================================
--- trunk/richfaces/tabPanel/src/test/java/org/richfaces/model/TabTest.java 2007-05-03
01:43:26 UTC (rev 618)
+++ trunk/richfaces/tabPanel/src/test/java/org/richfaces/model/TabTest.java 2007-05-03
02:34:26 UTC (rev 619)
@@ -1,115 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.model;
-
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-
-/**
- * Unit test for Tab.
- */
-public class TabTest extends AbstractAjax4JsfTestCase {
-
- private Tab tab;
-
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public TabTest(String testName) {
- super(testName);
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
- */
- public void setUp() throws Exception {
- super.setUp();
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#tearDown()
- */
- public void tearDown() throws Exception {
- super.tearDown();
- tab = null;
- }
-
- public void testTab1() throws Exception {
- tab = new Tab();
-
- assertNull(tab.getName());
- try {
- tab.setName(null);
- assertTrue(false);
- } catch(Exception ex) {
- }
- tab.setName("name");
- assertEquals("name", tab.getName());
-
- tab.setLabel("label");
- assertEquals("label", tab.getLabel());
-
- tab.setDisabled(true);
- assertTrue(tab.isDisabled());
-
- tab.setLabelWidth("labelWidth");
- assertEquals("labelWidth", tab.getLabelWidth());
-
- tab.setSwitchType("switchType");
- assertEquals("switchType", tab.getSwitchType());
-
- tab.setTitle("title");
- assertEquals("title", tab.getTitle());
- }
-
- public void testTab2() throws Exception {
- tab = new Tab("name");
- assertEquals("name", tab.getName());
- assertEquals("name", tab.getLabel());
- assertFalse(tab.isDisabled());
- assertNull(tab.getLabelWidth());
- assertNull(tab.getSwitchType());
- assertNull(tab.getTitle());
-
- try {
- tab = new Tab(null);
- assertTrue(false);
- } catch(NullPointerException ex) {
- }
- }
-
- public void testTab3() throws Exception {
- tab = new Tab("name", "label", true, "labelWidth",
"title");
- assertEquals("name", tab.getName());
- assertEquals("label", tab.getLabel());
- assertTrue(tab.isDisabled());
- assertEquals("labelWidth", tab.getLabelWidth());
- assertEquals("title", tab.getTitle());
- assertNull(tab.getSwitchType());
- }
-
- public void testTab4() throws Exception {
- tab = new Tab();
- assertTrue(tab instanceof TabModel);
- }
-}