Source Code Cross Referenced for GenericObjectTreeList.java in  » Workflow-Engines » osbl-1_0 » org » osbl » client » wings » form » 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 » Workflow Engines » osbl 1_0 » org.osbl.client.wings.form 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.osbl.client.wings.form;
002:
003:        import org.wings.*;
004:        import org.wings.event.SMouseListener;
005:        import org.wings.event.SMouseEvent;
006:        import org.wings.border.SLineBorder;
007:        import org.osbl.client.wings.shell.Environment;
008:        import org.osbl.client.action.ObjectAction;
009:        import org.osbl.client.action.ObjectActionEvent;
010:
011:        import javax.swing.tree.*;
012:        import java.awt.*;
013:        import java.util.*;
014:        import java.util.List;
015:
016:        /**
017:         * Created by IntelliJ IDEA.
018:         * User: hengels
019:         * Date: Feb 13, 2007
020:         * Time: 11:49:26 AM
021:         * To change this template use File | Settings | File Templates.
022:         */
023:        public abstract class GenericObjectTreeList extends STree implements 
024:                ObjectList {
025:            protected DelegateEnvironment environment = new DelegateEnvironment();
026:            Object current;
027:            private SScrollPane scrollPane;
028:
029:            public Environment getEnvironment() {
030:                getComponent();
031:                return environment;
032:            }
033:
034:            public SComponent getComponent() {
035:                if (scrollPane == null) {
036:                    scrollPane = new SScrollPane(this );
037:                    scrollPane.setPreferredSize(SDimension.FULLAREA);
038:                    scrollPane.setMode(SScrollPane.MODE_COMPLETE);
039:                    scrollPane.setBackground(Color.WHITE);
040:                    scrollPane.setBorder(new SLineBorder(new Color(187, 187,
041:                            187), 1));
042:                }
043:                return scrollPane;
044:            }
045:
046:            public Class getType() {
047:                return String.class;
048:            }
049:
050:            public GenericObjectTreeModel getModel() {
051:                return (GenericObjectTreeModel) super .getModel();
052:            }
053:
054:            public Object getCurrent() {
055:                return current;
056:            }
057:
058:            public void setCurrent(Object current) {
059:                this .current = current;
060:                GenericObjectTreeNode node = (GenericObjectTreeNode) current;
061:                TreePath path = node != null ? pathForNode(node) : null;
062:                if (path != null && path.getParentPath() != null)
063:                    expandRow(path.getParentPath());
064:                setSelectionPath(path);
065:            }
066:
067:            private TreePath pathForNode(GenericObjectTreeNode node) {
068:                java.util.List<GenericObjectTreeNode> list = new ArrayList<GenericObjectTreeNode>();
069:                do {
070:                    list.add(node);
071:                    node = node.getParent();
072:                } while (node != null);
073:                Collections.reverse(list);
074:                return new TreePath(list.toArray());
075:            }
076:
077:            public boolean hasNext() {
078:                return false;
079:            }
080:
081:            public void next() {
082:            }
083:
084:            public boolean hasPrevious() {
085:                return false;
086:            }
087:
088:            public void previous() {
089:            }
090:
091:            public void setSelectionMode(int selectionMode) {
092:                switch (selectionMode) {
093:                case SINGLE_SELECTION:
094:                    getSelectionModel().setSelectionMode(
095:                            TreeSelectionModel.SINGLE_TREE_SELECTION);
096:                    break;
097:                case MULTIPLE_SELECTION:
098:                    getSelectionModel().setSelectionMode(
099:                            TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
100:                    break;
101:                }
102:            }
103:
104:            public void setSelectedObject(Object object) {
105:            }
106:
107:            public Object getSelectedObject() {
108:                return null;
109:            }
110:
111:            public void setSelectedObjects(List objects) {
112:            }
113:
114:            public List getSelectedObjects() {
115:                return null;
116:            }
117:
118:            public void setLinkAction(String name, final ObjectAction linkAction) {
119:                addMouseListener(new SMouseListener() {
120:                    public void mouseClicked(SMouseEvent e) {
121:                        int row = getRowForLocation(e.getPoint());
122:                        TreePath path = getPathForRow(row);
123:                        GenericObjectTreeNode node = (GenericObjectTreeNode) path
124:                                .getLastPathComponent();
125:                        linkAction.actionPerformed(new ObjectActionEvent(
126:                                GenericObjectTreeList.this, node));
127:                        e.consume();
128:                    }
129:                });
130:            }
131:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.