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


001:        /*******************************************************************************
002:         * Copyright (c) 2001, 2007 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.views.properties.tabbed.view;
011:
012:        import org.eclipse.swt.SWT;
013:        import org.eclipse.swt.custom.ScrolledComposite;
014:        import org.eclipse.swt.layout.FormAttachment;
015:        import org.eclipse.swt.layout.FormData;
016:        import org.eclipse.swt.layout.FormLayout;
017:        import org.eclipse.swt.widgets.Composite;
018:        import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
019:
020:        /**
021:         * Composite responsible for drawing the tabbed property sheet page.
022:         * 
023:         * @author Anthony Hunter
024:         */
025:        public class TabbedPropertyComposite extends Composite {
026:
027:            private TabbedPropertySheetWidgetFactory factory;
028:
029:            private Composite mainComposite;
030:
031:            private Composite leftComposite;
032:
033:            private ScrolledComposite scrolledComposite;
034:
035:            private Composite tabComposite;
036:
037:            private TabbedPropertyTitle title;
038:
039:            private TabbedPropertyList listComposite;
040:
041:            private boolean displayTitle;
042:
043:            /**
044:             * Constructor for a TabbedPropertyComposite
045:             * 
046:             * @param parent
047:             *            the parent widget.
048:             * @param factory
049:             *            the widget factory.
050:             * @param displayTitle
051:             *            if <code>true</code>, then the title bar will be displayed.
052:             */
053:            public TabbedPropertyComposite(Composite parent,
054:                    TabbedPropertySheetWidgetFactory factory,
055:                    boolean displayTitle) {
056:                super (parent, SWT.NO_FOCUS);
057:                this .factory = factory;
058:                this .displayTitle = displayTitle;
059:
060:                createMainComposite();
061:            }
062:
063:            /**
064:             * Create the main composite.
065:             */
066:            protected void createMainComposite() {
067:                mainComposite = factory.createComposite(this , SWT.NO_FOCUS);
068:                mainComposite.setLayout(new FormLayout());
069:                FormData formData = new FormData();
070:                formData.left = new FormAttachment(0, 0);
071:                formData.right = new FormAttachment(100, 0);
072:                formData.top = new FormAttachment(0, 0);
073:                formData.bottom = new FormAttachment(100, 0);
074:                mainComposite.setLayoutData(formData);
075:
076:                createMainContents();
077:            }
078:
079:            /**
080:             * Create the contents in the main composite.
081:             */
082:            protected void createMainContents() {
083:                if (displayTitle) {
084:                    title = new TabbedPropertyTitle(mainComposite, factory);
085:
086:                    FormData data = new FormData();
087:                    data.left = new FormAttachment(0, 0);
088:                    data.right = new FormAttachment(100, 0);
089:                    data.top = new FormAttachment(0, 0);
090:                    title.setLayoutData(data);
091:                }
092:
093:                leftComposite = factory.createComposite(mainComposite,
094:                        SWT.NO_FOCUS);
095:                leftComposite.setLayout(new FormLayout());
096:
097:                scrolledComposite = factory.createScrolledComposite(
098:                        mainComposite, SWT.H_SCROLL | SWT.V_SCROLL
099:                                | SWT.NO_FOCUS);
100:                scrolledComposite.setLayout(new FormLayout());
101:
102:                FormData formData = new FormData();
103:                formData.left = new FormAttachment(leftComposite, 0);
104:                formData.right = new FormAttachment(100, 0);
105:                if (displayTitle) {
106:                    formData.top = new FormAttachment(title, 0);
107:                } else {
108:                    formData.top = new FormAttachment(0, 0);
109:                }
110:                formData.bottom = new FormAttachment(100, 0);
111:                scrolledComposite.setLayoutData(formData);
112:
113:                formData = new FormData();
114:                formData.left = new FormAttachment(0, 0);
115:                formData.right = new FormAttachment(scrolledComposite, 0);
116:                if (displayTitle) {
117:                    formData.top = new FormAttachment(title, 0);
118:                } else {
119:                    formData.top = new FormAttachment(0, 0);
120:                }
121:                formData.bottom = new FormAttachment(100, 0);
122:                leftComposite.setLayoutData(formData);
123:
124:                tabComposite = factory.createComposite(scrolledComposite,
125:                        SWT.NO_FOCUS);
126:                tabComposite.setLayout(new FormLayout());
127:
128:                scrolledComposite.setContent(tabComposite);
129:                scrolledComposite.setAlwaysShowScrollBars(false);
130:                scrolledComposite.setExpandVertical(true);
131:                scrolledComposite.setExpandHorizontal(true);
132:
133:                listComposite = new TabbedPropertyList(leftComposite, factory);
134:                formData = new FormData();
135:                formData.left = new FormAttachment(0, 0);
136:                formData.right = new FormAttachment(100, 0);
137:                formData.top = new FormAttachment(0, 0);
138:                formData.bottom = new FormAttachment(100, 0);
139:                listComposite.setLayoutData(formData);
140:
141:                FormData data = new FormData();
142:                data.left = new FormAttachment(0, 0);
143:                data.right = new FormAttachment(100, 0);
144:                data.top = new FormAttachment(0, 0);
145:                data.bottom = new FormAttachment(100, 0);
146:                tabComposite.setLayoutData(data);
147:            }
148:
149:            /**
150:             * Get the tabbed property list, which is the list of tabs on the left hand
151:             * side of this composite.
152:             * 
153:             * @return the tabbed property list.
154:             */
155:            public TabbedPropertyList getList() {
156:                return listComposite;
157:            }
158:
159:            /**
160:             * Get the tabbed property title bar.
161:             * 
162:             * @return the tabbed property title bar or <code>null</code> if not used.
163:             */
164:            public TabbedPropertyTitle getTitle() {
165:                return title;
166:            }
167:
168:            /**
169:             * Get the tab composite where sections display their property contents.
170:             * 
171:             * @return the tab composite.
172:             */
173:            public Composite getTabComposite() {
174:                return tabComposite;
175:            }
176:
177:            /**
178:             * Get the scrolled composite which surrounds the title bar and tab
179:             * composite.
180:             * 
181:             * @return the scrolled composite.
182:             */
183:            public ScrolledComposite getScrolledComposite() {
184:                return scrolledComposite;
185:            }
186:
187:            /**
188:             * Get the widget factory.
189:             * 
190:             * @return the widget factory.
191:             */
192:            protected TabbedPropertySheetWidgetFactory getFactory() {
193:                return factory;
194:            }
195:
196:            /**
197:             * @see org.eclipse.swt.widgets.Widget#dispose()
198:             */
199:            public void dispose() {
200:                listComposite.dispose();
201:                if (displayTitle) {
202:                    title.dispose();
203:                }
204:                super.dispose();
205:            }
206:        }
w__ww_._j_av___a___2_s_.__c___o_m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.