Source Code Cross Referenced for TabbedPropertySheetWidgetFactory.java in  » IDE-Eclipse » ui » org » eclipse » ui » views » properties » tabbed » 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 » org.eclipse.ui.views.properties.tabbed 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2001, 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.views.properties.tabbed;
011:
012:        import org.eclipse.swt.SWT;
013:        import org.eclipse.swt.custom.CCombo;
014:        import org.eclipse.swt.custom.CLabel;
015:        import org.eclipse.swt.custom.CTabFolder;
016:        import org.eclipse.swt.custom.CTabItem;
017:        import org.eclipse.swt.custom.ScrolledComposite;
018:        import org.eclipse.swt.layout.FormLayout;
019:        import org.eclipse.swt.widgets.Composite;
020:        import org.eclipse.swt.widgets.Display;
021:        import org.eclipse.swt.widgets.Group;
022:        import org.eclipse.swt.widgets.List;
023:        import org.eclipse.ui.forms.widgets.FormToolkit;
024:
025:        /**
026:         * A FormToolkit customized for use by tabbed property sheet page.
027:         * 
028:         * @author Anthony Hunter
029:         */
030:        public class TabbedPropertySheetWidgetFactory extends FormToolkit {
031:
032:            /**
033:             * private constructor.
034:             */
035:            public TabbedPropertySheetWidgetFactory() {
036:                super (Display.getCurrent());
037:            }
038:
039:            /**
040:             * Creates the tab folder as a part of the form.
041:             * 
042:             * @param parent
043:             *            the composite parent.
044:             * @param style
045:             *            the tab folder style.
046:             * @return the tab folder
047:             */
048:            public CTabFolder createTabFolder(Composite parent, int style) {
049:                CTabFolder tabFolder = new CTabFolder(parent, style);
050:                return tabFolder;
051:            }
052:
053:            /**
054:             * Creates the tab item as a part of the tab folder.
055:             * 
056:             * @param tabFolder
057:             *            the parent.
058:             * @param style
059:             *            the tab folder style.
060:             * @return the tab item.
061:             */
062:            public CTabItem createTabItem(CTabFolder tabFolder, int style) {
063:                CTabItem tabItem = new CTabItem(tabFolder, style);
064:                return tabItem;
065:            }
066:
067:            /**
068:             * Creates the list as a part of the form.
069:             * 
070:             * @param parent
071:             *            the composite parent.
072:             * @param style
073:             *            the list style.
074:             * @return the list.
075:             */
076:            public List createList(Composite parent, int style) {
077:                List list = new org.eclipse.swt.widgets.List(parent, style);
078:                return list;
079:            }
080:
081:            public Composite createComposite(Composite parent, int style) {
082:                Composite c = super .createComposite(parent, style);
083:                paintBordersFor(c);
084:                return c;
085:            }
086:
087:            public Composite createComposite(Composite parent) {
088:                Composite c = createComposite(parent, SWT.NONE);
089:                return c;
090:            }
091:
092:            /**
093:             * Creates a plain composite as a part of the form.
094:             * 
095:             * @param parent
096:             *            the composite parent.
097:             * @param style
098:             *            the composite style.
099:             * @return the composite.
100:             */
101:            public Composite createPlainComposite(Composite parent, int style) {
102:                Composite c = super .createComposite(parent, style);
103:                c.setBackground(parent.getBackground());
104:                paintBordersFor(c);
105:                return c;
106:            }
107:
108:            /**
109:             * Creates a scrolled composite as a part of the form.
110:             * 
111:             * @param parent
112:             *            the composite parent.
113:             * @param style
114:             *            the composite style.
115:             * @return the composite.
116:             */
117:            public ScrolledComposite createScrolledComposite(Composite parent,
118:                    int style) {
119:                ScrolledComposite scrolledComposite = new ScrolledComposite(
120:                        parent, style);
121:                return scrolledComposite;
122:            }
123:
124:            /**
125:             * Creates a combo box as a part of the form.
126:             * 
127:             * @param parent
128:             *            the combo box parent.
129:             * @param comboStyle
130:             *            the combo box style.
131:             * @return the combo box.
132:             */
133:            public CCombo createCCombo(Composite parent, int comboStyle) {
134:                CCombo combo = new CCombo(parent, comboStyle);
135:                adapt(combo, true, false);
136:                // Bugzilla 145837 - workaround for no borders on Windows XP
137:                if (getBorderStyle() == SWT.BORDER) {
138:                    combo.setData(FormToolkit.KEY_DRAW_BORDER,
139:                            FormToolkit.TEXT_BORDER);
140:                }
141:                return combo;
142:            }
143:
144:            /**
145:             * Creates a combo box as a part of the form.
146:             * 
147:             * @param parent
148:             *            the combo box parent.
149:             * @return the combo box.
150:             */
151:            public CCombo createCCombo(Composite parent) {
152:                return createCCombo(parent, SWT.FLAT | SWT.READ_ONLY);
153:            }
154:
155:            /**
156:             * Creates a group as a part of the form.
157:             * 
158:             * @param parent
159:             *            the group parent.
160:             * @param text
161:             *            the group title.
162:             * @return the composite.
163:             */
164:            public Group createGroup(Composite parent, String text) {
165:                Group group = new Group(parent, SWT.SHADOW_NONE);
166:                group.setText(text);
167:                group.setBackground(getColors().getBackground());
168:                group.setForeground(getColors().getForeground());
169:                return group;
170:            }
171:
172:            /**
173:             * Creates a flat form composite as a part of the form.
174:             * 
175:             * @param parent
176:             *            the composite parent.
177:             * @return the composite.
178:             */
179:            public Composite createFlatFormComposite(Composite parent) {
180:                Composite composite = createComposite(parent);
181:                FormLayout layout = new FormLayout();
182:                layout.marginWidth = ITabbedPropertyConstants.HSPACE + 2;
183:                layout.marginHeight = ITabbedPropertyConstants.VSPACE;
184:                layout.spacing = ITabbedPropertyConstants.VMARGIN + 1;
185:                composite.setLayout(layout);
186:                return composite;
187:            }
188:
189:            /**
190:             * Creates a label as a part of the form.
191:             * 
192:             * @param parent
193:             *            the label parent.
194:             * @param text
195:             *            the label text.
196:             * @return the label.
197:             */
198:            public CLabel createCLabel(Composite parent, String text) {
199:                return createCLabel(parent, text, SWT.NONE);
200:            }
201:
202:            /**
203:             * Creates a label as a part of the form.
204:             * 
205:             * @param parent
206:             *            the label parent.
207:             * @param text
208:             *            the label text.
209:             * @param style
210:             *            the label style.
211:             * @return the label.
212:             */
213:            public CLabel createCLabel(Composite parent, String text, int style) {
214:                final CLabel label = new CLabel(parent, style);
215:                label.setBackground(parent.getBackground());
216:                label.setText(text);
217:                return label;
218:            }
219:
220:            public void dispose() {
221:                if (getColors() != null) {
222:                    super.dispose();
223:                }
224:            }
225:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.