Source Code Cross Referenced for TabStripControl.java in  » Web-Framework » jWic » de » jwic » controls » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » jWic » de.jwic.controls 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * de.jwic.controls.TabStripControl
003:         * $Id: TabStripControl.java,v 1.5 2007/04/03 12:44:41 aroncotrau Exp $
004:         */
005:        package de.jwic.controls;
006:
007:        import java.util.ArrayList;
008:        import java.util.List;
009:
010:        import de.jwic.base.Control;
011:        import de.jwic.base.ControlContainer;
012:        import de.jwic.base.IControlContainer;
013:        import de.jwic.base.JWicException;
014:
015:        /**
016:         * A TabStrip acts like the dividers in a notebook or the labels on a group of file folders. 
017:         * By using a TabStrip control, you can define multiple pages for the same area of a panel.
018:         *
019:         * @author Florian Lippisch
020:         */
021:        public class TabStripControl extends ControlContainer {
022:
023:            private static final long serialVersionUID = 1L;
024:
025:            public static final String LOCATION_TOP = "top";
026:            public static final String LOCATION_BOTTOM = "bottom";
027:            public static final String LOCATION_LEFT = "left";
028:            public static final String LOCATION_RIGHT = "right";
029:
030:            public final static String ACTION_OPENTAB = "opentab";
031:            private String strActiveTabName = null;
032:            private String location = LOCATION_TOP;
033:
034:            private List tabs = new ArrayList();
035:
036:            /**
037:             * @param container
038:             */
039:            public TabStripControl(IControlContainer container) {
040:                super (container);
041:            }
042:
043:            /**
044:             * @param container
045:             * @param name
046:             */
047:            public TabStripControl(IControlContainer container, String name) {
048:                super (container, name);
049:            }
050:
051:            /* (non-Javadoc)
052:             * @see de.jwic.base.ControlContainer#registerControl(de.jwic.base.Control, java.lang.String)
053:             */
054:            public void registerControl(Control control, String name)
055:                    throws JWicException {
056:                if (!(control instanceof  TabControl)) {
057:                    throw new IllegalArgumentException(
058:                            "Only TabControls may be added to a TabStripControl.");
059:                }
060:                super .registerControl(control, name);
061:                tabs.add(control);
062:
063:            }
064:
065:            /* (non-Javadoc)
066:             * @see de.jwic.base.ControlContainer#unregisterControl(de.jwic.base.Control)
067:             */
068:            public void unregisterControl(Control control) {
069:                if (control != null) {
070:                    tabs.remove(control);
071:                    if (control.getName().equals(getActiveTabName())) {
072:                        if (tabs.size() > 0) {
073:                            setActiveTabName(((Control) tabs.get(0)).getName());
074:                        } else {
075:                            setActiveTabName(null);
076:                        }
077:                    }
078:                }
079:                super .unregisterControl(control);
080:            }
081:
082:            /**
083:             * Add a new tab with a default name.
084:             * @param titleID java.lang.String
085:             * @param name java.lang.String
086:             */
087:            public TabControl addTab(String titleID) {
088:                return addTab(titleID, null);
089:            }
090:
091:            /**
092:             * Add a new tab with the specified title and name.
093:             * @param titleID java.lang.String
094:             * @param name java.lang.String
095:             */
096:            public TabControl addTab(String titleID, String name) {
097:                TabControl tc = new TabControl(this , name);
098:                tc.setTitle(titleID);
099:
100:                if (strActiveTabName == null)
101:                    setActiveTabName(tc.getName());
102:
103:                return tc;
104:            }
105:
106:            /* (non-Javadoc)
107:             * @see de.jwic.base.ControlContainer#actionPerformed(java.lang.String, java.lang.String)
108:             */
109:            public void actionPerformed(String actionId, String parameter) {
110:
111:                if (actionId.equals(ACTION_OPENTAB)) {
112:                    setActiveTabName(parameter);
113:                }
114:
115:            }
116:
117:            /**
118:             * Returns the name of the active tab.
119:             * @return java.lang.String
120:             */
121:            public String getActiveTabName() {
122:                return strActiveTabName;
123:            }
124:
125:            /**
126:             * Creation date: (03.02.2003 12:26:12)
127:             * @param newActiveTabName java.lang.String
128:             */
129:            public void setActiveTabName(java.lang.String newActiveTabName) {
130:                strActiveTabName = newActiveTabName;
131:                setRequireRedraw(true);
132:            }
133:
134:            /**
135:             * Returns the list of tabs.
136:             * @return List of TabControl objects.
137:             */
138:            public List getTabs() {
139:                return tabs;
140:            }
141:
142:            /* (non-Javadoc)
143:             * @see de.jwic.base.ControlContainer#isRenderingRelevant(de.jwic.base.Control)
144:             */
145:            public boolean isRenderingRelevant(Control childControl) {
146:                return childControl.getName().equals(strActiveTabName);
147:            }
148:
149:            /**
150:             * @return the location of the tabs
151:             */
152:            public String getLocation() {
153:                return location;
154:            }
155:
156:            /**
157:             * Set the location of the tabs
158:             * @param newLocation
159:             */
160:            public void setLocation(String newLocation) {
161:                if (!this .location.equals(newLocation)) {
162:                    setRequireRedraw(true);
163:                }
164:
165:                this.location = newLocation;
166:            }
167:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.