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


001:        package net.refractions.udig.catalog.internal.ui;
002:
003:        import java.lang.reflect.InvocationTargetException;
004:
005:        import net.refractions.udig.catalog.ui.CatalogUIPlugin;
006:        import net.refractions.udig.catalog.ui.internal.Messages;
007:        import net.refractions.udig.catalog.ui.workflow.Workflow;
008:        import net.refractions.udig.catalog.ui.workflow.WorkflowWizard;
009:
010:        import org.eclipse.core.runtime.IProgressMonitor;
011:        import org.eclipse.jface.dialogs.IPageChangedListener;
012:        import org.eclipse.jface.dialogs.PageChangedEvent;
013:        import org.eclipse.jface.operation.IRunnableWithProgress;
014:        import org.eclipse.jface.viewers.IStructuredSelection;
015:        import org.eclipse.jface.wizard.IWizardPage;
016:        import org.eclipse.jface.wizard.WizardDialog;
017:        import org.eclipse.ui.IImportWizard;
018:        import org.eclipse.ui.IWorkbench;
019:
020:        public class CatalogImportDelegateWizard extends WorkflowWizard
021:                implements  IImportWizard {
022:
023:            //	used to figure out when user presses back
024:            PageListener pageListener;
025:
026:            public CatalogImportDelegateWizard() {
027:                super (new MyCatalogImport().createWorkflow(),
028:                        new MyCatalogImport().createPageMapping());
029:
030:                setWindowTitle(Messages.CatalogImportDelegateWizard_windowTitle);
031:            }
032:
033:            public void init(IWorkbench workbench,
034:                    IStructuredSelection selection) {
035:                getWorkflow().start(null);
036:            }
037:
038:            @Override
039:            public IWizardPage getNextPage(IWizardPage page) {
040:                //create the page listener
041:                if (pageListener == null) {
042:                    pageListener = new PageListener();
043:                    WizardDialog dialog = (WizardDialog) getContainer();
044:                    dialog.addPageChangedListener(pageListener);
045:                }
046:
047:                //move the workflow to the next state
048:                try {
049:                    getContainer().run(true, true, new IRunnableWithProgress() {
050:
051:                        public void run(IProgressMonitor monitor)
052:                                throws InvocationTargetException,
053:                                InterruptedException {
054:
055:                            getWorkflow().next(monitor);
056:                        }
057:
058:                    });
059:                } catch (InvocationTargetException e) {
060:                    CatalogUIPlugin.log(e.getLocalizedMessage(), e);
061:                } catch (InterruptedException e) {
062:                    return null;
063:                }
064:
065:                return super .getNextPage(page);
066:            }
067:
068:            @Override
069:            protected boolean performFinish(IProgressMonitor monitor) {
070:
071:                if (!getWorkflow().isFinished())
072:                    getWorkflow().next(monitor);
073:
074:                CatalogImport.CatalogImportWizard catalogImportWizard = new CatalogImport.CatalogImportWizard(
075:                        getWorkflow(), getStateMap());
076:                catalogImportWizard.setContainer(getContainer());
077:                boolean performFinish = catalogImportWizard.performFinish();
078:
079:                //      TODO Something will need to be done here... 
080:                //      if( !performFinish )
081:                //          getWorkflow().previous(monitor);
082:                return performFinish;
083:            }
084:
085:            @Override
086:            public boolean needsProgressMonitor() {
087:                return true;
088:            }
089:
090:            static class MyCatalogImport extends CatalogImport {
091:                @Override
092:                void init() {
093:                    //do nothing
094:                }
095:            }
096:
097:            class PageListener implements  IPageChangedListener {
098:                public void pageChanged(PageChangedEvent event) {
099:                    if (event.getSelectedPage() == null)
100:                        return;
101:
102:                    //going backward?
103:                    Workflow.State state = getWorkflow().getCurrentState();
104:                    if (state != null && state.getPreviousState() != null) {
105:                        if (event.getSelectedPage().equals(
106:                                getPage(state.getPreviousState()))) {
107:                            //yes, move workflow backward
108:                            try {
109:                                getContainer().run(true, true,
110:                                        new IRunnableWithProgress() {
111:
112:                                            public void run(
113:                                                    IProgressMonitor monitor)
114:                                                    throws InvocationTargetException,
115:                                                    InterruptedException {
116:
117:                                                getWorkflow().previous(monitor);
118:                                            }
119:
120:                                        });
121:                            } catch (InvocationTargetException e) {
122:                                CatalogUIPlugin.log(e.getLocalizedMessage(), e);
123:                            } catch (InterruptedException e) {
124:                            }
125:
126:                            //update buttons
127:                            getContainer().updateButtons();
128:                        }
129:                    }
130:                }
131:            }
132:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.