Source Code Cross Referenced for ItsNatFreeComboBoxImpl.java in  » Ajax » ItsNat » org » itsnat » impl » comp » free » 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 » Ajax » ItsNat » org.itsnat.impl.comp.free 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:          ItsNat Java Web Application Framework
003:          Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
004:          Author: Jose Maria Arranz Santamaria
005:
006:          This program is free software: you can redistribute it and/or modify
007:          it under the terms of the GNU Affero General Public License as published by
008:          the Free Software Foundation, either version 3 of the License, or
009:          (at your option) any later version. See the GNU Affero General Public 
010:          License for more details. See the copy of the GNU Affero General Public License
011:          included in this program. If not, see <http://www.gnu.org/licenses/>.
012:         */
013:
014:        package org.itsnat.impl.comp.free;
015:
016:        import org.itsnat.comp.ItsNatListCellEditor;
017:        import org.itsnat.comp.free.ItsNatFreeComboBox;
018:        import org.itsnat.comp.ui.ItsNatComboBoxUI;
019:        import org.itsnat.comp.ui.ItsNatComponentUI;
020:        import org.itsnat.core.ItsNatException;
021:        import org.itsnat.impl.comp.*;
022:        import org.itsnat.impl.comp.ui.free.ItsNatFreeComboBoxUIImpl;
023:        import java.awt.event.ItemEvent;
024:        import java.awt.event.ItemListener;
025:        import javax.swing.ComboBoxModel;
026:        import javax.swing.DefaultComboBoxModel;
027:        import javax.swing.ListModel;
028:        import javax.swing.MutableComboBoxModel;
029:        import javax.swing.event.EventListenerList;
030:        import javax.swing.event.ListDataEvent;
031:        import org.itsnat.comp.ItsNatListStructure;
032:        import org.itsnat.comp.ui.ItsNatListCellUI;
033:        import org.itsnat.comp.ui.ItsNatListUI;
034:        import org.itsnat.core.NameValue;
035:        import org.w3c.dom.Element;
036:        import org.w3c.dom.Node;
037:        import org.w3c.dom.events.Event;
038:
039:        /**
040:         *
041:         * @author jmarranz
042:         */
043:        public class ItsNatFreeComboBoxImpl extends ItsNatFreeListImpl
044:                implements  ItsNatFreeComboBox, ItsNatComboBoxInternal {
045:            protected Object selectedItemReminder;
046:            protected EventListenerList listenerList = new EventListenerList();
047:
048:            /**
049:             * Creates a new instance of ItsNatFreeComboBoxImpl
050:             */
051:            public ItsNatFreeComboBoxImpl(Element element,
052:                    ItsNatListStructure structure, NameValue[] artifacts,
053:                    ItsNatComponentManagerImpl componentMgr) {
054:                super (element, structure, artifacts, componentMgr);
055:
056:                init();
057:            }
058:
059:            public Object getSelectedItemReminder() {
060:                return selectedItemReminder;
061:            }
062:
063:            public void setSelectedItemReminder(Object obj) {
064:                this .selectedItemReminder = obj;
065:            }
066:
067:            public void processDOMEvent(Event evt) {
068:                String type = evt.getType();
069:                if (type.equals("click") || type.equals("mouseup")) {
070:                    Node nodeClicked = (Node) evt.getTarget(); // Puede ser un nodo interior del elemento pulsado
071:
072:                    ItsNatListUI compUI = getItsNatListUI();
073:                    ItsNatListCellUI option = compUI
074:                            .getItsNatListCellUIFromNode(nodeClicked);
075:                    if (option != null) // por si acaso
076:                    {
077:                        int selectedIndex = option.getIndex();
078:                        setSelectedIndex(selectedIndex);
079:                    }
080:                }
081:
082:                super .processDOMEvent(evt);
083:            }
084:
085:            public ItsNatComboBoxUI getItsNatComboBoxUI() {
086:                return (ItsNatComboBoxUI) compUI;
087:            }
088:
089:            public ItsNatComboBoxUI createDefaultItsNatFreeComboBoxUI() {
090:                return new ItsNatFreeComboBoxUIImpl(this );
091:            }
092:
093:            public ItsNatComponentUI createDefaultItsNatComponentUI() {
094:                return createDefaultItsNatFreeComboBoxUI();
095:            }
096:
097:            public void syncUIWithDataModel() {
098:                super .syncUIWithDataModel();
099:
100:                ItsNatComboBoxSharedImpl.syncUIWithDataModel(this );
101:            }
102:
103:            public ComboBoxModel getComboBoxModel() {
104:                return (ComboBoxModel) dataModel;
105:            }
106:
107:            public void setComboBoxModel(ComboBoxModel dataModel) {
108:                setDataModel(dataModel);
109:            }
110:
111:            public ListModel getListModel() {
112:                return getComboBoxModel();
113:            }
114:
115:            public void setListModel(ListModel dataModel) {
116:                setComboBoxModel((ComboBoxModel) dataModel);
117:            }
118:
119:            public void checkMutableComboBoxModel() {
120:                ItsNatComboBoxSharedImpl
121:                        .checkMutableComboBoxModel(getComboBoxModel());
122:            }
123:
124:            public void addElement(Object anObject) {
125:                checkMutableComboBoxModel();
126:                MutableComboBoxModel model = (MutableComboBoxModel) getComboBoxModel();
127:                model.addElement(anObject);
128:            }
129:
130:            public void insertElementAt(int index, Object anObject) {
131:                checkMutableComboBoxModel();
132:                MutableComboBoxModel model = (MutableComboBoxModel) getComboBoxModel();
133:                model.insertElementAt(anObject, index);
134:            }
135:
136:            public void removeElementAt(int anIndex) {
137:                checkMutableComboBoxModel();
138:                MutableComboBoxModel model = (MutableComboBoxModel) getComboBoxModel();
139:                model.removeElementAt(anIndex);
140:            }
141:
142:            public void removeAllElements() {
143:                checkMutableComboBoxModel();
144:                ItsNatComboBoxSharedImpl.removeAllElements(this );
145:            }
146:
147:            public void removeElement(Object anObject) {
148:                checkMutableComboBoxModel();
149:                MutableComboBoxModel model = (MutableComboBoxModel) getComboBoxModel();
150:                model.removeElement(anObject);
151:            }
152:
153:            public int getSelectedIndex() {
154:                return ItsNatComboBoxSharedImpl.getSelectedIndex(this );
155:            }
156:
157:            public void setSelectedIndex(int index) {
158:                ItsNatComboBoxSharedImpl.setSelectedIndex(this , index);
159:            }
160:
161:            public Object getSelectedItem() {
162:                return ItsNatComboBoxSharedImpl.getSelectedItem(this );
163:            }
164:
165:            public void setSelectedItem(Object anObject) {
166:                ItsNatComboBoxSharedImpl.setSelectedItem(this , anObject);
167:            }
168:
169:            public Object[] getSelectedObjects() {
170:                return ItsNatComboBoxSharedImpl.getSelectedObjects(this );
171:            }
172:
173:            public void contentsChanged(ListDataEvent e) {
174:                super .contentsChanged(e);
175:
176:                ItsNatComboBoxSharedImpl.contentsChanged(this , e);
177:            }
178:
179:            public void intervalAdded(ListDataEvent e) {
180:                super .intervalAdded(e);
181:
182:                ItsNatComboBoxSharedImpl.intervalAdded(this , e);
183:            }
184:
185:            public void intervalRemoved(ListDataEvent e) {
186:                super .intervalRemoved(e);
187:
188:                ItsNatComboBoxSharedImpl.intervalRemoved(this , e);
189:            }
190:
191:            public void addItemListener(ItemListener l) {
192:                listenerList.add(ItemListener.class, l);
193:            }
194:
195:            public void removeItemListener(ItemListener l) {
196:                listenerList.remove(ItemListener.class, l);
197:            }
198:
199:            public boolean hasItemListeners() {
200:                return listenerList.getListenerCount() > 0;
201:            }
202:
203:            public ItemListener[] getItemListeners() {
204:                return (ItemListener[]) listenerList
205:                        .getListeners(ItemListener.class);
206:            }
207:
208:            public void fireItemStateChanged(ItemEvent e) {
209:                ItsNatComboBoxSharedImpl.fireItemStateChanged(this , e);
210:            }
211:
212:            public Object createDefaultModelInternal() {
213:                return createDefaultListModel();
214:            }
215:
216:            public ListModel createDefaultListModel() {
217:                return new DefaultComboBoxModel();
218:            }
219:
220:            public ItsNatListCellEditor getItsNatListCellEditor() {
221:                return null;
222:            }
223:
224:            public void setItsNatListCellEditor(ItsNatListCellEditor cellEditor) {
225:                throw new ItsNatException(
226:                        "Combo box items can not be graphically edited");
227:            }
228:
229:            public void startEditingAt(int index) {
230:                throw new ItsNatException(
231:                        "Combo box items can not be graphically edited");
232:            }
233:
234:            public boolean isEditing() {
235:                return false;
236:            }
237:
238:            public int getEditingIndex() {
239:                return -1;
240:            }
241:
242:            public String getEditorActivatorEvent() {
243:                throw new ItsNatException(
244:                        "Combo box items can not be graphically edited");
245:            }
246:
247:            public void setEditorActivatorEvent(String event) {
248:                throw new ItsNatException(
249:                        "Combo box items can not be graphically edited");
250:            }
251:
252:            public void setUISelectedIndex(int index) {
253:                ItsNatComboBoxUI compUI = getItsNatComboBoxUI();
254:                compUI.setSelectedIndex(index);
255:            }
256:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.