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