Source Code Cross Referenced for AskNewTestList.java in  » Test-Coverage » salome-tmf » org » objectweb » salome_tmf » ihm » 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 
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;
025:
026:        import java.awt.BorderLayout;
027:        import java.awt.Color;
028:        import java.awt.Container;
029:        import java.awt.Dimension;
030:        import java.awt.event.ActionEvent;
031:        import java.awt.event.ActionListener;
032:        import java.awt.event.WindowEvent;
033:        import java.awt.event.WindowListener;
034:
035:        import javax.swing.BorderFactory;
036:        import javax.swing.Box;
037:        import javax.swing.BoxLayout;
038:        import javax.swing.JButton;
039:        import javax.swing.JDialog;
040:        import javax.swing.JLabel;
041:        import javax.swing.JOptionPane;
042:        import javax.swing.JPanel;
043:        import javax.swing.JScrollPane;
044:        import javax.swing.JTextArea;
045:        import javax.swing.JTextField;
046:
047:        import org.objectweb.salome_tmf.data.TestList;
048:        import org.objectweb.salome_tmf.ihm.languages.Language;
049:
050:        /**
051:         * Classe qui permet d'afficher une fenêtre demandant d'entrer les
052:         * informations pour les suites de tests
053:         * @author teaml039
054:         * @version 0.1
055:         */
056:        public class AskNewTestList extends JDialog {
057:
058:            /**
059:             * La nouvelle suite de tests
060:             */
061:            private TestList testList;
062:
063:            /**
064:             * Le Field permettant de récupérer la chaîne
065:             */
066:            private JTextField testListNameField;
067:
068:            /**
069:             * La zone de texte permettant de récupérer la description
070:             */
071:            private JTextArea descriptionArea;
072:
073:            /**
074:             * Nom de la famille
075:             */
076:            //private String familyName;
077:            /******************************************************************************/
078:            /** 							CONSTRUCTEUR								***/
079:            /******************************************************************************/
080:
081:            /**
082:             * Constructeur de la fenêtre.
083:             * @param title le titre de la fenêtre
084:             * @param textToBePrompt chaîne correspondant à la demande.
085:             */
086:            public AskNewTestList(String title, String textToBePrompt) {
087:
088:                super (SalomeTMF.ptrFrame, true);
089:                testListNameField = new JTextField(10);
090:                //familyName = "";
091:                descriptionArea = new JTextArea(10, 20);
092:                JPanel page = new JPanel();
093:
094:                JLabel prompt = new JLabel(textToBePrompt);
095:
096:                JPanel giveName = new JPanel();
097:
098:                giveName.setLayout(new BoxLayout(giveName, BoxLayout.X_AXIS));
099:                giveName.setBorder(BorderFactory.createEmptyBorder(0, 10, 10,
100:                        10));
101:                giveName.add(Box.createHorizontalGlue());
102:                giveName.add(prompt);
103:                giveName.add(Box.createRigidArea(new Dimension(10, 0)));
104:                giveName.add(testListNameField);
105:
106:                //descriptionArea.setPreferredSize(new Dimension(100,150));
107:                JScrollPane descriptionScrollPane = new JScrollPane(
108:                        descriptionArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
109:                        JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
110:                descriptionScrollPane.setBorder(BorderFactory
111:                        .createTitledBorder(BorderFactory
112:                                .createLineBorder(Color.BLACK), Language
113:                                .getInstance().getText("Description")));
114:
115:                JPanel textPanel = new JPanel();
116:                textPanel.setLayout(new BoxLayout(textPanel, BoxLayout.Y_AXIS));
117:                textPanel.add(Box.createRigidArea(new Dimension(0, 10)));
118:                textPanel.add(giveName);
119:                textPanel.add(Box.createRigidArea(new Dimension(0, 10)));
120:                textPanel.add(descriptionScrollPane);
121:
122:                JButton okButton = new JButton(Language.getInstance().getText(
123:                        "Valider"));
124:                okButton.setToolTipText(Language.getInstance().getText(
125:                        "Valider"));
126:                okButton.addActionListener(new ActionListener() {
127:                    public void actionPerformed(ActionEvent e) {
128:                        if (testListNameField.getText() != null
129:                                && (!testListNameField.getText().trim().equals(
130:                                        ""))) {
131:                            testList = new TestList();
132:                            testList
133:                                    .setName(testListNameField.getText().trim());
134:                            testList.setDescription(descriptionArea.getText());
135:
136:                            AskNewTestList.this .dispose();
137:                        } else {
138:                            testListNameField.selectAll();
139:                            JOptionPane.showMessageDialog(AskNewTestList.this ,
140:                                    Language.getInstance().getText(
141:                                            "Vous_devez_entrez_un_nom."),
142:                                    Language.getInstance().getText("Erreur_!"),
143:                                    JOptionPane.ERROR_MESSAGE);
144:                            testListNameField.requestFocusInWindow();
145:                        }
146:                    }
147:                });
148:
149:                testListNameField.addActionListener(new ActionListener() {
150:                    public void actionPerformed(ActionEvent e) {
151:
152:                    }
153:                });
154:                JButton cancelButton = new JButton(Language.getInstance()
155:                        .getText("Annuler"));
156:                cancelButton.setToolTipText(Language.getInstance().getText(
157:                        "Annuler"));
158:                cancelButton.addActionListener(new ActionListener() {
159:                    public void actionPerformed(ActionEvent e) {
160:                        testList = null;
161:                        AskNewTestList.this .dispose();
162:                    }
163:                });
164:
165:                JPanel buttonPanel = new JPanel();
166:                buttonPanel.setLayout(new BorderLayout());
167:                buttonPanel.add(okButton, BorderLayout.NORTH);
168:                buttonPanel.add(cancelButton, BorderLayout.SOUTH);
169:
170:                page.add(textPanel, BorderLayout.WEST);
171:                page.add(Box.createRigidArea(new Dimension(40, 10)),
172:                        BorderLayout.CENTER);
173:                page.add(buttonPanel, BorderLayout.EAST);
174:
175:                Container contentPaneFrame = this .getContentPane();
176:                contentPaneFrame.add(page, BorderLayout.CENTER);
177:
178:                this .addWindowListener(new WindowListener() {
179:                    public void windowClosing(WindowEvent e) {
180:                        testList = null;
181:                    }
182:
183:                    public void windowDeiconified(WindowEvent e) {
184:                    }
185:
186:                    public void windowOpened(WindowEvent e) {
187:                    }
188:
189:                    public void windowActivated(WindowEvent e) {
190:                    }
191:
192:                    public void windowDeactivated(WindowEvent e) {
193:                    }
194:
195:                    public void windowClosed(WindowEvent e) {
196:                    }
197:
198:                    public void windowIconified(WindowEvent e) {
199:                    }
200:                });
201:
202:                this .setTitle(title);
203:                this .pack();
204:                this .setLocation(400, 300);
205:                this .setVisible(true);
206:            } // Fin du constructeur AskNewTestList/2
207:
208:            /******************************************************************************/
209:            /** 							METHODES PUBLIQUES							***/
210:            /******************************************************************************/
211:
212:            /**
213:             * Récupère la nouvelle suite de tests
214:             * @return la nouvelle suite de tests
215:             */
216:            public TestList getTestList() {
217:                return testList;
218:            } // Fin de la méthode getTestList/0
219:
220:        } // Fin de la classe AskNewTestList
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.