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


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 2005 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.jdt.internal.ui.macbundler;
011:
012:        import org.eclipse.swt.SWT;
013:        import org.eclipse.swt.events.*;
014:        import org.eclipse.swt.graphics.Image;
015:        import org.eclipse.swt.layout.*;
016:        import org.eclipse.swt.widgets.*;
017:
018:        import org.eclipse.jface.dialogs.DialogPage;
019:        import org.eclipse.jface.util.IPropertyChangeListener;
020:        import org.eclipse.jface.wizard.*;
021:
022:        public abstract class BundleWizardBasePage extends DialogPage implements 
023:                IWizardPage, BundleAttributes, IPropertyChangeListener {
024:
025:            /**
026:             * The page that was shown right before this page became visible;
027:             * <code>null</code> if none.
028:             */
029:            private IWizardPage fPreviousPage;
030:            /**
031:             * This page's message key.
032:             */
033:            private String fKey;
034:            /**
035:             * The wizard to which this page belongs; <code>null</code>
036:             * if this page has yet to be added to a wizard.
037:             */
038:            private IWizard fWizard;
039:
040:            BundleDescription fBundleDescription;
041:
042:            BundleWizardBasePage(String key, BundleDescription bd) {
043:                super (Util.getString(key + ".title")); //$NON-NLS-1$
044:                fKey = key;
045:                fBundleDescription = bd;
046:                //setMessage(Util.getString(fKey + ".message")); //$NON-NLS-1$
047:                setDescription(Util.getString(fKey + ".description")); //$NON-NLS-1$
048:
049:                bd.addListener(this );
050:            }
051:
052:            /* (non-Javadoc)
053:             * Method declared in WizardPage
054:             */
055:            public void setVisible(boolean visible) {
056:                if (visible)
057:                    enterPage();
058:                else
059:                    leavePage();
060:                super .setVisible(visible);
061:            }
062:
063:            void enterPage() {
064:                //System.out.println("enterPage: " + getName());
065:            }
066:
067:            void leavePage() {
068:                //System.out.println("leavePage: " + getName());
069:            }
070:
071:            public Image getImage() {
072:                Image result = super .getImage();
073:
074:                if (result == null && fWizard != null)
075:                    return fWizard.getDefaultPageImage();
076:
077:                return result;
078:            }
079:
080:            /* (non-Javadoc)
081:             * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
082:             */
083:            final public void createControl(Composite parent) {
084:
085:                Composite c = new Composite(parent, SWT.NULL);
086:                c.setLayout(new GridLayout(1, false));
087:                setControl(c);
088:
089:                createContents(c);
090:
091:                checkIfPageComplete();
092:            }
093:
094:            abstract public void createContents(Composite parent);
095:
096:            static void setHeightHint(Control control, int height) {
097:                GridData gd1 = new GridData(GridData.FILL_HORIZONTAL
098:                        | GridData.VERTICAL_ALIGN_BEGINNING);
099:                gd1.heightHint = height;
100:                control.setLayoutData(gd1);
101:            }
102:
103:            static Label createLabel(Composite parent, String text, int align) {
104:                Label l = new Label(parent, SWT.NONE);
105:                l.setText(text);
106:                l.setLayoutData(new GridData(align));
107:                return l;
108:            }
109:
110:            static Composite createComposite(Composite parent, int columns) {
111:                Composite c = new Composite(parent, SWT.NONE);
112:                c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
113:                GridLayout gl = new GridLayout(columns, false);
114:                gl.marginWidth = 0;
115:                c.setLayout(gl);
116:                return c;
117:            }
118:
119:            Text createText(Composite parent, String key, int lines) {
120:                Text t = new Text(parent, SWT.BORDER);
121:                GridData gd = new GridData(GridData.FILL_HORIZONTAL);
122:                if (lines == 2)
123:                    gd.heightHint = 30;
124:                t.setLayoutData(gd);
125:                hookField(t, key);
126:                return t;
127:            }
128:
129:            Combo createCombo(Composite parent, String key) {
130:                Combo c = new Combo(parent, SWT.BORDER);
131:                c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
132:                hookField(c, key);
133:                return c;
134:            }
135:
136:            static Group createGroup(Composite parent, String text, int columns) {
137:                Group g = new Group(parent, SWT.NONE);
138:                g.setText(text);
139:                g.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
140:                g.setLayout(new GridLayout(columns, false));
141:                return g;
142:            }
143:
144:            Button createButton(Composite parent, int flags, String text) {
145:                Button b = new Button(parent, flags);
146:                if (text != null)
147:                    b.setText(text);
148:                return b;
149:            }
150:
151:            static Composite createHBox(Composite parent) {
152:                Composite c = new Composite(parent, SWT.NONE);
153:                c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
154:                GridLayout gl = new GridLayout(2, false);
155:                gl.marginWidth = gl.marginHeight = 0;
156:                c.setLayout(gl);
157:                return c;
158:            }
159:
160:            void hookField(final Text tf, final String key) {
161:                tf.addModifyListener(new ModifyListener() {
162:                    public void modifyText(ModifyEvent e) {
163:                        fBundleDescription.setValue(key, tf.getText());
164:                        checkIfPageComplete();
165:                    }
166:                });
167:            }
168:
169:            void hookField(final Combo tf, final String key) {
170:                tf.addModifyListener(new ModifyListener() {
171:                    public void modifyText(ModifyEvent e) {
172:                        fBundleDescription.setValue(key, tf.getText());
173:                        checkIfPageComplete();
174:                    }
175:                });
176:            }
177:
178:            void hookButton(final Button b, final String key) {
179:                b.addSelectionListener(new SelectionAdapter() {
180:                    public void widgetSelected(SelectionEvent e) {
181:                        fBundleDescription.setValue(key, new Boolean(b
182:                                .getSelection()));
183:                        checkIfPageComplete();
184:                    }
185:                });
186:            }
187:
188:            final void checkIfPageComplete() {
189:                IWizardContainer c = (fWizard != null) ? fWizard.getContainer()
190:                        : null;
191:                if (c != null && this  == c.getCurrentPage())
192:                    c.updateButtons();
193:            }
194:
195:            /////////////////////////////////////////////////////////
196:
197:            /* (non-Javadoc)
198:             * @see org.eclipse.jface.wizard.IWizardPage#canFlipToNextPage()
199:             */
200:            public boolean canFlipToNextPage() {
201:                return isPageComplete() && getNextPage() != null;
202:            }
203:
204:            /* (non-Javadoc)
205:             * @see org.eclipse.jface.wizard.IWizardPage#getName()
206:             */
207:            public String getName() {
208:                return Util.getString(fKey + ".title"); //$NON-NLS-1$;
209:            }
210:
211:            /* (non-Javadoc)
212:             * @see org.eclipse.jface.wizard.IWizardPage#getNextPage()
213:             */
214:            public IWizardPage getNextPage() {
215:                if (fWizard == null)
216:                    return null;
217:                return fWizard.getNextPage(this );
218:            }
219:
220:            /* (non-Javadoc)
221:             * @see org.eclipse.jface.wizard.IWizardPage#getPreviousPage()
222:             */
223:            public IWizardPage getPreviousPage() {
224:                if (fPreviousPage != null)
225:                    return fPreviousPage;
226:                if (fWizard != null)
227:                    return fWizard.getPreviousPage(this );
228:                return null;
229:            }
230:
231:            /* (non-Javadoc)
232:             * @see org.eclipse.jface.wizard.IWizardPage#getWizard()
233:             */
234:            public IWizard getWizard() {
235:                return fWizard;
236:            }
237:
238:            /* (non-Javadoc)
239:             * @see org.eclipse.jface.wizard.IWizardPage#setPreviousPage(org.eclipse.jface.wizard.IWizardPage)
240:             */
241:            public void setPreviousPage(IWizardPage page) {
242:                fPreviousPage = page;
243:            }
244:
245:            /* (non-Javadoc)
246:             * @see org.eclipse.jface.wizard.IWizardPage#setWizard(org.eclipse.jface.wizard.IWizard)
247:             */
248:            public void setWizard(IWizard newWizard) {
249:                fWizard = newWizard;
250:            }
251:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.