Source Code Cross Referenced for CronExecPlugin.java in  » Test-Coverage » salome-tmf » salomeTMF_plug » cronExec » 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 » salomeTMF_plug.cronExec 
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 salomeTMF_plug.cronExec;
025:
026:        import java.awt.event.ActionEvent;
027:        import java.awt.event.ActionListener;
028:        import java.util.Vector;
029:
030:        import javax.swing.JButton;
031:        import javax.swing.JOptionPane;
032:        import javax.swing.JPanel;
033:
034:        import org.java.plugin.ExtensionPoint;
035:        import org.java.plugin.Plugin;
036:        import org.java.plugin.PluginDescriptor;
037:        import org.java.plugin.PluginManager;
038:        import org.objectweb.salome_tmf.api.Util;
039:        import org.objectweb.salome_tmf.ihm.main.SalomeTMFContext;
040:        import org.objectweb.salome_tmf.plugins.UICompCst;
041:        import org.objectweb.salome_tmf.plugins.core.Common;
042:
043:        import salomeTMF_plug.cronExec.languages.Language;
044:
045:        /**
046:         *
047:         * @author  marchemi
048:         */
049:        public class CronExecPlugin extends Plugin implements  Common {
050:
051:            boolean alreadyCron = false;
052:
053:            CronTimer timer = null;
054:
055:            JButton cronButton = null;
056:
057:            /** Creates a new instance of cronExecPlugin */
058:            public CronExecPlugin(PluginManager manager, PluginDescriptor descr) {
059:                super (manager, descr);
060:            }
061:
062:            /********************* extends Plugin**********************************/
063:
064:            /**
065:             * @see org.java.plugin.Plugin()
066:             */
067:            protected void doStart() throws Exception {
068:                Util.log("[cronExecPlugin:doStart] chargement du plugin");
069:            }
070:
071:            /**
072:             * @see org.java.plugin.Plugin()
073:             */
074:            protected void doStop() throws Exception {
075:                // no-op
076:            }
077:
078:            //********************* interface common ********************//
079:
080:            public void activatePluginInCampToolsMenu(javax.swing.JMenu jMenu) {
081:            }
082:
083:            public void activatePluginInDataToolsMenu(javax.swing.JMenu jMenu) {
084:            }
085:
086:            public void activatePluginInDynamicComponent(Integer integer) {
087:            }
088:
089:            public void activatePluginInStaticComponent(Integer integer) {
090:
091:                JPanel cronExecPanel = (JPanel) SalomeTMFContext.getInstance()
092:                        .getUIComponent(integer);
093:
094:                cronButton = new JButton("");
095:                cronButton.setToolTipText(Language.getInstance().getText(
096:                        "Cron_exécutions"));
097:                cronButton
098:                        .setIcon(new javax.swing.ImageIcon(
099:                                getClass()
100:                                        .getResource(
101:                                                "/salomeTMF_plug/cronExec/resources/cron_off.gif")));
102:
103:                cronButton.addActionListener(new ActionListener() {
104:                    public void actionPerformed(ActionEvent e) {
105:                        if (alreadyCron) {
106:                            Object[] options = {
107:                                    Language.getInstance().getText("Oui"),
108:                                    Language.getInstance().getText("Non") };
109:                            int choice = JOptionPane
110:                                    .showOptionDialog(
111:                                            SalomeTMFContext.getInstance()
112:                                                    .getSalomeFrame(),
113:                                            Language
114:                                                    .getInstance()
115:                                                    .getText(
116:                                                            "Des_exécutions_sont_déjà_programmées_pour_être_lancées!\n")
117:                                                    + Language
118:                                                            .getInstance()
119:                                                            .getText(
120:                                                                    "Voulez-vous_annuler_ces_exécutions_et_recommencer?"),
121:                                            Language.getInstance().getText(
122:                                                    "Attention_!"),
123:                                            JOptionPane.YES_NO_OPTION,
124:                                            JOptionPane.WARNING_MESSAGE, null,
125:                                            options, options[1]);
126:                            if (choice == JOptionPane.YES_OPTION) {
127:                                if (timer != null) {
128:                                    timer.cancel();
129:                                    timer = new CronTimer(CronExecPlugin.this );
130:                                } else {
131:                                    timer = new CronTimer(CronExecPlugin.this );
132:                                }
133:                                new ExecChooser(CronExecPlugin.this , timer);
134:                            }
135:                        } else {
136:                            if (timer != null) {
137:                                timer.cancel();
138:                                timer = new CronTimer(CronExecPlugin.this );
139:                            } else {
140:                                timer = new CronTimer(CronExecPlugin.this );
141:                            }
142:                            new ExecChooser(CronExecPlugin.this , timer);
143:                        }
144:                    }
145:                });
146:
147:                cronExecPanel.add(cronButton);
148:            }
149:
150:            public void activatePluginInTestToolsMenu(javax.swing.JMenu jMenu) {
151:            }
152:
153:            public void freeze() {
154:            }
155:
156:            public java.util.Vector getUsedUIComponents() {
157:                Vector uiComponentsUsed = new Vector();
158:
159:                uiComponentsUsed.add(0, UICompCst.CAMP_FIRST_BUTTONS_PANEL);
160:
161:                return uiComponentsUsed;
162:            }
163:
164:            public void init(Object pIhm) {
165:            }
166:
167:            public boolean isActivableInCampToolsMenu() {
168:                return false;
169:            }
170:
171:            public boolean isActivableInDataToolsMenu() {
172:                return false;
173:            }
174:
175:            public boolean isActivableInTestToolsMenu() {
176:                return false;
177:            }
178:
179:            public boolean isFreezable() {
180:                return false;
181:            }
182:
183:            public boolean isFreezed() {
184:                return false;
185:            }
186:
187:            public void unFreeze() {
188:            }
189:
190:            public boolean usesOtherUIComponents() {
191:                return true;
192:            }
193:
194:            public void allPluginActived(ExtensionPoint commonExtensions,
195:                    ExtensionPoint testDriverExtensions,
196:                    ExtensionPoint scriptEngineExtensions,
197:                    ExtensionPoint bugTrackerExtensions) {
198:
199:            }
200:
201:            /**
202:             * @param alreadyCron The alreadyCron to set.
203:             */
204:            public void setAlreadyCron(boolean alreadyCron) {
205:                this .alreadyCron = alreadyCron;
206:            }
207:
208:            /**
209:             * @return Returns the cronButton.
210:             */
211:            public JButton getCronButton() {
212:                return cronButton;
213:            }
214:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.