Source Code Cross Referenced for ReferenceProviderDescriptor.java in  » IDE-Eclipse » ui-workbench » org » eclipse » ui » texteditor » quickdiff » 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.texteditor.quickdiff 
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.texteditor.quickdiff;
011:
012:        import org.osgi.framework.Bundle;
013:
014:        import org.eclipse.core.runtime.Assert;
015:        import org.eclipse.core.runtime.CoreException;
016:        import org.eclipse.core.runtime.IConfigurationElement;
017:        import org.eclipse.core.runtime.Platform;
018:
019:        /**
020:         * Describes an extension to the <code>quickdiff.referenceprovider</code> extension point.
021:         *
022:         * @see org.eclipse.ui.internal.texteditor.quickdiff.ReferenceSelectionAction
023:         * @see QuickDiff
024:         * @since 3.0
025:         */
026:        public class ReferenceProviderDescriptor {
027:
028:            /** Name of the <code>label</code> attribute. */
029:            private static final String LABEL_ATTRIBUTE = "label"; //$NON-NLS-1$
030:            /** Name of the <code>class</code> attribute. */
031:            private static final String CLASS_ATTRIBUTE = "class"; //$NON-NLS-1$
032:            /** Name of the <code>id</code> attribute. */
033:            private static final String ID_ATTRIBUTE = "id"; //$NON-NLS-1$
034:            /** Name of the <code>default</code> attribute. */
035:            private static final String DEFAULT_ATTRIBUTE = "default"; //$NON-NLS-1$
036:
037:            /** The configuration element describing this extension. */
038:            private IConfigurationElement fConfiguration;
039:            /** The value of the <code>label</code> attribute, if read. */
040:            private String fLabel;
041:            /** The value of the <code>id</code> attribute, if read. */
042:            private String fId;
043:            /** The value of the <code>default</code> attribute, if read. */
044:            private Boolean fDefault;
045:            /** The bundle where this extension was defined. */
046:            private Bundle fBundle;
047:
048:            /**
049:             * Creates a new descriptor for <code>element</code>.
050:             * <p>
051:             * This method is for internal use only.
052:             * </p>
053:             *
054:             * @param element the extension point element to be described.
055:             */
056:            public ReferenceProviderDescriptor(IConfigurationElement element) {
057:                Assert.isLegal(element != null);
058:                fConfiguration = element;
059:            }
060:
061:            /**
062:             * Reads (if needed) and returns the label of this extension.
063:             *
064:             * @return the label for this extension.
065:             */
066:            public String getLabel() {
067:                if (fLabel == null) {
068:                    fLabel = fConfiguration.getAttribute(LABEL_ATTRIBUTE);
069:                    Assert.isNotNull(fLabel);
070:                }
071:                return fLabel;
072:            }
073:
074:            /**
075:             * Reads (if needed) and returns the id of this extension.
076:             *
077:             * @return the id for this extension.
078:             */
079:            public String getId() {
080:                if (fId == null) {
081:                    fId = fConfiguration.getAttribute(ID_ATTRIBUTE);
082:                    Assert.isNotNull(fId);
083:                }
084:                return fId;
085:            }
086:
087:            /**
088:             * Creates a reference provider as described in the extension's xml. Sets the id on the provider.
089:             * @return a new instance of the reference provider described by this descriptor.
090:             */
091:            public IQuickDiffReferenceProvider createProvider() {
092:                try {
093:                    IQuickDiffReferenceProvider impl = (IQuickDiffReferenceProvider) fConfiguration
094:                            .createExecutableExtension(CLASS_ATTRIBUTE);
095:                    impl.setId(getId());
096:                    return impl;
097:                } catch (CoreException e) {
098:                    return null;
099:                }
100:            }
101:
102:            /**
103:             * States whether the plug-in declaring this extension has been loaded already.
104:             *
105:             * @return <code>true</code> if the extension point's plug-in has been loaded, <code>false</code> otherwise.
106:             */
107:            public boolean isPluginLoaded() {
108:                if (fBundle == null)
109:                    fBundle = Platform.getBundle(fConfiguration
110:                            .getContributor().getName());
111:                return (fBundle != null && fBundle.getState() == Bundle.ACTIVE);
112:            }
113:
114:            /**
115:             * Reads (if needed) and returns the default attribute value of this extension.
116:             *
117:             * @return the default attribute value for this extension.
118:             * @deprecated as of 3.2, the default flag should not be used any longer
119:             */
120:            public boolean getDefault() {
121:                if (fDefault == null) {
122:                    String def = fConfiguration.getAttribute(DEFAULT_ATTRIBUTE);
123:                    if ("true".equalsIgnoreCase(def)) //$NON-NLS-1$
124:                        fDefault = Boolean.TRUE;
125:                    else
126:                        fDefault = Boolean.FALSE;
127:                }
128:                return fDefault.booleanValue();
129:            }
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.