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


001:        /*******************************************************************************
002:         * Copyright (c) 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:         ******************************************************************************/package org.eclipse.ui.menus;
011:
012:        import org.eclipse.jface.resource.ImageDescriptor;
013:        import org.eclipse.ui.IWorkbench;
014:        import org.eclipse.ui.IWorkbenchPartSite;
015:        import org.eclipse.ui.IWorkbenchWindow;
016:        import org.eclipse.ui.services.IServiceLocator;
017:
018:        /**
019:         * Allow a command or application to provide feedback to a user through updating
020:         * a MenuItem or ToolItem. Initially used to update properties for UI elements
021:         * created by the CommandContributionItem.
022:         * <p>
023:         * This class may be extended by clients.
024:         * </p>
025:         * 
026:         * @since 3.3
027:         */
028:        public abstract class UIElement {
029:
030:            private IServiceLocator serviceLocator;
031:
032:            /**
033:             * Construct a new instance of this class keyed off of the provided service
034:             * locator.
035:             * 
036:             * @param serviceLocator
037:             *            the locator. May not be <code>null</code>.
038:             */
039:            protected UIElement(IServiceLocator serviceLocator)
040:                    throws IllegalArgumentException {
041:                if (serviceLocator == null)
042:                    throw new IllegalArgumentException();
043:                this .serviceLocator = serviceLocator;
044:            }
045:
046:            /**
047:             * Update the label on this UI element.
048:             * 
049:             * @param text
050:             *            The new label to display.
051:             */
052:            public abstract void setText(String text);
053:
054:            /**
055:             * Update the tooltip on this UI element. Tooltips are currently only valid
056:             * for toolbar contributions.
057:             * 
058:             * @param text
059:             *            The new tooltip to display.
060:             */
061:            public abstract void setTooltip(String text);
062:
063:            /**
064:             * Update the icon on this UI element.
065:             * 
066:             * @param desc
067:             *            The descriptor for the new icon to display.
068:             */
069:            public abstract void setIcon(ImageDescriptor desc);
070:
071:            /**
072:             * Update the disabled icon on this UI element.
073:             * 
074:             * @param desc
075:             *            The descriptor for the new icon to display.
076:             */
077:            public abstract void setDisabledIcon(ImageDescriptor desc);
078:
079:            /**
080:             * Update the hover icon on this UI element.
081:             * 
082:             * @param desc
083:             *            The descriptor for the new icon to display.
084:             */
085:            public abstract void setHoverIcon(ImageDescriptor desc);
086:
087:            /**
088:             * Update the checked state on this UI element. For example, if this was a
089:             * toggle or radio button.
090:             * 
091:             * @param checked
092:             *            true to set toggle on
093:             */
094:            public abstract void setChecked(boolean checked);
095:
096:            /**
097:             * Get the service locator scope in which this UI element resides. May not
098:             * be <code>null</code>.
099:             * 
100:             * <p>
101:             * The locator may be used to obtain services that are scoped in the same
102:             * way as the {@link UIElement}. Such services include but are not limited
103:             * to {@link IWorkbench}, {@link IWorkbenchWindow}, and
104:             * {@link IWorkbenchPartSite}. While this method may not return
105:             * <code>null</code> requests for any of these particular services may
106:             * return <code>null</code>.
107:             * </p>
108:             * 
109:             * @return the service locator for this element
110:             * @see IServiceLocator#getService(Class)
111:             */
112:            public final IServiceLocator getServiceLocator() {
113:                return serviceLocator;
114:            }
115:
116:            /**
117:             * Set the menu contribution id to use. This is only applicable to menu
118:             * contributions that support a drop-down style menu. The default
119:             * implementation does nothing.
120:             * <p>
121:             * Example: element.setDropdownId("org.eclipse.ui.navigate.back.my.menu");
122:             * </p>
123:             * 
124:             * @param id
125:             *            used to populate the dropdown menu. Must not be
126:             *            <code>null</code>.
127:             */
128:            public void setDropDownId(String id) {
129:                // This does nothing.
130:            }
131:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.