Source Code Cross Referenced for ClassBehavior.java in  » Net » Terracotta » org » terracotta » dso » editors » chooser » 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 » Net » Terracotta » org.terracotta.dso.editors.chooser 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
003:         * notice. All rights reserved.
004:         */
005:        package org.terracotta.dso.editors.chooser;
006:
007:        import org.eclipse.jdt.core.IClassFile;
008:        import org.eclipse.jdt.core.ICompilationUnit;
009:        import org.eclipse.jdt.core.IJavaProject;
010:        import org.eclipse.jdt.core.IPackageFragment;
011:        import org.eclipse.jdt.core.IPackageFragmentRoot;
012:        import org.eclipse.jdt.core.IType;
013:        import org.eclipse.jdt.core.JavaModelException;
014:        import org.eclipse.jdt.internal.core.BinaryType;
015:        import org.eclipse.jdt.internal.core.SourceType;
016:        import org.eclipse.jdt.internal.ui.packageview.ClassPathContainer;
017:        import org.eclipse.jface.viewers.ISelectionChangedListener;
018:        import org.eclipse.jface.viewers.SelectionChangedEvent;
019:        import org.eclipse.jface.viewers.StructuredSelection;
020:        import org.eclipse.jface.viewers.Viewer;
021:        import org.eclipse.jface.viewers.ViewerFilter;
022:        import org.eclipse.swt.SWT;
023:
024:        import java.util.ArrayList;
025:        import java.util.Iterator;
026:        import java.util.List;
027:
028:        public final class ClassBehavior implements  NavigatorBehavior {
029:
030:            public static final String ADD_MSG = "Enter Fully Qualified Class Name";
031:            private static final String SELECT_CLASS = "Select Class";
032:            private final List m_selectedValues;
033:
034:            public ClassBehavior() {
035:                this .m_selectedValues = new ArrayList();
036:            }
037:
038:            public int style() {
039:                return SWT.MULTI;
040:            }
041:
042:            public String getTitle() {
043:                return SELECT_CLASS;
044:            }
045:
046:            public ViewerFilter getFilter(final IJavaProject javaProject) {
047:                return new ViewerFilter() {
048:                    public boolean select(Viewer viewer, Object parentElement,
049:                            Object element) {
050:                        if (element instanceof  IJavaProject)
051:                            return true;
052:                        if (element instanceof  ClassPathContainer
053:                                || element instanceof  ICompilationUnit
054:                                || element instanceof  IType
055:                                || element instanceof  IPackageFragmentRoot
056:                                || element instanceof  IClassFile) {
057:                            return true;
058:                        }
059:                        if (element instanceof  IPackageFragment) {
060:                            try {
061:                                return ((IPackageFragment) element)
062:                                        .containsJavaResources();
063:                            } catch (JavaModelException jme) {/**/
064:                            }
065:                        }
066:                        return false;
067:                    }
068:                };
069:            }
070:
071:            public ISelectionChangedListener getSelectionChangedListener(
072:                    final PackageNavigator nav) {
073:                return new ISelectionChangedListener() {
074:                    public void selectionChanged(SelectionChangedEvent event) {
075:                        m_selectedValues.removeAll(m_selectedValues);
076:                        StructuredSelection selection = (StructuredSelection) event
077:                                .getSelection();
078:                        List selectedClasses = new ArrayList();
079:                        if (!selection.isEmpty()) {
080:                            Object element;
081:                            for (Iterator i = selection.iterator(); i.hasNext();) {
082:                                element = i.next();
083:                                if (element instanceof  SourceType
084:                                        || element instanceof  BinaryType) {
085:                                    IType clazz = (IType) element;
086:                                    m_selectedValues.add(clazz
087:                                            .getFullyQualifiedName());
088:                                    selectedClasses.add(element);
089:                                }
090:                            }
091:                        }
092:                        if (selectedClasses.size() > 0)
093:                            nav.okButtonEnabled(true);
094:                        else
095:                            nav.okButtonEnabled(false);
096:                    }
097:                };
098:            }
099:
100:            public Object getValues() {
101:                return m_selectedValues.toArray(new String[0]);
102:            }
103:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.