Source Code Cross Referenced for WorkbenchPresentationFactory.java in  » IDE-Eclipse » ui-workbench » org » eclipse » ui » presentations » 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.presentations 
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.presentations;
011:
012:        import org.eclipse.jface.preference.IPreferenceStore;
013:        import org.eclipse.swt.SWT;
014:        import org.eclipse.swt.widgets.Composite;
015:        import org.eclipse.ui.IWorkbenchPreferenceConstants;
016:        import org.eclipse.ui.PlatformUI;
017:        import org.eclipse.ui.internal.IPreferenceConstants;
018:        import org.eclipse.ui.internal.WorkbenchPlugin;
019:        import org.eclipse.ui.internal.preferences.IDynamicPropertyMap;
020:        import org.eclipse.ui.internal.presentations.defaultpresentation.DefaultMultiTabListener;
021:        import org.eclipse.ui.internal.presentations.defaultpresentation.DefaultSimpleTabListener;
022:        import org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder;
023:        import org.eclipse.ui.internal.presentations.defaultpresentation.DefaultThemeListener;
024:        import org.eclipse.ui.internal.presentations.defaultpresentation.EmptyTabFolder;
025:        import org.eclipse.ui.internal.presentations.util.PresentablePartFolder;
026:        import org.eclipse.ui.internal.presentations.util.StandardEditorSystemMenu;
027:        import org.eclipse.ui.internal.presentations.util.StandardViewSystemMenu;
028:        import org.eclipse.ui.internal.presentations.util.TabbedStackPresentation;
029:
030:        /**
031:         * The default presentation factory for the Workbench.
032:         * 
033:         * @since 3.0
034:         */
035:        public class WorkbenchPresentationFactory extends
036:                AbstractPresentationFactory {
037:
038:            // don't reset these dynamically, so just keep the information static.
039:            // see bug:
040:            // 75422 [Presentations] Switching presentation to R21 switches immediately,
041:            // but only partially
042:            private static int editorTabPosition = WorkbenchPlugin.getDefault()
043:                    .getPreferenceStore().getInt(
044:                            IPreferenceConstants.EDITOR_TAB_POSITION);
045:            private static int viewTabPosition = WorkbenchPlugin.getDefault()
046:                    .getPreferenceStore().getInt(
047:                            IPreferenceConstants.VIEW_TAB_POSITION);
048:
049:            /* (non-Javadoc)
050:             * @see org.eclipse.ui.presentations.AbstractPresentationFactory#createEditorPresentation(org.eclipse.swt.widgets.Composite, org.eclipse.ui.presentations.IStackPresentationSite)
051:             */
052:            public StackPresentation createEditorPresentation(Composite parent,
053:                    IStackPresentationSite site) {
054:                DefaultTabFolder folder = new DefaultTabFolder(
055:                        parent,
056:                        editorTabPosition | SWT.BORDER,
057:                        site
058:                                .supportsState(IStackPresentationSite.STATE_MINIMIZED),
059:                        site
060:                                .supportsState(IStackPresentationSite.STATE_MAXIMIZED));
061:
062:                /*
063:                 * Set the minimum characters to display, if the preference is something
064:                 * other than the default. This is mainly intended for RCP applications
065:                 * or for expert users (i.e., via the plug-in customization file).
066:                 * 
067:                 * Bug 32789.
068:                 */
069:                final IPreferenceStore store = PlatformUI.getPreferenceStore();
070:                if (store
071:                        .contains(IWorkbenchPreferenceConstants.EDITOR_MINIMUM_CHARACTERS)) {
072:                    final int minimumCharacters = store
073:                            .getInt(IWorkbenchPreferenceConstants.EDITOR_MINIMUM_CHARACTERS);
074:                    if (minimumCharacters >= 0) {
075:                        folder.setMinimumCharacters(minimumCharacters);
076:                    }
077:                }
078:
079:                PresentablePartFolder partFolder = new PresentablePartFolder(
080:                        folder);
081:
082:                TabbedStackPresentation result = new TabbedStackPresentation(
083:                        site, partFolder, new StandardEditorSystemMenu(site));
084:
085:                DefaultThemeListener themeListener = new DefaultThemeListener(
086:                        folder, result.getTheme());
087:                result.getTheme().addListener(themeListener);
088:
089:                IDynamicPropertyMap workbenchPreferences = result
090:                        .getPluginPreferences(WorkbenchPlugin.getDefault());
091:
092:                new DefaultMultiTabListener(workbenchPreferences,
093:                        IPreferenceConstants.SHOW_MULTIPLE_EDITOR_TABS, folder);
094:
095:                new DefaultSimpleTabListener(
096:                        result.getApiPreferences(),
097:                        IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS,
098:                        folder);
099:
100:                return result;
101:            }
102:
103:            /*
104:             * (non-Javadoc)
105:             * 
106:             * @see org.eclipse.ui.presentations.AbstractPresentationFactory#createViewPresentation(org.eclipse.swt.widgets.Composite,
107:             *      org.eclipse.ui.presentations.IStackPresentationSite)
108:             */
109:            public StackPresentation createViewPresentation(Composite parent,
110:                    IStackPresentationSite site) {
111:
112:                DefaultTabFolder folder = new DefaultTabFolder(
113:                        parent,
114:                        viewTabPosition | SWT.BORDER,
115:                        site
116:                                .supportsState(IStackPresentationSite.STATE_MINIMIZED),
117:                        site
118:                                .supportsState(IStackPresentationSite.STATE_MAXIMIZED));
119:
120:                final IPreferenceStore store = PlatformUI.getPreferenceStore();
121:                final int minimumCharacters = store
122:                        .getInt(IWorkbenchPreferenceConstants.VIEW_MINIMUM_CHARACTERS);
123:                if (minimumCharacters >= 0) {
124:                    folder.setMinimumCharacters(minimumCharacters);
125:                }
126:
127:                PresentablePartFolder partFolder = new PresentablePartFolder(
128:                        folder);
129:
130:                folder.setUnselectedCloseVisible(false);
131:                folder.setUnselectedImageVisible(false);
132:
133:                TabbedStackPresentation result = new TabbedStackPresentation(
134:                        site, partFolder, new StandardViewSystemMenu(site));
135:
136:                DefaultThemeListener themeListener = new DefaultThemeListener(
137:                        folder, result.getTheme());
138:                result.getTheme().addListener(themeListener);
139:
140:                new DefaultSimpleTabListener(
141:                        result.getApiPreferences(),
142:                        IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS,
143:                        folder);
144:
145:                return result;
146:            }
147:
148:            /*
149:             * (non-Javadoc)
150:             * 
151:             * @see org.eclipse.ui.presentations.AbstractPresentationFactory#createStandaloneViewPresentation(org.eclipse.swt.widgets.Composite,
152:             *      org.eclipse.ui.presentations.IStackPresentationSite, boolean)
153:             */
154:            public StackPresentation createStandaloneViewPresentation(
155:                    Composite parent, IStackPresentationSite site,
156:                    boolean showTitle) {
157:
158:                if (showTitle) {
159:                    return createViewPresentation(parent, site);
160:                }
161:                EmptyTabFolder folder = new EmptyTabFolder(parent, true);
162:                TabbedStackPresentation presentation = new TabbedStackPresentation(
163:                        site, folder, new StandardViewSystemMenu(site));
164:
165:                return presentation;
166:            }
167:
168:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.