Source Code Cross Referenced for PluginsTools.java in  » Test-Coverage » salome-tmf » org » objectweb » salome_tmf » ihm » main » plugins » 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 » Test Coverage » salome tmf » org.objectweb.salome_tmf.ihm.main.plugins 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * SalomeTMF is a Test Management Framework
003:         * Copyright (C) 2005 France Telecom R&D
004:         *
005:         * This library is free software; you can redistribute it and/or
006:         * modify it under the terms of the GNU Lesser General Public
007:         * License as published by the Free Software Foundation; either
008:         * version 2 of the License, or (at your option) any later version.
009:         *
010:         * This library is distributed in the hope that it will be useful,
011:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
012:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013:         * Lesser General Public License for more details.
014:         *
015:         * You should have received a copy of the GNU Lesser General Public
016:         * License along with this library; if not, write to the Free Software
017:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018:         *
019:         * @author Fayçal SOUGRATI, Vincent Pautret, Marche Mikael
020:         *
021:         * Contact: mikael.marche@rd.francetelecom.com
022:         */
023:
024:        package org.objectweb.salome_tmf.ihm.main.plugins;
025:
026:        import java.awt.event.ActionEvent;
027:        import java.awt.event.ActionListener;
028:        import java.util.LinkedList;
029:
030:        import javax.swing.JMenu;
031:        import javax.swing.JMenuItem;
032:
033:        import org.objectweb.salome_tmf.data.Campaign;
034:        import org.objectweb.salome_tmf.data.Environment;
035:        import org.objectweb.salome_tmf.data.Execution;
036:        import org.objectweb.salome_tmf.data.ExecutionResult;
037:        import org.objectweb.salome_tmf.data.ExecutionTestResult;
038:        import org.objectweb.salome_tmf.data.Family;
039:        import org.objectweb.salome_tmf.data.Project;
040:        import org.objectweb.salome_tmf.data.Test;
041:        import org.objectweb.salome_tmf.data.TestList;
042:        import org.objectweb.salome_tmf.data.User;
043:        import org.objectweb.salome_tmf.ihm.languages.Language;
044:        import org.objectweb.salome_tmf.ihm.main.SalomeTMFContext;
045:        import org.objectweb.salome_tmf.ihm.main.datawrapper.DataModel;
046:        import org.objectweb.salome_tmf.plugins.core.BugTracker;
047:        import org.objectweb.salome_tmf.plugins.core.Common;
048:
049:        /**
050:         * Methods and tools for plugins management
051:         * @author  capg2710
052:         */
053:        public class PluginsTools {
054:
055:            /** Creates a new instance of PluginsTools */
056:            public PluginsTools() {
057:            }
058:
059:            /**
060:             * Activates associated plugins to dynamic UI components
061:             * @param uiConst
062:             */
063:            public static void activateAssociatedPlgs(Integer uiConst) {
064:                LinkedList list = SalomeTMFContext.getInstance()
065:                        .getAssociatedPluginsToUIComp(uiConst);
066:                if (list != null) {
067:                    for (int i = 0; i < list.size(); i++) {
068:                        ((Common) list.get(i))
069:                                .activatePluginInDynamicComponent(uiConst);
070:                    }
071:                }
072:            }
073:
074:            /**
075:             * Returns the current project in Salomé
076:             * @return Current project in Salomé
077:             */
078:            public static Project getCurrentProject() {
079:                return DataModel.getCurrentProject();
080:            }
081:
082:            /**
083:             * Returns the current user in Salomé
084:             * @return Current user in Salomé
085:             */
086:            public static User getCurrentUser() {
087:                return DataModel.getCurrentUser();
088:            }
089:
090:            /**
091:             * Returns current campaign execution
092:             * @return current campaign execution
093:             */
094:            public static Execution getCurrentCampExecution() {
095:                return DataModel.getObservedExecution();
096:            }
097:
098:            /**
099:             * Returns current campaign execution's environement
100:             * @return current campaign execution's environement
101:             */
102:            public static Environment getCurrentCampExecutionEnvironment() {
103:                Environment result;
104:                if (DataModel.getObservedExecution() == null) {
105:                    result = null;
106:                } else {
107:                    result = DataModel.getObservedExecution()
108:                            .getEnvironmentFromModel();
109:                }
110:                return result;
111:            }
112:
113:            /**
114:             * Returns current campaign execution result
115:             * @return current campaign execution result
116:             */
117:            public static ExecutionResult getCurrentCampExecResult() {
118:                return DataModel.getObservedExecutionResult();
119:            }
120:
121:            /**
122:             * Returns current test execution result
123:             * @return current test execution result
124:             */
125:            public static ExecutionTestResult getCurrentTestExecutionResult() {
126:                return DataModel.getCurrentExecutionTestResult();
127:            }
128:
129:            /**
130:             * Returns current campaign
131:             * @return current campaign
132:             */
133:            public static Campaign getCurrentCampaign() {
134:                return DataModel.getCurrentCampaign();
135:            }
136:
137:            /**
138:             * Returns current test
139:             * @return current test
140:             */
141:            public static Test getCurrentTest() {
142:                return DataModel.getCurrentTest();
143:            }
144:
145:            /**
146:             * Returns current test list
147:             * @return current test list
148:             */
149:            public static TestList getCurrentTestList() {
150:                return DataModel.getCurrentTestList();
151:            }
152:
153:            /**
154:             * Returns current family
155:             * @return current family
156:             */
157:            public static Family getCurrentFamily() {
158:                return DataModel.getCurrentFamily();
159:            }
160:
161:            /**
162:             * Returns the associated test to the current test execution result
163:             * @return the associated test to the current test execution result
164:             */
165:            public static Test getTestForCurrentTestExecResult() {
166:                Test result;
167:                if (DataModel.getCurrentExecutionTestResult() == null) {
168:                    result = null;
169:                } else {
170:                    result = DataModel.getCurrentExecutionTestResult()
171:                            .getTestFromModel();
172:                }
173:                return result;
174:            }
175:
176:            public static void activateBugTrackingPlgsInToolsMenu(
177:                    JMenu toolsMenu, final BugTracker bTrack) {
178:
179:                JMenu bTrackSubMenu = new JMenu(bTrack.getBugTrackerName());
180:
181:                //Adding the current user in Salomé TMF to bug tracking database
182:                JMenuItem addCurrentUserItem = new JMenuItem(Language
183:                        .getInstance().getText("add_current_usr_to_bug_db"));
184:                addCurrentUserItem.addActionListener(new ActionListener() {
185:                    public void actionPerformed(ActionEvent e) {
186:                        try {
187:                            bTrack.addUser(DataModel.getCurrentUser());
188:                        } catch (Exception E) {
189:                            E.printStackTrace();
190:                        }
191:                    }
192:                });
193:
194:                bTrackSubMenu.add(addCurrentUserItem);
195:
196:                // Adding the current project in Salomé TMF to bug tracking database
197:                JMenuItem addCurrentProjectItem = new JMenuItem(Language
198:                        .getInstance().getText("add_current_prj_to_bug_db"));
199:                addCurrentProjectItem.addActionListener(new ActionListener() {
200:                    public void actionPerformed(ActionEvent e) {
201:                        try {
202:                            bTrack.addProject(DataModel.getCurrentProject());
203:                        } catch (Exception E) {
204:                            E.printStackTrace();
205:                        }
206:                    }
207:                });
208:
209:                //if (!bTrack.isUserExistsInBugDB()) addCurrentProjectItem.setEnabled(false);
210:                bTrackSubMenu.add(addCurrentProjectItem);
211:
212:                toolsMenu.addSeparator();
213:                toolsMenu.add(bTrackSubMenu);
214:
215:            }
216:
217:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.