Source Code Cross Referenced for EditorActionBarContributor.java in  » IDE-Eclipse » ui-workbench » org » eclipse » ui » part » 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.part 
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.part;
011:
012:        import org.eclipse.jface.action.ICoolBarManager;
013:        import org.eclipse.jface.action.IMenuManager;
014:        import org.eclipse.jface.action.IStatusLineManager;
015:        import org.eclipse.jface.action.IToolBarManager;
016:        import org.eclipse.ui.IActionBars;
017:        import org.eclipse.ui.IActionBars2;
018:        import org.eclipse.ui.IEditorActionBarContributor;
019:        import org.eclipse.ui.IEditorPart;
020:        import org.eclipse.ui.IWorkbenchPage;
021:
022:        /**
023:         * Standard implementation of <code>IEditorActionBarContributor</code>.
024:         * <p>
025:         * If instantiated and used as-is, nothing is contribututed. Clients should
026:         * subclass in order to contribute to some or all of the action bars.
027:         * <p>
028:         * Subclasses may reimplement the following methods:
029:         * <ul>
030:         *   <li><code>contributeToMenu</code> - reimplement to contribute to menu</li>
031:         *   <li><code>contributeToToolBar</code> - reimplement to contribute to tool
032:         *     bar</li>
033:         *   <li><code>contributeToStatusLine</code> - reimplement to contribute to 
034:         *     status line</li>
035:         *   <li><code>setActiveEditor</code> - reimplement to react to editor changes</li>
036:         * </ul>
037:         * </p>
038:         */
039:        public class EditorActionBarContributor implements 
040:                IEditorActionBarContributor {
041:            /**
042:             * The action bars; <code>null</code> until <code>init</code> is called.
043:             */
044:            private IActionBars bars;
045:
046:            /**
047:             * The workbench page; <code>null</code> until <code>init</code> is called.
048:             */
049:            private IWorkbenchPage page;
050:
051:            /**
052:             * Creates an empty editor action bar contributor. The action bars are
053:             * furnished later via the <code>init</code> method.
054:             */
055:            public EditorActionBarContributor() {
056:            }
057:
058:            /**
059:             * Contributes to the given menu.
060:             * <p>
061:             * The <code>EditorActionBarContributor</code> implementation of this method
062:             * does nothing. Subclasses may reimplement to add to the menu portion of this
063:             * contribution.
064:             * </p>
065:             *
066:             * @param menuManager the manager that controls the menu
067:             */
068:            public void contributeToMenu(IMenuManager menuManager) {
069:            }
070:
071:            /**
072:             * Contributes to the given status line.
073:             * <p>
074:             * The <code>EditorActionBarContributor</code> implementation of this method
075:             * does nothing. Subclasses may reimplement to add to the status line portion of
076:             * this contribution.
077:             * </p>
078:             *
079:             * @param statusLineManager the manager of the status line
080:             */
081:            public void contributeToStatusLine(
082:                    IStatusLineManager statusLineManager) {
083:            }
084:
085:            /**
086:             * Contributes to the given tool bar.
087:             * <p>
088:             * The <code>EditorActionBarContributor</code> implementation of this method
089:             * does nothing. Subclasses may reimplement to add to the tool bar portion of
090:             * this contribution.
091:             * </p>
092:             *
093:             * @param toolBarManager the manager that controls the workbench tool bar
094:             */
095:            public void contributeToToolBar(IToolBarManager toolBarManager) {
096:            }
097:
098:            /**
099:             * Contributes to the given cool bar.
100:             * <p>
101:             * The <code>EditorActionBarContributor</code> implementation of this method
102:             * does nothing. Subclasses may reimplement to add to the cool bar portion of
103:             * this contribution. There can only be contributions from a cool bar or a tool bar.
104:             * </p>
105:             *
106:             * @param coolBarManager the manager that controls the workbench cool bar.
107:             * 
108:             * @since 3.0
109:             */
110:            public void contributeToCoolBar(ICoolBarManager coolBarManager) {
111:            }
112:
113:            /**
114:             * Returns this contributor's action bars.
115:             *
116:             * @return the action bars
117:             */
118:            public IActionBars getActionBars() {
119:                return bars;
120:            }
121:
122:            /**
123:             * Returns this contributor's workbench page.
124:             *
125:             * @return the workbench page
126:             */
127:            public IWorkbenchPage getPage() {
128:                return page;
129:            }
130:
131:            /**
132:             * The <code>EditorActionBarContributor</code> implementation of this 
133:             * <code>IEditorActionBarContributor</code> method does nothing,
134:             * subclasses may override.
135:             */
136:            public void dispose() {
137:            }
138:
139:            /**
140:             * The <code>EditorActionBarContributor</code> implementation of this 
141:             * <code>IEditorActionBarContributor</code> method remembers the page
142:             * then forwards the call to <code>init(IActionBars)</code> for
143:             * backward compatibility
144:             */
145:            public void init(IActionBars bars, IWorkbenchPage page) {
146:                this .page = page;
147:                init(bars);
148:            }
149:
150:            /**
151:             * This method calls:
152:             * <ul>
153:             *  <li><code>contributeToMenu</code> with <code>bars</code>' menu manager</li>
154:             *  <li><code>contributeToToolBar</code> with <code>bars</code>' tool bar
155:             *    manager</li>
156:             *  <li><code>contributeToCoolBar</code> with <code>bars</code>' cool bar
157:             *    manager if <code>IActionBars</code> is of extended type <code>IActionBars2</code> </li>
158:             *  <li><code>contributeToStatusLine</code> with <code>bars</code>' status line
159:             *    manager</li>
160:             * </ul>
161:             * The given action bars are also remembered and made accessible via 
162:             * <code>getActionBars</code>.
163:             * 
164:             * @param bars the action bars
165:             */
166:            public void init(IActionBars bars) {
167:                this .bars = bars;
168:                contributeToMenu(bars.getMenuManager());
169:                contributeToToolBar(bars.getToolBarManager());
170:                if (bars instanceof  IActionBars2) {
171:                    contributeToCoolBar(((IActionBars2) bars)
172:                            .getCoolBarManager());
173:                }
174:                contributeToStatusLine(bars.getStatusLineManager());
175:
176:            }
177:
178:            /**
179:             * Sets the active editor for the contributor.
180:             * <p>
181:             * The <code>EditorActionBarContributor</code> implementation of this method does
182:             * nothing. Subclasses may reimplement. This generally entails disconnecting
183:             * from the old editor, connecting to the new editor, and updating the actions
184:             * to reflect the new editor.
185:             * </p>
186:             * 
187:             * @param targetEditor the new target editor
188:             */
189:            public void setActiveEditor(IEditorPart targetEditor) {
190:            }
191:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.