Source Code Cross Referenced for ClasspathFixProcessor.java in  » IDE-Eclipse » jdt » org » eclipse » jdt » ui » text » java » 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 » jdt » org.eclipse.jdt.ui.text.java 
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.jdt.ui.text.java;
011:
012:        import org.eclipse.core.runtime.CoreException;
013:        import org.eclipse.core.runtime.IPath;
014:        import org.eclipse.core.runtime.IProgressMonitor;
015:        import org.eclipse.core.runtime.MultiStatus;
016:
017:        import org.eclipse.swt.graphics.Image;
018:
019:        import org.eclipse.ltk.core.refactoring.Change;
020:
021:        import org.eclipse.jdt.core.IClasspathEntry;
022:        import org.eclipse.jdt.core.IJavaProject;
023:        import org.eclipse.jdt.core.JavaConventions;
024:        import org.eclipse.jdt.core.JavaModelException;
025:
026:        import org.eclipse.jdt.internal.corext.refactoring.changes.ClasspathChange;
027:
028:        import org.eclipse.jdt.internal.ui.text.correction.ClasspathFixProcessorDescriptor;
029:
030:        /**
031:         * Class to be implemented by contributors to the extension point
032:         * <code>org.eclipse.jdt.ui.classpathFixProcessors</code>.
033:         * 
034:         * <strong>EXPERIMENTAL</strong> This class or interface has been added as part
035:         * of a work in progress. We are interested in feedback (bug 196141) . This API may still change. 
036:         * 
037:         * @since 3.4
038:         */
039:        public abstract class ClasspathFixProcessor {
040:
041:            /**
042:             * A proposal to fix a class path issue.
043:             */
044:            public static abstract class ClasspathFixProposal {
045:
046:                /**
047:                 * A helper method to create a {@link Change} that modifies a class path. 
048:                 * 
049:                 * @param project the project to change
050:                 * @param newClasspath the new class path
051:                 * @param outputLocation the new output location
052:                 * 
053:                 * @return the {@link Change} to change the class path or <code>null</code> if the class path is
054:                 * not valid (See {@link JavaConventions#validateClasspath(IJavaProject, IClasspathEntry[], IPath)}).
055:                 */
056:                public static Change newClasspathChange(IJavaProject project,
057:                        IClasspathEntry[] newClasspath, IPath outputLocation) {
058:                    return ClasspathChange.newChange(project, newClasspath,
059:                            outputLocation);
060:                }
061:
062:                /**
063:                 * A helper method to create a {@link Change} that adds an entry to the class path. 
064:                 * 
065:                 * @param project the project to change
066:                 * @param entryToAdd the entry to add to the class path
067:                 * 
068:                 * @return the {@link Change} to change the class path or <code>null</code> if the class path is
069:                 * not valid (See {@link JavaConventions#validateClasspath(IJavaProject, IClasspathEntry[], IPath)}).
070:                 * @throws JavaModelException thrown if accessing the project failed. 
071:                 */
072:                public static Change newAddClasspathChange(
073:                        IJavaProject project, IClasspathEntry entryToAdd)
074:                        throws JavaModelException {
075:                    return ClasspathChange.addEntryChange(project, entryToAdd);
076:                }
077:
078:                /**
079:                 * Returns the change to invoke when the proposal is selected.
080:                 * 
081:                 * @param monitor the progress monitor
082:                 * @return the change
083:                 * @throws CoreException thrown when the creation of the change failed 
084:                 */
085:                public abstract Change createChange(IProgressMonitor monitor)
086:                        throws CoreException;
087:
088:                /**
089:                 * Returns the string to be displayed in a list of proposals.
090:                 *
091:                 * @return the string to be displayed
092:                 */
093:                public abstract String getDisplayString();
094:
095:                /**
096:                 * Returns optional additional information about the proposal. The additional information will
097:                 * be presented to assist the user in deciding if the selected proposal is the desired choice.
098:                 * 
099:                 * @return the additional information or <code>null</code>
100:                 */
101:                public abstract String getAdditionalProposalInfo();
102:
103:                /**
104:                 * Returns the image to be displayed in the list of completion proposals.
105:                 * The image would typically be shown to the left of the display string.
106:                 *
107:                 * @return the image to be shown or <code>null</code> if no image is desired
108:                 */
109:                public abstract Image getImage();
110:
111:                /**
112:                 * Returns the relevance of this completion proposal.
113:                 * <p>
114:                 * The relevance is used to determine if this proposal is more
115:                 * relevant than another proposal.</p>
116:                 *
117:                 * @return the relevance of this completion proposal in the range of [0, 100]
118:                 */
119:                public abstract int getRelevance();
120:            }
121:
122:            /**
123:             * Returns proposal that can fix non-resolvable imports.
124:             * 
125:             * @param project the current project
126:             * @param name the missing type to be added to the class path. The entries can be either a
127:             *  <ul><li>qualified type name, like 'junit.framework.Test'</li>
128:             *  <li>simple type name, like 'TestCase'</li>
129:             *  <li>on demand import name, like 'org.junit.*'</li></ul>
130:             * @return returns proposals to fix the class path so that the missing types are found. If no proposals can be offered,
131:             * either <code>null</code> or the empty array can be returned. If <code>null</code> is returned, also the processors
132:             * overridden by this processor are asked. If a non null result is returned, all overridden processors are skipped.
133:             * 
134:             * @throws CoreException thrown when the creation of the proposals fails
135:             */
136:            public abstract ClasspathFixProposal[] getFixImportProposals(
137:                    IJavaProject project, String name) throws CoreException;
138:
139:            /**
140:             * Evaluates all contributed proposals that can fix non-resolvable imports.
141:             * 
142:             * @param project the current project
143:             * @param name the missing type to be added to the class path. The entries can be either a
144:             *  <ul><li>qualified type name, like 'junit.framework.Test'</li>
145:             *  <li>simple type name, like 'TestCase'</li>
146:             *  <li>on demand import name, like 'org.junit.*'</li></ul>
147:             * @param status a {@link MultiStatus} to collect the resulting status or <code>null</code> to not collect status.
148:             * @return returns proposals to fix the class path so that the missing types are found. 
149:             */
150:            public static ClasspathFixProposal[] getContributedFixImportProposals(
151:                    IJavaProject project, String name, MultiStatus status) {
152:                return ClasspathFixProcessorDescriptor.getProposals(project,
153:                        name, status);
154:            }
155:
156:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.