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


001:        package abbot.editor;
002:
003:        import abbot.finder.TestHierarchy;
004:
005:        import abbot.script.Script;
006:
007:        import java.awt.Component;
008:
009:        import java.io.File;
010:
011:        import java.util.HashSet;
012:        import java.util.Set;
013:
014:        /**
015:         * Provide a transport for the editor context. This is usefull in cases where
016:         * the costello editor is invoked inside of another application. It can also
017:         * be used to provide further editor customization, for example a new file
018:         * template, depending on the context.
019:         */
020:
021:        public class EditorContext {
022:
023:            private String _arguments[];
024:            private boolean _embedded;
025:            private TestHierarchy _hierarchy = null;
026:            private SecurityManager _securityManager = null;
027:            private File _newFileTemplate = null;
028:            private FileSystemHelper _fileSystemHelper = new FileSystemHelper();
029:
030:            public EditorContext(String[] arguments) {
031:                _arguments = arguments;
032:            }
033:
034:            public EditorContext() {
035:                _arguments = new String[0];
036:            }
037:
038:            //
039:            // Getters and setters
040:            //
041:
042:            public String[] getArguments() {
043:                return (String[]) _arguments.clone();
044:            }
045:
046:            public void setArguments(String[] arguments) {
047:                _arguments = arguments;
048:            }
049:
050:            /**
051:             * @return Whether the costello editor is being embdeed in another application
052:             */
053:            public boolean isEmbedded() {
054:                return _embedded;
055:            }
056:
057:            /**
058:             * @param embedded Whether costello is embedded in another application
059:             */
060:            public void setEmbedded(boolean embedded) {
061:                _embedded = embedded;
062:            }
063:
064:            /**
065:             * @return A hierarchy that can preconfigured to filter certain components
066:             * ignoreExisting call. This is usefull in the embedded case.
067:             */
068:            public TestHierarchy getTestHierarchy() {
069:                return _hierarchy;
070:            }
071:
072:            /**
073:             * @param hierarchy A hierarchy that can preconfigured to filter certain components
074:             * @throws IllegalStateException if we are not in an embedded mode
075:             */
076:            public void setTestHierarchy(TestHierarchy hierarchy) {
077:                if (!isEmbedded()) {
078:                    throw new IllegalStateException(
079:                            "Only value when Costello is to be embedded");
080:                }
081:
082:                _hierarchy = hierarchy;
083:            }
084:
085:            /**
086:             * @param newFileTemplate The file to be used when creating new
087:             * scripts.
088:             */
089:            public void setNewFileTemplate(File newFileTemplate) {
090:                if (!newFileTemplate.exists()) {
091:                    throw new IllegalArgumentException("File doesn't exist");
092:                }
093:                if (!Script.isScript(newFileTemplate)) {
094:                    throw new IllegalArgumentException(
095:                            "File doesn't appears to be a script");
096:                }
097:
098:                _newFileTemplate = newFileTemplate;
099:            }
100:
101:            /**
102:             * @return The file to be used
103:             */
104:            public File getNewFileTemplate() {
105:                return _newFileTemplate;
106:            }
107:
108:            /**
109:             * @param securityManager The secutiry manager for this context
110:             */
111:
112:            public void setSecurityManager(SecurityManager securityManager) {
113:                _securityManager = securityManager;
114:            }
115:
116:            /**
117:             * @return The security manage for this context
118:             */
119:
120:            public SecurityManager getSecurityManager() {
121:                return _securityManager;
122:            }
123:
124:            /**
125:             * @param helper A file system helper for this context, usefull for the
126:             *   case where the costello editor is emdedded in an IDE
127:             */
128:            public void setFileSysteHelper(FileSystemHelper helper) {
129:                _fileSystemHelper = helper;
130:            }
131:
132:            /**
133:             * @return A file system helper for this context
134:             */
135:
136:            public FileSystemHelper getFileSystemHelper() {
137:                return _fileSystemHelper;
138:            }
139:
140:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.