Source Code Cross Referenced for WizardPanelDescriptor.java in  » Database-Client » DBBrowser » com » nexes » 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 » Database Client » DBBrowser » com.nexes.wizard 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.nexes.wizard;
002:
003:        import java.awt.*;
004:        import javax.swing.*;
005:
006:        /**
007:         * A base descriptor class used to reference a Component panel for the Wizard, as
008:         * well as provide general rules as to how the panel should behave.
009:         */
010:        public class WizardPanelDescriptor {
011:
012:            private static final String DEFAULT_PANEL_IDENTIFIER = "defaultPanelIdentifier";
013:
014:            /**
015:             * Identifier returned by getNextPanelDescriptor() to indicate that this is the
016:             * last panel and the text of the 'Next' button should change to 'Finish'.
017:             */
018:            public static final FinishIdentifier FINISH = new FinishIdentifier();
019:
020:            private Wizard wizard;
021:            private Component targetPanel;
022:            private Object panelIdentifier;
023:
024:            /**
025:             * Default constructor. The id and the Component panel must be set separately.
026:             */
027:            public WizardPanelDescriptor() {
028:                panelIdentifier = DEFAULT_PANEL_IDENTIFIER;
029:                targetPanel = new JPanel();
030:            }
031:
032:            /**
033:             * Constructor which accepts both the Object-based identifier and a reference to
034:             * the Component class which makes up the panel.
035:             * @param id Object-based identifier
036:             * @param panel A class which extends java.awt.Component that will be inserted as a
037:             * panel into the wizard dialog.
038:             */
039:            public WizardPanelDescriptor(Object id, Component panel) {
040:                panelIdentifier = id;
041:                targetPanel = panel;
042:            }
043:
044:            /**
045:             * Returns to java.awt.Component that serves as the actual panel.
046:             * @return A reference to the java.awt.Component that serves as the panel
047:             */
048:            public final Component getPanelComponent() {
049:                return targetPanel;
050:            }
051:
052:            /**
053:             * Sets the panel's component as a class that extends java.awt.Component
054:             * @param panel java.awt.Component which serves as the wizard panel
055:             */
056:            public final void setPanelComponent(Component panel) {
057:                targetPanel = panel;
058:            }
059:
060:            /**
061:             * Returns the unique Object-based identifier for this panel descriptor.
062:             * @return The Object-based identifier
063:             */
064:            public final Object getPanelDescriptorIdentifier() {
065:                return panelIdentifier;
066:            }
067:
068:            /**
069:             * Sets the Object-based identifier for this panel. The identifier must be unique
070:             * from all the other identifiers in the panel.
071:             * @param id Object-based identifier for this panel.
072:             */
073:            public final void setPanelDescriptorIdentifier(Object id) {
074:                panelIdentifier = id;
075:            }
076:
077:            final void setWizard(Wizard w) {
078:                wizard = w;
079:            }
080:
081:            /**
082:             * Returns a reference to the Wizard component.
083:             * @return The Wizard class hosting this descriptor.
084:             */
085:            public final Wizard getWizard() {
086:                return wizard;
087:            }
088:
089:            /**
090:             * Returns a reference to the current WizardModel for this Wizard component.
091:             * @return The current WizardModel for this Wizard component.
092:             */
093:            public WizardModel getWizardModel() {
094:                return wizard.getModel();
095:            }
096:
097:            //  Override this method to provide an Object-based identifier
098:            //  for the next panel.
099:
100:            /**
101:             * Override this class to provide the Object-based identifier of the panel that the
102:             * user should traverse to when the Next button is pressed. Note that this method
103:             * is only called when the button is actually pressed, so that the panel can change
104:             * the next panel's identifier dynamically at runtime if necessary. Return null if
105:             * the button should be disabled. Return FinishIdentfier if the button text
106:             * should change to 'Finish' and the dialog should end.
107:             * @return Object-based identifier.
108:             */
109:            public Object getNextPanelDescriptor() {
110:                return null;
111:            }
112:
113:            //  Override this method to provide an Object-based identifier
114:            //  for the previous panel.
115:
116:            /**
117:             * Override this class to provide the Object-based identifier of the panel that the
118:             * user should traverse to when the Back button is pressed. Note that this method
119:             * is only called when the button is actually pressed, so that the panel can change
120:             * the previous panel's identifier dynamically at runtime if necessary. Return null if
121:             * the button should be disabled.
122:             * @return Object-based identifier
123:             */
124:            public Object getBackPanelDescriptor() {
125:                return null;
126:            }
127:
128:            //  Override this method in the subclass if you wish it to be called
129:            //  just before the panel is displayed.
130:
131:            /**
132:             * Override this method to provide functionality that will be performed just before
133:             * the panel is to be displayed.
134:             */
135:            public void aboutToDisplayPanel() {
136:
137:            }
138:
139:            //  Override this method in the subclass if you wish to do something
140:            //  while the panel is displaying.
141:
142:            /**
143:             * Override this method to perform functionality when the panel itself is displayed.
144:             */
145:            public void displayingPanel() {
146:
147:            }
148:
149:            //  Override this method in the subclass if you wish it to be called
150:            //  just before the panel is switched to another or finished.
151:
152:            /**
153:             * Override this method to perform functionality just before the panel is to be
154:             * hidden.
155:             */
156:            public void aboutToHidePanel() {
157:
158:            }
159:
160:            static class FinishIdentifier {
161:                public static final String ID = "FINISH";
162:            }
163:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.