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


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 2005 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.ide.registry;
011:
012:        import java.util.ArrayList;
013:
014:        import org.eclipse.core.runtime.IConfigurationElement;
015:        import org.eclipse.core.runtime.IExtensionRegistry;
016:        import org.eclipse.core.runtime.Platform;
017:        import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
018:
019:        /**
020:         * This class is used to read marker help context ids and 
021:         * resolutions from the platform registry.
022:         */
023:        public class MarkerHelpRegistryReader extends IDERegistryReader {
024:            private MarkerHelpRegistry markerHelpRegistry;
025:
026:            private ArrayList currentAttributeNames;
027:
028:            private ArrayList currentAttributeValues;
029:
030:            private static final String TAG_HELP = "markerHelp";//$NON-NLS-1$
031:
032:            private static final String TAG_RESOLUTION_GENERATOR = "markerResolutionGenerator";//$NON-NLS-1$
033:
034:            private static final String TAG_ATTRIBUTE = "attribute";//$NON-NLS-1$ 
035:
036:            private static final String ATT_TYPE = "markerType";//$NON-NLS-1$
037:
038:            private static final String ATT_NAME = "name";//$NON-NLS-1$
039:
040:            private static final String ATT_VALUE = "value";//$NON-NLS-1$
041:
042:            /**
043:             * Get the marker help that is defined in the plugin registry
044:             * and add it to the given marker help registry.
045:             * <p>
046:             * Warning:
047:             * The marker help registry must be passed in because this 
048:             * method is called during the process of setting up the 
049:             * marker help registry and at this time it has not been
050:             * safely setup with the plugin.
051:             * </p>
052:             */
053:            public void addHelp(MarkerHelpRegistry registry) {
054:                IExtensionRegistry extensionRegistry = Platform
055:                        .getExtensionRegistry();
056:                markerHelpRegistry = registry;
057:                readRegistry(extensionRegistry,
058:                        IDEWorkbenchPlugin.IDE_WORKBENCH,
059:                        IDEWorkbenchPlugin.PL_MARKER_HELP);
060:                readRegistry(extensionRegistry,
061:                        IDEWorkbenchPlugin.IDE_WORKBENCH,
062:                        IDEWorkbenchPlugin.PL_MARKER_RESOLUTION);
063:            }
064:
065:            /**
066:             * Processes one configuration element or child element.
067:             */
068:            protected boolean readElement(IConfigurationElement element) {
069:                if (element.getName().equals(TAG_HELP)) {
070:                    readHelpElement(element);
071:                    return true;
072:                }
073:                if (element.getName().equals(TAG_RESOLUTION_GENERATOR)) {
074:                    readResolutionElement(element);
075:                    return true;
076:                }
077:                if (element.getName().equals(TAG_ATTRIBUTE)) {
078:                    readAttributeElement(element);
079:                    return true;
080:                }
081:                return false;
082:            }
083:
084:            /**
085:             * Processes a help configuration element.
086:             */
087:            private void readHelpElement(IConfigurationElement element) {
088:                // read type
089:                String type = element.getAttribute(ATT_TYPE);
090:
091:                // read attributes and values
092:                currentAttributeNames = new ArrayList();
093:                currentAttributeValues = new ArrayList();
094:                readElementChildren(element);
095:                String[] attributeNames = (String[]) currentAttributeNames
096:                        .toArray(new String[currentAttributeNames.size()]);
097:                String[] attributeValues = (String[]) currentAttributeValues
098:                        .toArray(new String[currentAttributeValues.size()]);
099:
100:                // add query to the registry
101:                MarkerQuery query = new MarkerQuery(type, attributeNames);
102:                MarkerQueryResult result = new MarkerQueryResult(
103:                        attributeValues);
104:                markerHelpRegistry.addHelpQuery(query, result, element);
105:            }
106:
107:            /**
108:             * Processes a resolution configuration element.
109:             */
110:            private void readResolutionElement(IConfigurationElement element) {
111:                // read type
112:                String type = element.getAttribute(ATT_TYPE);
113:
114:                // read attributes and values
115:                currentAttributeNames = new ArrayList();
116:                currentAttributeValues = new ArrayList();
117:                readElementChildren(element);
118:                String[] attributeNames = (String[]) currentAttributeNames
119:                        .toArray(new String[currentAttributeNames.size()]);
120:                String[] attributeValues = (String[]) currentAttributeValues
121:                        .toArray(new String[currentAttributeValues.size()]);
122:
123:                // add query to the registry
124:                MarkerQuery query = new MarkerQuery(type, attributeNames);
125:                MarkerQueryResult result = new MarkerQueryResult(
126:                        attributeValues);
127:                markerHelpRegistry.addResolutionQuery(query, result, element);
128:            }
129:
130:            /**
131:             * Processes an attribute sub element.
132:             */
133:            private void readAttributeElement(IConfigurationElement element) {
134:                String name = element.getAttribute(ATT_NAME);
135:                String value = element.getAttribute(ATT_VALUE);
136:                if (name != null && value != null) {
137:                    currentAttributeNames.add(name);
138:                    currentAttributeValues.add(value);
139:                }
140:            }
141:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.