Source Code Cross Referenced for TocBlock.java in  » IDE-Eclipse » Eclipse-plug-in-development » org » eclipse » pde » internal » ui » editor » toc » 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 » Eclipse plug in development » org.eclipse.pde.internal.ui.editor.toc 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.eclipse.pde.internal.ui.editor.toc;
002:
003:        import org.eclipse.jface.viewers.ISelection;
004:        import org.eclipse.jface.viewers.IStructuredSelection;
005:        import org.eclipse.pde.core.IModelChangedEvent;
006:        import org.eclipse.pde.core.IModelChangedListener;
007:        import org.eclipse.pde.internal.core.text.toc.Toc;
008:        import org.eclipse.pde.internal.core.text.toc.TocAnchor;
009:        import org.eclipse.pde.internal.core.text.toc.TocLink;
010:        import org.eclipse.pde.internal.core.text.toc.TocTopic;
011:        import org.eclipse.pde.internal.ui.editor.PDEFormPage;
012:        import org.eclipse.pde.internal.ui.editor.PDEMasterDetailsBlock;
013:        import org.eclipse.pde.internal.ui.editor.PDESection;
014:        import org.eclipse.pde.internal.ui.editor.toc.details.TocAbstractDetails;
015:        import org.eclipse.pde.internal.ui.editor.toc.details.TocAnchorDetails;
016:        import org.eclipse.pde.internal.ui.editor.toc.details.TocDetails;
017:        import org.eclipse.pde.internal.ui.editor.toc.details.TocLinkDetails;
018:        import org.eclipse.pde.internal.ui.editor.toc.details.TocTopicDetails;
019:        import org.eclipse.swt.widgets.Composite;
020:        import org.eclipse.ui.forms.DetailsPart;
021:        import org.eclipse.ui.forms.IDetailsPage;
022:        import org.eclipse.ui.forms.IDetailsPageProvider;
023:        import org.eclipse.ui.forms.IManagedForm;
024:
025:        /**
026:         * TODO: Comment
027:         *
028:         */
029:        public class TocBlock extends PDEMasterDetailsBlock implements 
030:                IModelChangedListener, IDetailsPageProvider {
031:
032:            private TocTreeSection fMasterSection;
033:
034:            private TocAbstractDetails fDetails;
035:
036:            private TocAbstractDetails fTopicDetails;
037:
038:            private TocAnchorDetails fAnchorDetails;
039:
040:            private TocLinkDetails fLinkDetails;
041:
042:            /**TODO: Comment
043:             * @param page
044:             */
045:            public TocBlock(PDEFormPage page) {
046:                super (page);
047:            }
048:
049:            /* (non-Javadoc)
050:             * @see org.eclipse.pde.internal.ui.editor.PDEMasterDetailsBlock#createMasterSection(org.eclipse.ui.forms.IManagedForm, org.eclipse.swt.widgets.Composite)
051:             */
052:            protected PDESection createMasterSection(IManagedForm managedForm,
053:                    Composite parent) {
054:                fMasterSection = new TocTreeSection(getPage(), parent);
055:                return fMasterSection;
056:            }
057:
058:            /* (non-Javadoc)
059:             * @see org.eclipse.ui.forms.MasterDetailsBlock#registerPages(org.eclipse.ui.forms.DetailsPart)
060:             */
061:            protected void registerPages(DetailsPart detailsPart) {
062:                // Only static pages to be defined.  Do not cache pages
063:                detailsPart.setPageLimit(0);
064:                // Register static page:  toc
065:                fDetails = new TocDetails(fMasterSection);
066:                detailsPart.registerPage(TocDetails.class, fDetails);
067:                // Register static page:  tocTopic
068:                fTopicDetails = new TocTopicDetails(fMasterSection);
069:                detailsPart.registerPage(TocTopicDetails.class, fTopicDetails);
070:                // Register static page:  tocAnchor
071:                fAnchorDetails = new TocAnchorDetails(fMasterSection);
072:                detailsPart
073:                        .registerPage(TocAnchorDetails.class, fAnchorDetails);
074:                // Register static page:  tocLink
075:                fLinkDetails = new TocLinkDetails(fMasterSection);
076:                detailsPart.registerPage(TocLinkDetails.class, fLinkDetails);
077:                // Set this class as the page provider
078:                detailsPart.setPageProvider(this );
079:            }
080:
081:            /* (non-Javadoc)
082:             * @see org.eclipse.pde.core.IModelChangedListener#modelChanged(org.eclipse.pde.core.IModelChangedEvent)
083:             */
084:            public void modelChanged(IModelChangedEvent event) {
085:                // Inform the master section
086:                if (fMasterSection != null) {
087:                    fMasterSection.modelChanged(event);
088:                }
089:            }
090:
091:            /* (non-Javadoc)
092:             * @see org.eclipse.ui.forms.IDetailsPageProvider#getPage(java.lang.Object)
093:             */
094:            public IDetailsPage getPage(Object key) {
095:                // No dynamic pages.  Static pages already registered
096:                return null;
097:            }
098:
099:            /* (non-Javadoc)
100:             * @see org.eclipse.ui.forms.IDetailsPageProvider#getPageKey(java.lang.Object)
101:             */
102:            public Object getPageKey(Object object) {
103:                ISelection selection = getSelection();
104:                if (!(selection instanceof  IStructuredSelection)
105:                        || ((IStructuredSelection) selection).size() > 1) {
106:                    return object.getClass();
107:                }
108:
109:                // Get static page key
110:                if (object instanceof  Toc) {
111:                    // Static page:  toc
112:                    return TocDetails.class;
113:                } else if (object instanceof  TocTopic) {
114:                    // Static page:  tocTopic
115:                    return TocTopicDetails.class;
116:                } else if (object instanceof  TocAnchor) {
117:                    // Static page:  tocAnchor
118:                    return TocAnchorDetails.class;
119:                } else if (object instanceof  TocLink) {
120:                    // Static page:  tocLink
121:                    return TocLinkDetails.class;
122:                }
123:
124:                // Should never reach here
125:                return object.getClass();
126:            }
127:
128:            /**TODO: Comment
129:             * @return
130:             */
131:            public ISelection getSelection() {
132:                if (fMasterSection != null) {
133:                    return fMasterSection.getSelection();
134:                }
135:                return null;
136:            }
137:
138:            /**TODO: Comment
139:             * @return
140:             */
141:            public TocTreeSection getMasterSection() {
142:                return fMasterSection;
143:            }
144:        }
ww___w.___java___2s___.___co_m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.