Source Code Cross Referenced for RenameImplementationInputPage.java in  » Workflow-Engines » osbl-1_0 » gui » wizards » 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 » Workflow Engines » osbl 1_0 » gui.wizards 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * 
003:         */package gui.wizards;
004:
005:        import org.eclipse.core.runtime.IStatus;
006:        import org.eclipse.jdt.core.JavaConventions;
007:        import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
008:        import org.eclipse.jface.dialogs.Dialog;
009:        import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
010:        import org.eclipse.swt.SWT;
011:        import org.eclipse.swt.events.KeyAdapter;
012:        import org.eclipse.swt.events.KeyEvent;
013:        import org.eclipse.swt.layout.GridData;
014:        import org.eclipse.swt.layout.GridLayout;
015:        import org.eclipse.swt.widgets.Composite;
016:        import org.eclipse.swt.widgets.Label;
017:        import org.eclipse.swt.widgets.Text;
018:
019:        import core.ModelInfo;
020:
021:        /** <p>the input page for the Rename Type refactoring, where users can
022:         * control the effects of the refactoring; to be shown in the wizard.</p>
023:         *
024:         * <p>We let the user enter the new name for the property, and we let her 
025:         * decide whether other property files in the bundle should be affected, and
026:         * whether the operation is supposed to span the entire workspace or only 
027:         * the current project.</p>
028:         * 
029:         * @author sh
030:         */
031:        public class RenameImplementationInputPage extends UserInputWizardPage {
032:
033:            private static final String DS_KEY = RenameImplementationInputPage.class
034:                    .getName();
035:
036:            private final ModelInfo info;
037:
038:            private Text txtImplementation;
039:
040:            public RenameImplementationInputPage(final ModelInfo info) {
041:                super (RenameTypeInputPage.class.getName());
042:                this .info = info;
043:            }
044:
045:            /**
046:             * interface methods of UserInputWizardPage
047:             */
048:            public void createControl(final Composite parent) {
049:                Composite composite = createRootComposite(parent);
050:                setControl(composite);
051:
052:                createLblImplementation(composite);
053:                createTxtVarName(composite);
054:
055:                validate();
056:            }
057:
058:            /**
059:             * UI creation method
060:             */
061:            private Composite createRootComposite(final Composite parent) {
062:                Composite result = new Composite(parent, SWT.NONE);
063:                GridLayout gridLayout = new GridLayout(2, false);
064:                gridLayout.marginWidth = 10;
065:                gridLayout.marginHeight = 10;
066:                result.setLayout(gridLayout);
067:                initializeDialogUnits(result);
068:                Dialog.applyDialogFont(result);
069:                return result;
070:            }
071:
072:            /**
073:             * UI creation method
074:             */
075:            private void createLblImplementation(final Composite composite) {
076:                Label lblNewName = new Label(composite, SWT.NONE);
077:                lblNewName.setText("Implementation");
078:            }
079:
080:            /**
081:             * UI creation method
082:             */
083:            private void createTxtVarName(Composite composite) {
084:                txtImplementation = new Text(composite, SWT.BORDER);
085:                txtImplementation.setText(info.getOldImplementation());
086:                txtImplementation.setLayoutData(new GridData(
087:                        GridData.FILL_HORIZONTAL));
088:                txtImplementation.selectAll();
089:                txtImplementation.addKeyListener(new KeyAdapter() {
090:                    public void keyReleased(final KeyEvent e) {
091:                        info.setNewImplementation(txtImplementation.getText());
092:                        validate();
093:                    }
094:                });
095:            }
096:
097:            /**
098:             * helper method
099:             */
100:            private void validate() {
101:                String implementationTxt = txtImplementation.getText();
102:                IStatus status = JavaConventions.validatePackageName(
103:                        implementationTxt, CompilerOptions.VERSION_1_3,
104:                        CompilerOptions.VERSION_1_3);
105:
106:                if (status.isOK()) {
107:                    setPageComplete(true);
108:                    setMessage(null);
109:                } else if (status.ERROR == IStatus.ERROR) {
110:                    setPageComplete(false);
111:                    setMessage(status.getMessage());
112:                }
113:            }
114:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.