Source Code Cross Referenced for UsingParameterMouseListener.java in  » Test-Coverage » salome-tmf » org » objectweb » salome_tmf » ihm » models » 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.models 
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 Mikael MARCHE, Fayçal SOUGRATI, Vincent PAUTRET
020:         *
021:         * Contact: mikael.marche@rd.francetelecom.com
022:         */
023:
024:        package org.objectweb.salome_tmf.ihm.models;
025:
026:        import java.awt.Component;
027:        import java.awt.event.MouseAdapter;
028:        import java.awt.event.MouseEvent;
029:        import java.util.ArrayList;
030:
031:        import javax.swing.JOptionPane;
032:        import javax.swing.JTable;
033:
034:        import org.objectweb.salome_tmf.data.Parameter;
035:        import org.objectweb.salome_tmf.ihm.admin.AskName;
036:        import org.objectweb.salome_tmf.ihm.languages.Language;
037:        import org.objectweb.salome_tmf.ihm.main.AskNewParameter;
038:        import org.objectweb.salome_tmf.ihm.main.SalomeTMFContext;
039:        import org.objectweb.salome_tmf.ihm.main.datawrapper.DataModel;
040:        import org.objectweb.salome_tmf.ihm.tools.Tools;
041:
042:        /**
043:         * @author teaml039
044:         * @version : 0.1
045:         */
046:        public class UsingParameterMouseListener extends MouseAdapter {
047:
048:            boolean mustGiveValue;
049:
050:            boolean singleSelection;
051:
052:            public UsingParameterMouseListener(boolean withValue, boolean single) {
053:                super ();
054:                mustGiveValue = withValue;
055:                singleSelection = single;
056:            }
057:
058:            /**
059:             * Appel?e si on appuie sur un bouton de la souris
060:             * @param e un ?v?nement venant de la souris
061:             */
062:            public void mousePressed(MouseEvent e) {
063:                if (e.getClickCount() > 1) {
064:                    Object source = e.getSource();
065:                    try {
066:                        Component component = e.getComponent().getParent()
067:                                .getParent().getParent().getParent()
068:                                .getParent().getParent();
069:                        if (component != null
070:                                && component instanceof  AskNewParameter) {
071:                            if (source instanceof  JTable) {
072:                                int selectedRow = ((JTable) source)
073:                                        .getSelectedRow();
074:                                if (selectedRow != -1) {
075:                                    Parameter param = DataModel
076:                                            .getCurrentProject()
077:                                            .getParameterFromModel(
078:                                                    (String) ((JTable) source)
079:                                                            .getModel()
080:                                                            .getValueAt(
081:                                                                    selectedRow,
082:                                                                    0));
083:                                    if (((AskNewParameter) component)
084:                                            .getEnvironment() != null) {
085:                                        AskName askName = new AskName(
086:                                                Language.getInstance().getText(
087:                                                        "Entrez_une_valeur_:_"),
088:                                                Language.getInstance().getText(
089:                                                        "Nouvelle_valeur"),
090:                                                Language.getInstance().getText(
091:                                                        "valeur"), null,
092:                                                SalomeTMFContext.getInstance()
093:                                                        .getSalomeFrame());
094:                                        if (askName.getResult() != null) {
095:                                            if (param != null
096:                                                    && !((AskNewParameter) component)
097:                                                            .getEnvironment()
098:                                                            .containsParameterInModel(
099:                                                                    param)) {
100:                                                ArrayList data = new ArrayList();
101:                                                data.add(param
102:                                                        .getNameFromModel());
103:                                                data.add(askName.getResult());
104:                                                data
105:                                                        .add(param
106:                                                                .getDescriptionFromModel());
107:                                                DataModel
108:                                                        .getEnvironmentParameterTableModel()
109:                                                        .addRow(data);
110:                                                ((AskNewParameter) component)
111:                                                        .getEnvironment()
112:                                                        .addParameterValueInModel(
113:                                                                param,
114:                                                                askName
115:                                                                        .getResult());
116:                                                ((AskNewParameter) component)
117:                                                        .dispose();
118:                                            } else {
119:                                                JOptionPane
120:                                                        .showMessageDialog(
121:                                                                component,
122:                                                                Language
123:                                                                        .getInstance()
124:                                                                        .getText(
125:                                                                                "Le_paramètre_")
126:                                                                        + param
127:                                                                                .getNameFromModel()
128:                                                                        + Language
129:                                                                                .getInstance()
130:                                                                                .getText(
131:                                                                                        "_existe_déjà_pour_cet_environnement_!"),
132:                                                                Language
133:                                                                        .getInstance()
134:                                                                        .getText(
135:                                                                                "Erreur_!"),
136:                                                                JOptionPane.ERROR_MESSAGE);
137:                                            }
138:                                        }
139:                                    } else {
140:
141:                                        if (param != null
142:                                                && !DataModel
143:                                                        .getCurrentTest()
144:                                                        .getParameterListFromModel()
145:                                                        .contains(param)) {
146:                                            try {
147:                                                DataModel
148:                                                        .getCurrentTest()
149:                                                        .setUseParamInDBAndModel(
150:                                                                param);
151:
152:                                                //DataModel.getCurrentTest().addParameter(param);
153:                                                ArrayList data = new ArrayList();
154:                                                data.add(param
155:                                                        .getNameFromModel());
156:                                                data
157:                                                        .add(param
158:                                                                .getDescriptionFromModel());
159:                                                DataModel
160:                                                        .getTestParameterTableModel()
161:                                                        .addRow(data);
162:                                                ((AskNewParameter) component)
163:                                                        .dispose();
164:
165:                                            } catch (Exception exception) {
166:                                                Tools
167:                                                        .ihmExceptionView(exception);
168:                                            }
169:                                        } else {
170:                                            JOptionPane
171:                                                    .showMessageDialog(
172:                                                            component,
173:                                                            Language
174:                                                                    .getInstance()
175:                                                                    .getText(
176:                                                                            "Le_paramètre_")
177:                                                                    + param
178:                                                                            .getNameFromModel()
179:                                                                    + Language
180:                                                                            .getInstance()
181:                                                                            .getText(
182:                                                                                    "_existe_déjà_pour_ce_test_!"),
183:                                                            Language
184:                                                                    .getInstance()
185:                                                                    .getText(
186:                                                                            "Erreur_!"),
187:                                                            JOptionPane.ERROR_MESSAGE);
188:                                        }
189:                                    }
190:
191:                                }
192:                            }
193:
194:                        }
195:                    } catch (NullPointerException npe) {
196:                    }
197:                }
198:            } // Fin de la m?thode mousePressed/1
199:
200:        } // Fin de la classe ExecutionResultMouseListener
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.