Source Code Cross Referenced for BundleGroupProperties.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) 2004, 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 java.net.URL;
013:
014:        import org.eclipse.core.runtime.IBundleGroup;
015:        import org.eclipse.jface.resource.ImageDescriptor;
016:        import org.eclipse.ui.branding.IBundleGroupConstants;
017:
018:        /**
019:         * A class that converts the strings returned by
020:         * <code>org.eclipse.core.runtime.IBundleGroup.getProperty</code> to the
021:         * appropriate class. This implementation is tightly bound to the properties
022:         * provided in IBundleGroupConstants. Clients adding their own properties could
023:         * choose to subclass this.
024:         * 
025:         * @see org.eclipse.ui.branding.IBundleGroupConstants
026:         * @since 3.0
027:         */
028:        public class BundleGroupProperties extends BrandingProperties implements 
029:                IBundleGroupConstants {
030:
031:            private final IBundleGroup bundleGroup;
032:
033:            private ImageDescriptor featureImageDescriptor;
034:
035:            private URL featureImageUrl;
036:
037:            private String tipsAndTricksHref;
038:
039:            private URL welcomePageUrl;
040:
041:            private String welcomePerspective;
042:
043:            private URL licenseUrl;
044:
045:            private String featureLabel;
046:
047:            private String featureId;
048:
049:            private String providerName;
050:
051:            private String versionId;
052:
053:            /**
054:             * This instance will return properties from the given bundle group.  The properties are
055:             * retrieved in a lazy fashion and cached for later retrieval.
056:             * @param bundleGroup must not be null
057:             */
058:            public BundleGroupProperties(IBundleGroup bundleGroup) {
059:                if (bundleGroup == null) {
060:                    throw new IllegalArgumentException();
061:                }
062:                this .bundleGroup = bundleGroup;
063:            }
064:
065:            /**
066:             * An image which can be shown in an "about features" dialog (32x32).
067:             */
068:            public ImageDescriptor getFeatureImage() {
069:                if (featureImageDescriptor == null) {
070:                    featureImageDescriptor = getFeatureImage(bundleGroup);
071:                }
072:                return featureImageDescriptor;
073:            }
074:
075:            /**
076:             * The URL to an image which can be shown in an "about features" dialog (32x32).
077:             */
078:            public URL getFeatureImageUrl() {
079:                if (featureImageUrl == null) {
080:                    featureImageUrl = getFeatureImageUrl(bundleGroup);
081:                }
082:                return featureImageUrl;
083:            }
084:
085:            /**
086:             * A help reference for the feature's tips and tricks page (optional).
087:             */
088:            public String getTipsAndTricksHref() {
089:                if (tipsAndTricksHref == null) {
090:                    tipsAndTricksHref = getTipsAndTricksHref(bundleGroup);
091:                }
092:                return tipsAndTricksHref;
093:            }
094:
095:            /**
096:             * A URL for the feature's welcome page (special XML-based format) ($nl$/
097:             * prefix to permit locale-specific translations of entire file). Products
098:             * designed to run "headless" typically would not have such a page.
099:             */
100:            public URL getWelcomePageUrl() {
101:                if (welcomePageUrl == null) {
102:                    welcomePageUrl = getWelcomePageUrl(bundleGroup);
103:                }
104:                return welcomePageUrl;
105:            }
106:
107:            /**
108:             * The id of a perspective in which to show the welcome page (optional).
109:             */
110:            public String getWelcomePerspective() {
111:                if (welcomePerspective == null) {
112:                    welcomePerspective = getWelcomePerspective(bundleGroup);
113:                }
114:                return welcomePerspective;
115:            }
116:
117:            /**
118:             * A URL for the feature's license page.
119:             */
120:            public URL getLicenseUrl() {
121:                if (licenseUrl == null) {
122:                    licenseUrl = getLicenseUrl(bundleGroup);
123:                }
124:                return licenseUrl;
125:            }
126:
127:            /**
128:             * Returns a label for the feature plugn, or <code>null</code>.
129:             */
130:            public String getFeatureLabel() {
131:                if (featureLabel == null) {
132:                    featureLabel = getFeatureLabel(bundleGroup);
133:                }
134:                return featureLabel;
135:            }
136:
137:            /**
138:             * Returns the id for this bundleGroup.
139:             */
140:            public String getFeatureId() {
141:                if (featureId == null) {
142:                    featureId = getFeatureId(bundleGroup);
143:                }
144:                return featureId;
145:            }
146:
147:            /**
148:             * Returns the provider name.
149:             */
150:            public String getProviderName() {
151:                if (providerName == null) {
152:                    providerName = getProviderName(bundleGroup);
153:                }
154:                return providerName;
155:            }
156:
157:            /**
158:             * Returns the feature version id.
159:             */
160:            public String getFeatureVersion() {
161:                if (versionId == null) {
162:                    versionId = getFeatureVersion(bundleGroup);
163:                }
164:                return versionId;
165:            }
166:
167:            /**
168:             * An image which can be shown in an "about features" dialog (32x32).
169:             */
170:            public static ImageDescriptor getFeatureImage(
171:                    IBundleGroup bundleGroup) {
172:                return getImage(bundleGroup.getProperty(FEATURE_IMAGE), null);
173:            }
174:
175:            /**
176:             * The URL to an image which can be shown in an "about features" dialog (32x32).
177:             */
178:            public static URL getFeatureImageUrl(IBundleGroup bundleGroup) {
179:                return getUrl(bundleGroup.getProperty(FEATURE_IMAGE), null);
180:            }
181:
182:            /**
183:             * A help reference for the feature's tips and tricks page (optional).
184:             */
185:            public static String getTipsAndTricksHref(IBundleGroup bundleGroup) {
186:                return bundleGroup.getProperty(TIPS_AND_TRICKS_HREF);
187:            }
188:
189:            /**
190:             * A URL for the feature's welcome page (special XML-based format) ($nl$/
191:             * prefix to permit locale-specific translations of entire file). Products
192:             * designed to run "headless" typically would not have such a page.
193:             */
194:            public static URL getWelcomePageUrl(IBundleGroup bundleGroup) {
195:                return getUrl(bundleGroup.getProperty(WELCOME_PAGE), null);
196:            }
197:
198:            /**
199:             * The id of a perspective in which to show the welcome page (optional).
200:             */
201:            public static String getWelcomePerspective(IBundleGroup bundleGroup) {
202:                String property = bundleGroup.getProperty(WELCOME_PERSPECTIVE);
203:                return property == null ? null : property;
204:            }
205:
206:            /**
207:             * A URL for the feature's license page.
208:             */
209:            public static URL getLicenseUrl(IBundleGroup bundleGroup) {
210:                return getUrl(bundleGroup.getProperty(LICENSE_HREF), null);
211:            }
212:
213:            /**
214:             * Returns a label for the feature plugn, or <code>null</code>.
215:             */
216:            public static String getFeatureLabel(IBundleGroup bundleGroup) {
217:                return bundleGroup.getName();
218:            }
219:
220:            /**
221:             * Returns the id for this bundleGroup.
222:             */
223:            public static String getFeatureId(IBundleGroup bundleGroup) {
224:                return bundleGroup.getIdentifier();
225:            }
226:
227:            /**
228:             * Returns the provider name.
229:             */
230:            public static String getProviderName(IBundleGroup bundleGroup) {
231:                return bundleGroup.getProviderName();
232:            }
233:
234:            /**
235:             * Returns the feature version id.
236:             */
237:            public static String getFeatureVersion(IBundleGroup bundleGroup) {
238:                return bundleGroup.getVersion();
239:            }
240:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.