Source Code Cross Referenced for MenuElement.java in  » Mail-Clients » columba-1.4 » org » columba » core » gui » menu » 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 » Mail Clients » columba 1.4 » org.columba.core.gui.menu 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // The contents of this file are subject to the Mozilla Public License Version
002:        // 1.1
003:        //(the "License"); you may not use this file except in compliance with the
004:        //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
005:        //
006:        //Software distributed under the License is distributed on an "AS IS" basis,
007:        //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
008:        //for the specific language governing rights and
009:        //limitations under the License.
010:        //
011:        //The Original Code is "The Columba Project"
012:        //
013:        //The Initial Developers of the Original Code are Frederik Dietz and Timo
014:        // Stich.
015:        //Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
016:        //
017:        //All Rights Reserved.
018:        package org.columba.core.gui.menu;
019:
020:        import java.awt.Component;
021:        import java.util.Enumeration;
022:        import java.util.Vector;
023:
024:        import javax.swing.Action;
025:        import javax.swing.JMenuItem;
026:
027:        /**
028:         * Menu element.
029:         * 
030:         * @author fdietz
031:         */
032:        public class MenuElement implements  IMenuElement {
033:
034:            private int type;
035:
036:            private Action action;
037:
038:            private String placeholderId;
039:
040:            private String menuId;
041:
042:            private String menuLabel;
043:
044:            private IMenuElement parent;
045:
046:            private JMenuItem menuItem;
047:
048:            private Component component;
049:
050:            private Vector children = new Vector();
051:
052:            public MenuElement(int type) {
053:                this .type = type;
054:            }
055:
056:            public boolean isSeparator() {
057:                return type == TYPE_SEPARATOR ? true : false;
058:            }
059:
060:            public boolean isAction() {
061:                return type == TYPE_ACTION ? true : false;
062:            }
063:
064:            public boolean isPlaceholder() {
065:                return type == TYPE_PLACEHOLDER ? true : false;
066:            }
067:
068:            public boolean isMenu() {
069:                return type == TYPE_MENU ? true : false;
070:            }
071:
072:            public boolean isComponent() {
073:                return type == TYPE_MENUITEM ? true : false;
074:            }
075:
076:            /**
077:             * @return Returns the action.
078:             */
079:            public Action getAction() {
080:                return action;
081:            }
082:
083:            /**
084:             * @return Returns the placeholderId.
085:             */
086:            public String getPlaceholderId() {
087:                return placeholderId;
088:            }
089:
090:            public IMenuElement getParent() {
091:                return parent;
092:            }
093:
094:            public Enumeration getChildren() {
095:                return children.elements();
096:            }
097:
098:            public void add(IMenuElement child) {
099:                child.setParent(this );
100:                children.add(child);
101:            }
102:
103:            public void setParent(IMenuElement parent) {
104:                this .parent = parent;
105:            }
106:
107:            public void remove(IMenuElement child) {
108:                children.remove(child);
109:            }
110:
111:            public void remove(int index) {
112:                children.remove(index);
113:            }
114:
115:            /**
116:             * @return Returns the menuId.
117:             */
118:            public String getMenuId() {
119:                return menuId;
120:            }
121:
122:            /**
123:             * @param menuId
124:             *            The menuId to set.
125:             */
126:            public void setMenuId(String menuId) {
127:                this .menuId = menuId;
128:            }
129:
130:            /**
131:             * @param action
132:             *            The action to set.
133:             */
134:            public void setAction(Action action) {
135:                this .action = action;
136:            }
137:
138:            /**
139:             * @param placeholderId
140:             *            The placeholderId to set.
141:             */
142:            public void setPlaceholderId(String placeholderId) {
143:                this .placeholderId = placeholderId;
144:            }
145:
146:            /**
147:             * @return Returns the menuLabel.
148:             */
149:            public String getMenuLabel() {
150:                return menuLabel;
151:            }
152:
153:            /**
154:             * @param menuLabel
155:             *            The menuLabel to set.
156:             */
157:            public void setMenuLabel(String menuLabel) {
158:                this .menuLabel = menuLabel;
159:            }
160:
161:            public int indexOf(IMenuElement child) {
162:                return children.indexOf(child);
163:            }
164:
165:            public void insert(IMenuElement child, int position) {
166:                child.setParent(this );
167:
168:                children.insertElementAt(child, position);
169:            }
170:
171:            public String toString() {
172:                StringBuffer buf = new StringBuffer();
173:                if (menuId != null)
174:                    buf.append(menuId);
175:                if (placeholderId != null)
176:                    buf.append(placeholderId);
177:                if (action != null)
178:                    buf.append(action.toString());
179:
180:                buf.append(" type=" + type);
181:
182:                return buf.toString();
183:            }
184:
185:            public JMenuItem getMenuItem() {
186:                return menuItem;
187:            }
188:
189:            /**
190:             * @param component
191:             *            The component to set.
192:             */
193:            public void setMenuItem(JMenuItem menuItem) {
194:                this .menuItem = menuItem;
195:            }
196:
197:            public Component getComponent() {
198:                return component;
199:            }
200:
201:            /**
202:             * @param component The component to set.
203:             */
204:            public void setComponent(Component component) {
205:                this.component = component;
206:            }
207:
208:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.