Source Code Cross Referenced for ClassMenuIdeAdapter.java in  » Testing » KeY » de » uka » ilkd » key » casetool » together » scripts » menuextension » 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 » KeY » de.uka.ilkd.key.casetool.together.scripts.menuextension 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // This file is part of KeY - Integrated Deductive Software Design
002:        // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
003:        //                         Universitaet Koblenz-Landau, Germany
004:        //                         Chalmers University of Technology, Sweden
005:        //
006:        // The KeY system is protected by the GNU General Public License. 
007:        // See LICENSE.TXT for details.
008:        //
009:        //
010:
011:        /* Generated by Together */
012:
013:        package de.uka.ilkd.key.casetool.together.scripts.menuextension;
014:
015:        import com.togethersoft.openapi.ide.IdeContext;
016:        import com.togethersoft.openapi.ide.command.IdeCommandAdapter;
017:        import com.togethersoft.openapi.ide.command.IdeCommandEvent;
018:        import com.togethersoft.openapi.ide.diagram.IdeDiagramManagerAccess;
019:        import com.togethersoft.openapi.ide.window.IdeWindowManager;
020:        import com.togethersoft.openapi.rwi.RwiDiagram;
021:        import com.togethersoft.openapi.rwi.RwiModel;
022:        import com.togethersoft.openapi.rwi.RwiModelAccess;
023:
024:        import de.uka.ilkd.key.casetool.together.keydebugclassloader.KeyDebugClassLoader;
025:
026:        public class ClassMenuIdeAdapter extends IdeCommandAdapter {
027:
028:            public ClassMenuIdeAdapter(KeyMenuExtension script,
029:                    IdeWindowManager aWinMan, int ind1, String className) {
030:                lnkKeyMenuExtension = script;
031:                winMan = aWinMan;
032:                groupElementNo = ind1;
033:                classMenuRootCN = className;
034:            }
035:
036:            private int groupElementNo;
037:            private String classMenuRootCN;
038:            private IdeWindowManager winMan;
039:            private KeyMenuExtension lnkKeyMenuExtension;
040:
041:            public void checkStatus(IdeCommandEvent event) {
042:                try {
043:                    lnkKeyMenuExtension.myClassItem[groupElementNo - 1]
044:                            .setText(((ClassMenu) Class.forName(
045:                                    classMenuRootCN + "Point" + groupElementNo)
046:                                    .newInstance()).getMenuEntry());
047:                } catch (ExceptionInInitializerError ei) {
048:                    System.err
049:                            .println("classmenuideadapter: the initialization provoked "
050:                                    + "by this method fails.");
051:                    System.err.println("The exception was: " + ei);
052:                    ei.printStackTrace();
053:                } catch (ClassNotFoundException cnfe) {
054:                    System.err
055:                            .println("classmenuideadapter: class cannot be located");
056:                    System.err.println("The exception was: " + cnfe);
057:                    cnfe.printStackTrace();
058:                } catch (IllegalAccessException iae) {
059:                    System.err.println("classmenuideadapter: class or "
060:                            + "initializer is not accessible.");
061:                    System.err.println("The exception was: " + iae);
062:                    iae.printStackTrace();
063:                } catch (InstantiationException ie) {
064:                    System.err
065:                            .println("classmenuideadapter: class tried to\n"
066:                                    + "instantiate represents an abstract class, an interface,"
067:                                    + "an array class, a primitive type, or void; or if the"
068:                                    + "instantiation fails for some other reason.");
069:                    System.err.println("The exception was: " + ie);
070:                    ie.printStackTrace();
071:                } catch (SecurityException se) {
072:                    System.err
073:                            .println("classmenuideadapter: no permission to create"
074:                                    + "a new instance");
075:                    System.err.println("The exception was: " + se);
076:                    se.printStackTrace();
077:                } catch (LinkageError le) {
078:                    System.err.println("classmenuideadapter: linkage failed");
079:                    System.err.println("The exception was: " + le);
080:                    le.printStackTrace();
081:                }
082:
083:                lnkKeyMenuExtension.myClassItem[groupElementNo - 1]
084:                        .setEnabled(true);
085:                lnkKeyMenuExtension.myClassItem[groupElementNo - 1]
086:                        .setVisible(true);
087:            }
088:
089:            public void actionPerformed(IdeCommandEvent event) {
090:                // what should be done be selecting this context menu
091:                IdeContext context = event.getElementContext(); //getting the element(s) under the cursor
092:                RwiDiagram activeRwiDiagram = IdeDiagramManagerAccess
093:                        .getDiagramManager().getActiveDiagram().getRwiDiagram();
094:                RwiModel currentRwiModel = RwiModelAccess.getModel();
095:
096:                Class cl;
097:                ClassLoader classLoader = this .getClass().getClassLoader();
098:                if ("on".equals(System.getProperty("KeyDebugClassLoader"))) {
099:                    // installing the keydebugclassloader instead
100:                    // see also de.uka.ilkd.tjext.keydebugclassloader.KeyScript
101:                    try {
102:                        classLoader = new KeyDebugClassLoader(classLoader);
103:                        ((KeyDebugClassLoader) classLoader)
104:                                .setClassAlwaysAskParent(ClassMenu.class);
105:                    } catch (SecurityException se) {
106:                        System.err
107:                                .println("classmenuideadapter: security manager exists and\n"
108:                                        + "its checkPermission method doesn't allow access\n"
109:                                        + "to the system class loader.");
110:                        System.err.println("KeYError: " + se);
111:                        se.printStackTrace();
112:                    }
113:                }
114:                try {
115:                    cl = classLoader.loadClass(classMenuRootCN + "Point"
116:                            + groupElementNo);
117:                    // now creating an instance of the (re)loaded class and 
118:                    // invoking the run-method
119:                    ClassMenu instance = (ClassMenu) cl.newInstance();
120:                    instance.run(winMan, context, currentRwiModel,
121:                            activeRwiDiagram);
122:                } catch (ClassNotFoundException cnfe) {
123:                    System.err
124:                            .println("classmenuideadapter: class cannot be located");
125:                    System.err.println("The exception was: " + cnfe);
126:                    cnfe.printStackTrace();
127:                } catch (ExceptionInInitializerError ei) {
128:                    System.err
129:                            .println("classmenuideadapter: the initialization provoked "
130:                                    + "by this method fails.");
131:                    System.err.println("The exception was: " + ei);
132:                    ei.printStackTrace();
133:                } catch (IllegalAccessException iae) {
134:                    System.err.println("classmenuideadapter: class or "
135:                            + "initializer is not accessible.");
136:                    System.err.println("The exception was: " + iae);
137:                    iae.printStackTrace();
138:                } catch (InstantiationException ie) {
139:                    System.err
140:                            .println("classmenuideadapter: class tried to\n"
141:                                    + "instantiate represents an abstract class, an interface,"
142:                                    + "an array class, a primitive type, or void; or if the"
143:                                    + "instantiation fails for some other reason.");
144:                    System.err.println("The exception was: " + ie);
145:                    ie.printStackTrace();
146:                } catch (SecurityException se) {
147:                    System.err
148:                            .println("classmenuideadapter: no permission to create"
149:                                    + "a new instance");
150:                    System.err.println("The exception was: " + se);
151:                    se.printStackTrace();
152:                }
153:
154:            }
155:
156:        }
w_w___w_._j_av___a2s___.___co__m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.