Source Code Cross Referenced for PlaceholderContributionItem.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, 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.internal;
011:
012:        import org.eclipse.jface.action.IContributionItem;
013:        import org.eclipse.jface.action.IContributionManager;
014:        import org.eclipse.jface.internal.provisional.action.IToolBarContributionItem;
015:        import org.eclipse.swt.widgets.Composite;
016:        import org.eclipse.swt.widgets.CoolBar;
017:        import org.eclipse.swt.widgets.Menu;
018:        import org.eclipse.swt.widgets.ToolBar;
019:
020:        /**
021:         * A contribution item that is intended to hold the place of a tool bar
022:         * contribution item that has been disposed. This is to ensure that tool bar
023:         * contribution items are disposed (freeing their resources), but that layout
024:         * information about the item is not lost.
025:         * 
026:         * @since 3.0
027:         */
028:        final class PlaceholderContributionItem implements  IContributionItem {
029:
030:            /**
031:             * The identifier for the replaced contribution item.
032:             */
033:            private final String id;
034:
035:            /**
036:             * The height of the SWT widget corresponding to the replaced contribution
037:             * item.
038:             */
039:            private final int storedHeight;
040:
041:            /**
042:             * The minimum number of items to display on the replaced contribution
043:             * item.
044:             */
045:            private final int storedMinimumItems;
046:
047:            /**
048:             * Whether the replaced contribution item would display chevrons.
049:             */
050:            private final boolean storedUseChevron;
051:
052:            /**
053:             * The width of the SWT widget corresponding to the replaced contribution
054:             * item.
055:             */
056:            private final int storedWidth;
057:
058:            /**
059:             * Constructs a new instance of <code>PlaceholderContributionItem</code>
060:             * from the item it is intended to replace.
061:             * 
062:             * @param item
063:             *            The item to be replaced; must not be <code>null</code>.
064:             */
065:            PlaceholderContributionItem(final IToolBarContributionItem item) {
066:                item.saveWidgetState();
067:                id = item.getId();
068:                storedHeight = item.getCurrentHeight();
069:                storedWidth = item.getCurrentWidth();
070:                storedMinimumItems = item.getMinimumItemsToShow();
071:                storedUseChevron = item.getUseChevron();
072:            }
073:
074:            /*
075:             * (non-Javadoc)
076:             * 
077:             * @see org.eclipse.jface.action.IContributionItem#dispose()
078:             */
079:            public void dispose() {
080:                // Do nothing
081:            }
082:
083:            /*
084:             * (non-Javadoc)
085:             * 
086:             * @see org.eclipse.jface.action.IContributionItem#fill(org.eclipse.swt.widgets.Composite)
087:             */
088:            public void fill(Composite parent) {
089:                throw new UnsupportedOperationException();
090:            }
091:
092:            /*
093:             * (non-Javadoc)
094:             * 
095:             * @see org.eclipse.jface.action.IContributionItem#fill(org.eclipse.swt.widgets.CoolBar,
096:             *      int)
097:             */
098:            public void fill(CoolBar parent, int index) {
099:                throw new UnsupportedOperationException();
100:
101:            }
102:
103:            /*
104:             * (non-Javadoc)
105:             * 
106:             * @see org.eclipse.jface.action.IContributionItem#fill(org.eclipse.swt.widgets.Menu,
107:             *      int)
108:             */
109:            public void fill(Menu parent, int index) {
110:                throw new UnsupportedOperationException();
111:
112:            }
113:
114:            /*
115:             * (non-Javadoc)
116:             * 
117:             * @see org.eclipse.jface.action.IContributionItem#fill(org.eclipse.swt.widgets.ToolBar,
118:             *      int)
119:             */
120:            public void fill(ToolBar parent, int index) {
121:                throw new UnsupportedOperationException();
122:
123:            }
124:
125:            /**
126:             * The height of the replaced contribution item.
127:             * 
128:             * @return The height.
129:             */
130:            int getHeight() {
131:                return storedHeight;
132:            }
133:
134:            /*
135:             * (non-Javadoc)
136:             * 
137:             * @see org.eclipse.jface.action.IContributionItem#getId()
138:             */
139:            public String getId() {
140:                return id;
141:            }
142:
143:            /**
144:             * The width of the replaced contribution item.
145:             * 
146:             * @return The width.
147:             */
148:            int getWidth() {
149:                return storedWidth;
150:            }
151:
152:            /**
153:             * Returns the minimum number of tool items to show in the cool item.
154:             * 
155:             * @return the minimum number of tool items to show, or <code>SHOW_ALL_ITEMS</code>
156:             *         if a value was not set
157:             * @see #setMinimumItemsToShow(int)
158:             * @since 3.2
159:             */
160:            int getMinimumItemsToShow() {
161:                return storedMinimumItems;
162:            }
163:
164:            /**
165:             * Returns whether chevron support is enabled.
166:             * 
167:             * @return <code>true</code> if chevron support is enabled, <code>false</code>
168:             *         otherwise
169:             * @since 3.2
170:             */
171:            boolean getUseChevron() {
172:                return storedUseChevron;
173:            }
174:
175:            /*
176:             * (non-Javadoc)
177:             * 
178:             * @see org.eclipse.jface.action.IContributionItem#isDirty()
179:             */
180:            public boolean isDirty() {
181:                return false;
182:            }
183:
184:            /*
185:             * (non-Javadoc)
186:             * 
187:             * @see org.eclipse.jface.action.IContributionItem#isDynamic()
188:             */
189:            public boolean isDynamic() {
190:                return false;
191:            }
192:
193:            /*
194:             * (non-Javadoc)
195:             * 
196:             * @see org.eclipse.jface.action.IContributionItem#isEnabled()
197:             */
198:            public boolean isEnabled() {
199:                // XXX Auto-generated method stub
200:                return false;
201:            }
202:
203:            /*
204:             * (non-Javadoc)
205:             * 
206:             * @see org.eclipse.jface.action.IContributionItem#isGroupMarker()
207:             */
208:            public boolean isGroupMarker() {
209:                return false;
210:            }
211:
212:            /*
213:             * (non-Javadoc)
214:             * 
215:             * @see org.eclipse.jface.action.IContributionItem#isSeparator()
216:             */
217:            public boolean isSeparator() {
218:                return false;
219:            }
220:
221:            /*
222:             * (non-Javadoc)
223:             * 
224:             * @see org.eclipse.jface.action.IContributionItem#isVisible()
225:             */
226:            public boolean isVisible() {
227:                return false;
228:            }
229:
230:            /*
231:             * (non-Javadoc)
232:             * 
233:             * @see org.eclipse.jface.action.IContributionItem#saveWidgetState()
234:             */
235:            public void saveWidgetState() {
236:                // Do nothing.
237:
238:            }
239:
240:            /*
241:             * (non-Javadoc)
242:             * 
243:             * @see org.eclipse.jface.action.IContributionItem#setParent(org.eclipse.jface.action.IContributionManager)
244:             */
245:            public void setParent(IContributionManager parent) {
246:                // Do nothing
247:
248:            }
249:
250:            /*
251:             * (non-Javadoc)
252:             * 
253:             * @see org.eclipse.jface.action.IContributionItem#setVisible(boolean)
254:             */
255:            public void setVisible(boolean visible) {
256:                // Do nothing.
257:            }
258:
259:            /**
260:             * Displays a string representation of this contribution item, which is
261:             * really just a function of its identifier.
262:             */
263:            public String toString() {
264:                return "PlaceholderContributionItem(" + id + ")"; //$NON-NLS-1$//$NON-NLS-2$
265:            }
266:
267:            /*
268:             * (non-Javadoc)
269:             * 
270:             * @see org.eclipse.jface.action.IContributionItem#update()
271:             */
272:            public void update() {
273:                update(null);
274:
275:            }
276:
277:            /*
278:             * (non-Javadoc)
279:             * 
280:             * @see org.eclipse.jface.action.IContributionItem#update(java.lang.String)
281:             */
282:            public void update(String identifier) {
283:                // Do nothing
284:            }
285:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.