Source Code Cross Referenced for NewProjectWizard.java in  » GIS » udig-1.1 » net » refractions » udig » project » ui » internal » wizard » 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 » GIS » udig 1.1 » net.refractions.udig.project.ui.internal.wizard 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * uDig - User Friendly Desktop Internet GIS client http://udig.refractions.net (C) 2004, Refractions Research Inc. This
003:         * library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
004:         * License as published by the Free Software Foundation; version 2.1 of the License. This library is distributed in the
005:         * hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
006:         * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
007:         */
008:        package net.refractions.udig.project.ui.internal.wizard;
009:
010:        import java.io.IOException;
011:        import java.util.Collections;
012:
013:        import net.refractions.udig.project.internal.Project;
014:        import net.refractions.udig.project.internal.ProjectPlugin;
015:        import net.refractions.udig.project.ui.internal.ProjectUIPlugin;
016:
017:        import org.eclipse.emf.ecore.resource.Resource;
018:        import org.eclipse.jface.viewers.IStructuredSelection;
019:        import org.eclipse.jface.wizard.Wizard;
020:        import org.eclipse.ui.INewWizard;
021:        import org.eclipse.ui.IWorkbench;
022:
023:        /**
024:         * Wizard to create a new project.
025:         * 
026:         * @author jgarnett
027:         * @author vitalus
028:         * 
029:         * @since 0.3
030:         * 
031:         * @version 1.1.0
032:         */
033:        public class NewProjectWizard extends Wizard implements  INewWizard {
034:
035:            /** 
036:             * Wizard page used to fill parameters of new project 
037:             */
038:            protected NewProjectWizardPage page;
039:
040:            /**
041:             * Override to make title reflect current page.
042:             * 
043:             * @param page The page to set.
044:             */
045:            public void setPage(NewProjectWizardPage page) {
046:                this .page = page;
047:                setWindowTitle(page.getTitle());
048:            }
049:
050:            /**
051:             * The <code>Wizard</code> implementation of this <code>IWizard</code> method does nothing.
052:             * Subclasses should extend if extra pages need to be added before the wizard opens. New pages
053:             * should be added by calling <code>addPage</code>.
054:             */
055:            public void addPages() {
056:                page = new NewProjectWizardPage();
057:                addPage(page);
058:                setWindowTitle(page.getTitle());
059:                setHelpAvailable(true);
060:            }
061:
062:            /**
063:             * Completes the wizard if new project parameters are valid.
064:             * <p>
065:             * 
066:             * @see org.eclipse.jface.wizard.IWizard#performFinish()
067:             * @return <code>true</code> when project successfully created
068:             */
069:            public boolean performFinish() {
070:                if (!page.validate())
071:                    return false;
072:
073:                final String projectPath = page.getProjectPath();
074:                final String projectName = page.getProjectName();
075:
076:                Project project = ProjectPlugin.getPlugin()
077:                        .getProjectRegistry().getProject(projectPath);
078:                project.setName(projectName);
079:                Resource projectResource = project.eResource();
080:                try {
081:                    projectResource.save(Collections.EMPTY_MAP);
082:                } catch (IOException e) {
083:                    ProjectUIPlugin
084:                            .log(
085:                                    "Error during saving the project file of an anew created project", e); //$NON-NLS-1$
086:                }
087:
088:                return true;
089:            }
090:
091:            /**
092:             * We can finish if the user has entered a file.
093:             * 
094:             * @return true if we can finish
095:             */
096:            public boolean canFinish() {
097:                return page.isPageComplete();
098:            }
099:
100:            /**
101:             * Hook us up to the world .. I mean workbench.
102:             * <p>
103:             * This is where all the magic is supposed to happen to remember the previous directory and so
104:             * on.
105:             * </p>
106:             * <p>
107:             * </p>
108:             * 
109:             * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
110:             *      org.eclipse.jface.viewers.IStructuredSelection)
111:             * @param workbench
112:             * @param selection
113:             */
114:            public void init(IWorkbench workbench,
115:                    IStructuredSelection selection) {
116:                // TODO: Magic to remember previous directory
117:            }
118:
119:        }
w___ww._j___av__a__2s.__co__m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.