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


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 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:         *     Chris Gross chris.gross@us.ibm.com Bug 107443
011:         *******************************************************************************/package org.eclipse.ui.internal;
012:
013:        import org.eclipse.ui.IFolderLayout;
014:        import org.eclipse.ui.PartInitException;
015:        import org.eclipse.ui.activities.WorkbenchActivityHelper;
016:        import org.eclipse.ui.views.IViewDescriptor;
017:
018:        /**
019:         * This layout is used to define the initial set of views and placeholders
020:         * in a folder.
021:         * <p>
022:         * Views are added to the folder by ID. This id is used to identify 
023:         * a view descriptor in the view registry, and this descriptor is used to 
024:         * instantiate the <code>IViewPart</code>.
025:         * </p>
026:         */
027:        public class FolderLayout implements  IFolderLayout {
028:            private ViewStack folder;
029:
030:            private PageLayout pageLayout;
031:
032:            private ViewFactory viewFactory;
033:
034:            /**
035:             * Create an instance of a <code>FolderLayout</code> belonging to a 
036:             * <code>PageLayout</code>.
037:             */
038:            public FolderLayout(PageLayout pageLayout, ViewStack folder,
039:                    ViewFactory viewFactory) {
040:                super ();
041:                this .folder = folder;
042:                this .viewFactory = viewFactory;
043:                this .pageLayout = pageLayout;
044:            }
045:
046:            /* (non-Javadoc)
047:             * @see org.eclipse.ui.IPlaceholderFolderLayout#addPlaceholder(java.lang.String)
048:             */
049:            public void addPlaceholder(String viewId) {
050:                if (!pageLayout.checkValidPlaceholderId(viewId)) {
051:                    return;
052:                }
053:
054:                // Create the placeholder.
055:                PartPlaceholder newPart = new PartPlaceholder(viewId);
056:                linkPartToPageLayout(viewId, newPart);
057:
058:                // Add it to the folder layout.
059:                folder.add(newPart);
060:            }
061:
062:            /* (non-Javadoc)
063:             * @see org.eclipse.ui.IFolderLayout#addView(java.lang.String)
064:             */
065:            public void addView(String viewId) {
066:                if (pageLayout.checkPartInLayout(viewId)) {
067:                    return;
068:                }
069:
070:                try {
071:                    IViewDescriptor descriptor = viewFactory.getViewRegistry()
072:                            .find(ViewFactory.extractPrimaryId(viewId));
073:                    if (descriptor == null) {
074:                        throw new PartInitException(
075:                                "View descriptor not found: " + viewId); //$NON-NLS-1$
076:                    }
077:                    if (WorkbenchActivityHelper.filterItem(descriptor)) {
078:                        //create a placeholder instead.
079:                        addPlaceholder(viewId);
080:                        LayoutHelper.addViewActivator(pageLayout, viewId);
081:                    } else {
082:
083:                        ViewPane newPart = LayoutHelper.createView(pageLayout
084:                                .getViewFactory(), viewId);
085:                        linkPartToPageLayout(viewId, newPart);
086:                        folder.add(newPart);
087:                    }
088:                } catch (PartInitException e) {
089:                    // cannot safely open the dialog so log the problem
090:                    WorkbenchPlugin.log(getClass(), "addView(String)", e); //$NON-NLS-1$
091:                }
092:            }
093:
094:            /**
095:             * Inform the page layout of the new part created
096:             * and the folder the part belongs to.
097:             */
098:            private void linkPartToPageLayout(String viewId, LayoutPart newPart) {
099:                pageLayout.setRefPart(viewId, newPart);
100:                pageLayout.setFolderPart(viewId, folder);
101:                // force creation of the view layout rec
102:                pageLayout.getViewLayoutRec(viewId, true);
103:            }
104:
105:            /* (non-Javadoc)
106:             * @see org.eclipse.ui.IPlaceholderFolderLayout#getProperty(java.lang.String)
107:             */
108:            public String getProperty(String id) {
109:                return folder.getProperty(id);
110:            }
111:
112:            /* (non-Javadoc)
113:             * @see org.eclipse.ui.IPlaceholderFolderLayout#setProperty(java.lang.String, java.lang.String)
114:             */
115:            public void setProperty(String id, String value) {
116:                folder.setProperty(id, value);
117:            }
118:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.