Source Code Cross Referenced for LaunchEditor.java in  » Testing » abbot-1.0.1 » abbot » editor » editors » 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 » Testing » abbot 1.0.1 » abbot.editor.editors 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Name........: LaunchEditor 
003:         * Description.: Provide convenient editing of a launch step.
004:         * Author......: Timothy Wall 
005:         * E-Mail......: twall@users.sourceforge.net 
006:         */package abbot.editor.editors;
007:
008:        import abbot.editor.widgets.*;
009:        import abbot.script.*;
010:        import abbot.i18n.*;
011:        import abbot.util.*;
012:
013:        import javax.swing.*;
014:
015:        import java.awt.event.*;
016:
017:        import java.lang.reflect.*;
018:
019:        import java.util.*;
020:
021:        /**
022:         * Provide convenient editing of a launch step.
023:         */
024:        public class LaunchEditor extends CallEditor {
025:
026:            public static final String HELP_DESC = Strings.get("FixClassname");
027:
028:            private Launch launch;
029:
030:            protected ArrayEditor classpath;
031:
032:            private JCheckBox thread;
033:
034:            private JButton importeclipse;
035:
036:            /**
037:             * Initializes this editor which is used to edit the supplied step.
038:             * 
039:             * @param launch
040:             *            The launch step that will be edited.
041:             */
042:            public LaunchEditor(Launch launch) {
043:
044:                super (launch);
045:
046:                this .launch = launch;
047:
048:                String[] paths = PathClassLoader.convertPathToFilenames(launch
049:                        .getClasspath());
050:
051:                // FIXME extend ArrayEditor to use file choosing buttons instead of
052:                // text fields alone
053:                classpath = addArrayEditor(Strings.get("Classpath"), paths);
054:                classpath.setName(TAG_CLASSPATH);
055:
056:                thread = addCheckBox(Strings.get("Thread"), launch.isThreaded());
057:                thread.setName(TAG_THREADED);
058:
059:                // the stuff used to import an eclipse launch configuration
060:                try {
061:                    Class classobj = Class
062:                            .forName("abbot.editor.editors.ImportButton");
063:                    Constructor constructor = classobj
064:                            .getConstructor(new Class[] { LaunchEditor.class,
065:                                    Launch.class });
066:                    importeclipse = (JButton) constructor
067:                            .newInstance(new Object[] { this , launch });
068:                    add(importeclipse);
069:                } catch (Throwable t) {
070:                    // just don't embed the import button
071:                }
072:
073:            }
074:
075:            /**
076:             * Display only the public static member functions.
077:             */
078:            protected String[] getMethodNames(Method[] mlist) {
079:                ArrayList list = new ArrayList();
080:                int mask = Modifier.PUBLIC | Modifier.STATIC;
081:                for (int i = 0; i < mlist.length; i++) {
082:                    if ((mlist[i].getModifiers() & mask) == mask) {
083:                        list.add(mlist[i].getName());
084:                    }
085:                }
086:                return (String[]) list.toArray(new String[list.size()]);
087:            }
088:
089:            /**
090:             * {@inheritDoc}
091:             */
092:            public void actionPerformed(ActionEvent evt) {
093:                Object src = evt.getSource();
094:                if (src == classpath) {
095:                    Object[] values = classpath.getValues();
096:                    String cp = null;
097:                    if (values.length > 0) {
098:                        StringBuffer buf = new StringBuffer();
099:                        for (int i = 0; i < values.length; i++) {
100:                            if (i > 0) {
101:                                buf
102:                                        .append(System
103:                                                .getProperty("path.separator"));
104:                            }
105:                            String path = (String) values[i];
106:                            if ("".equals(path)) {
107:                                path = ".";
108:                            }
109:                            buf.append(path);
110:                        }
111:                        cp = buf.toString();
112:                    }
113:                    launch.setClasspath(cp);
114:                    // Changing the classpath may affect whether the class/method are
115:                    // valid.
116:                    validateTargetClass();
117:                    validateMethod();
118:                    fireStepChanged();
119:                } else if (src == thread) {
120:                    launch.setThreaded(!launch.isThreaded());
121:                    fireStepChanged();
122:                } else {
123:                    super .actionPerformed(evt);
124:                }
125:
126:                // Remove the default placeholder description
127:                if (HELP_DESC.equals(launch.getDescription())) {
128:                    launch.setDescription(null);
129:                    fireStepChanged();
130:                }
131:
132:            }
133:
134:        } /* ENDCLASS */
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.