Source Code Cross Referenced for NewWizardSelectionPage.java in  » IDE-Eclipse » ui-workbench » org » eclipse » ui » internal » dialogs » 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 » IDE Eclipse » ui workbench » org.eclipse.ui.internal.dialogs 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 2006 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         *******************************************************************************/package org.eclipse.ui.internal.dialogs;
011:
012:        import org.eclipse.jface.dialogs.IDialogSettings;
013:        import org.eclipse.jface.viewers.IStructuredSelection;
014:        import org.eclipse.jface.wizard.WizardDialog;
015:        import org.eclipse.swt.widgets.Composite;
016:        import org.eclipse.swt.widgets.Control;
017:        import org.eclipse.ui.IWorkbench;
018:        import org.eclipse.ui.internal.IWorkbenchHelpContextIds;
019:        import org.eclipse.ui.internal.WorkbenchMessages;
020:        import org.eclipse.ui.internal.activities.ws.WorkbenchTriggerPoints;
021:        import org.eclipse.ui.wizards.IWizardCategory;
022:        import org.eclipse.ui.wizards.IWizardDescriptor;
023:
024:        /**
025:         *	New wizard selection tab that allows the user to either select a
026:         *	registered 'New' wizard to be launched, or to select a solution or
027:         *	projects to be retrieved from an available server.  This page
028:         *	contains two visual tabs that allow the user to perform these tasks.
029:         *
030:         *  Temporarily has two inner pages.  The new format page is used if the system 
031:         *  is currently aware of activity categories.
032:         */
033:        class NewWizardSelectionPage extends WorkbenchWizardSelectionPage {
034:            private IWizardCategory wizardCategories;
035:
036:            // widgets
037:            private NewWizardNewPage newResourcePage;
038:
039:            private IWizardDescriptor[] primaryWizards;
040:
041:            private boolean projectsOnly;
042:
043:            private boolean canFinishEarly = false, hasPages = true;
044:
045:            /**
046:             * Create an instance of this class.
047:             *
048:             * @param workbench the workbench
049:             * @param selection the current selection
050:             * @param root the wizard root element
051:             * @param primary the primary wizard elements
052:             * @param projectsOnly if only projects should be shown
053:             */
054:            public NewWizardSelectionPage(IWorkbench workbench,
055:                    IStructuredSelection selection, IWizardCategory root,
056:                    IWizardDescriptor[] primary, boolean projectsOnly) {
057:                super (
058:                        "newWizardSelectionPage", workbench, selection, null, WorkbenchTriggerPoints.NEW_WIZARDS);//$NON-NLS-1$
059:
060:                setTitle(WorkbenchMessages.NewWizardSelectionPage_description);
061:                wizardCategories = root;
062:                primaryWizards = primary;
063:                this .projectsOnly = projectsOnly;
064:            }
065:
066:            /**
067:             * Makes the next page visible.
068:             */
069:            public void advanceToNextPageOrFinish() {
070:                if (canFlipToNextPage()) {
071:                    getContainer().showPage(getNextPage());
072:                } else if (canFinishEarly()) {
073:                    if (getWizard().performFinish()) {
074:                        ((WizardDialog) getContainer()).close();
075:                    }
076:                }
077:            }
078:
079:            /** (non-Javadoc)
080:             * Method declared on IDialogPage.
081:             */
082:            public void createControl(Composite parent) {
083:                IDialogSettings settings = getDialogSettings();
084:                newResourcePage = new NewWizardNewPage(this , wizardCategories,
085:                        primaryWizards, projectsOnly);
086:                newResourcePage.setDialogSettings(settings);
087:
088:                Control control = newResourcePage.createControl(parent);
089:                getWorkbench()
090:                        .getHelpSystem()
091:                        .setHelp(
092:                                control,
093:                                IWorkbenchHelpContextIds.NEW_WIZARD_SELECTION_WIZARD_PAGE);
094:                setControl(control);
095:            }
096:
097:            /**
098:             * Since Finish was pressed, write widget values to the dialog store so that they
099:             *will persist into the next invocation of this wizard page
100:             */
101:            protected void saveWidgetValues() {
102:                newResourcePage.saveWidgetValues();
103:            }
104:
105:            /* (non-Javadoc)
106:             * @see org.eclipse.jface.wizard.IWizardPage#canFlipToNextPage()
107:             */
108:            public boolean canFlipToNextPage() {
109:                // if the current page advertises that it does have pages then ask it via the super call
110:                if (hasPages) {
111:                    return super .canFlipToNextPage();
112:                }
113:                return false;
114:            }
115:
116:            /**
117:             * Sets whether the selected wizard advertises that it does provide pages.
118:             * 
119:             * @param newValue whether the selected wizard has pages
120:             * @since 3.1
121:             */
122:            public void setHasPages(boolean newValue) {
123:                hasPages = newValue;
124:            }
125:
126:            /**
127:             * Sets whether the selected wizard advertises that it can finish early.
128:             * 
129:             * @param newValue whether the selected wizard can finish early
130:             * @since 3.1
131:             */
132:            public void setCanFinishEarly(boolean newValue) {
133:                canFinishEarly = newValue;
134:            }
135:
136:            /**
137:             * Answers whether the currently selected page, if any, advertises that it may finish early.
138:             * 
139:             * @return whether the page can finish early
140:             * @since 3.1
141:             */
142:            public boolean canFinishEarly() {
143:                return canFinishEarly;
144:            }
145:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.