Source Code Cross Referenced for DroolsPluginImages.java in  » Rule-Engine » drolls-Rule-Engine » org » drools » eclipse » 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 » Rule Engine » drolls Rule Engine » org.drools.eclipse 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.drools.eclipse;
002:
003:        /*
004:         * Copyright 2005 JBoss Inc
005:         * 
006:         * Licensed under the Apache License, Version 2.0 (the "License");
007:         * you may not use this file except in compliance with the License.
008:         * You may obtain a copy of the License at
009:         * 
010:         *      http://www.apache.org/licenses/LICENSE-2.0
011:         * 
012:         * Unless required by applicable law or agreed to in writing, software
013:         * distributed under the License is distributed on an "AS IS" BASIS,
014:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015:         * See the License for the specific language governing permissions and
016:         * limitations under the License.
017:         */
018:
019:        import java.net.MalformedURLException;
020:        import java.net.URL;
021:
022:        import org.eclipse.jface.resource.ImageDescriptor;
023:        import org.eclipse.jface.resource.ImageRegistry;
024:        import org.eclipse.swt.graphics.Image;
025:
026:        /**
027:         * Handles the images used in this plugin.
028:         * 
029:         * @author <a href="mailto:kris_verlaenen@hotmail.com">kris verlaenen </a>
030:         */
031:        public class DroolsPluginImages {
032:
033:            public static final String IMG_LOGICAL = "ImageLogical";
034:            public static final String IMG_LOGICAL_DISABLED = "ImageLogicalDisabled";
035:            public static final String REFRESH_LOG = "RefreshLog";
036:            public static final String REFRESH_LOG_DISABLED = "RefreshLogDisabled";
037:            public static final String OPEN_LOG = "OpenLog";
038:            public static final String DELETE_LOG = "ClearLog";
039:            public static final String DELETE_LOG_DISABLED = "ClearLogDisabled";
040:            public static final String INSERT = "Insert";
041:            public static final String UPDATE = "Update";
042:            public static final String RETRACT = "RetractO";
043:            public static final String CREATE_ACTIVATION = "CreateActivation";
044:            public static final String CANCEL_ACTIVATION = "CancelActivation";
045:            public static final String EXECUTE_ACTIVATION = "ExecuteActivation";
046:            public static final String CLASS = "Class";
047:            public static final String PACKAGE = "Package";
048:            public static final String METHOD = "Method";
049:            public static final String VARIABLE = "Variable";
050:            public static final String DROOLS = "Drools";
051:            public static final String RULE = "DroolsRule";
052:            public static final String QUERY = "DroolsQuery";
053:            public static final String DSL_EXPRESSION = "DslExpression";
054:            public static final String IMPORT = "Import";
055:            public static final String DSL = "DSL";
056:            public static final String GLOBAL = "Global";
057:            public static final String RULEFLOW = "RuleFlow";
058:
059:            private static ImageRegistry imageRegistry;
060:            private static final String PATH_SUFFIX = "/icons/";
061:            private static final URL ICON_BASE_URL = DroolsEclipsePlugin
062:                    .getDefault().getBundle().getEntry(PATH_SUFFIX);
063:
064:            private static void declareImages() {
065:                declareRegistryImage(IMG_LOGICAL, "logical_structure.gif");
066:                declareRegistryImage(IMG_LOGICAL_DISABLED,
067:                        "logical_structure_disabled.gif");
068:                declareRegistryImage(REFRESH_LOG, "refresh.gif");
069:                declareRegistryImage(REFRESH_LOG_DISABLED,
070:                        "refresh_disabled.gif");
071:                declareRegistryImage(OPEN_LOG, "open.gif");
072:                declareRegistryImage(DELETE_LOG, "clear.gif");
073:                declareRegistryImage(DELETE_LOG_DISABLED, "clear_disabled.gif");
074:                declareRegistryImage(INSERT, "greensquare.GIF");
075:                declareRegistryImage(UPDATE, "yellowsquare.GIF");
076:                declareRegistryImage(RETRACT, "redsquare.GIF");
077:                declareRegistryImage(CREATE_ACTIVATION, "arrowright.GIF");
078:                declareRegistryImage(CANCEL_ACTIVATION, "arrowleft.GIF");
079:                declareRegistryImage(EXECUTE_ACTIVATION, "bluediamond.GIF");
080:                declareRegistryImage(CLASS, "class_obj.gif");
081:                declareRegistryImage(PACKAGE, "package_obj.gif");
082:                declareRegistryImage(METHOD, "methpub_obj.gif");
083:                declareRegistryImage(VARIABLE, "field_private_obj.gif");
084:                declareRegistryImage(DROOLS, "drools.gif");
085:                declareRegistryImage(RULE, "drools-rule.GIF");
086:                declareRegistryImage(QUERY, "drools-query.GIF");
087:                declareRegistryImage(DSL_EXPRESSION, "dsl_expression.gif");
088:                declareRegistryImage(IMPORT, "import.gif");
089:                declareRegistryImage(DSL, "dsl.GIF");
090:                declareRegistryImage(GLOBAL, "field_public_obj.gif");
091:                declareRegistryImage(RULEFLOW, "process.gif");
092:            }
093:
094:            /**
095:             * Declare an Image in the registry table.
096:             * @param key   The key to use when registering the image
097:             * @param path  The path where the image can be found. This path is relative to where
098:             *              this plugin class is found (i.e. typically the packages directory)
099:             */
100:            private final static void declareRegistryImage(String key,
101:                    String path) {
102:                ImageDescriptor desc = ImageDescriptor
103:                        .getMissingImageDescriptor();
104:                try {
105:                    desc = ImageDescriptor.createFromURL(makeIconFileURL(path));
106:                } catch (MalformedURLException e) {
107:                    DroolsEclipsePlugin.log(e);
108:                }
109:                imageRegistry.put(key, desc);
110:            }
111:
112:            /**
113:             * Returns the ImageRegistry.
114:             */
115:            public static ImageRegistry getImageRegistry() {
116:                if (imageRegistry == null) {
117:                    initializeImageRegistry();
118:                }
119:                return imageRegistry;
120:            }
121:
122:            public static ImageRegistry initializeImageRegistry() {
123:                imageRegistry = new ImageRegistry();
124:                declareImages();
125:                return imageRegistry;
126:            }
127:
128:            /**
129:             * Returns the <code>Image</code> identified by the given key,
130:             * or <code>null</code> if it does not exist.
131:             */
132:            public static Image getImage(String key) {
133:                return getImageRegistry().get(key);
134:            }
135:
136:            /**
137:             * Returns the <code>ImageDescriptor</code> identified by the given key,
138:             * or <code>null</code> if it does not exist.
139:             */
140:            public static ImageDescriptor getImageDescriptor(String key) {
141:                return getImageRegistry().getDescriptor(key);
142:            }
143:
144:            private static URL makeIconFileURL(String iconPath)
145:                    throws MalformedURLException {
146:                if (ICON_BASE_URL == null) {
147:                    throw new MalformedURLException();
148:                }
149:
150:                return new URL(ICON_BASE_URL, iconPath);
151:            }
152:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.