KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > corext > buildpath > IClasspathInformationProvider


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.jdt.internal.corext.buildpath;
13
14 import java.util.List JavaDoc;
15
16 import org.eclipse.core.runtime.CoreException;
17 import org.eclipse.core.runtime.IPath;
18
19 import org.eclipse.swt.widgets.Shell;
20
21 import org.eclipse.jface.viewers.IStructuredSelection;
22
23 import org.eclipse.jdt.core.IJavaProject;
24 import org.eclipse.jdt.core.JavaModelException;
25
26 import org.eclipse.jdt.internal.ui.wizards.buildpaths.newsourcepage.ClasspathModifierQueries;
27 import org.eclipse.jdt.internal.ui.wizards.buildpaths.newsourcepage.ClasspathModifierQueries.IAddArchivesQuery;
28 import org.eclipse.jdt.internal.ui.wizards.buildpaths.newsourcepage.ClasspathModifierQueries.IAddLibrariesQuery;
29 import org.eclipse.jdt.internal.ui.wizards.buildpaths.newsourcepage.ClasspathModifierQueries.ICreateFolderQuery;
30 import org.eclipse.jdt.internal.ui.wizards.buildpaths.newsourcepage.ClasspathModifierQueries.IInclusionExclusionQuery;
31 import org.eclipse.jdt.internal.ui.wizards.buildpaths.newsourcepage.ClasspathModifierQueries.ILinkToQuery;
32 import org.eclipse.jdt.internal.ui.wizards.buildpaths.newsourcepage.ClasspathModifierQueries.IOutputLocationQuery;
33 import org.eclipse.jdt.internal.ui.wizards.buildpaths.newsourcepage.ClasspathModifierQueries.IRemoveLinkedFolderQuery;
34 import org.eclipse.jdt.internal.ui.wizards.buildpaths.newsourcepage.ClasspathModifierQueries.OutputFolderQuery;
35
36
37 /**
38  * Interface representing a information provider for
39  * operations. The interface allows the operation to get
40  * information about the current state and to callback on
41  * the provider if the result of an operation needs to be handled.
42  *
43  * @see org.eclipse.jdt.internal.corext.buildpath.ClasspathModifierOperation
44  * @see org.eclipse.jdt.internal.corext.buildpath.CreateFolderOperation
45  * @see org.eclipse.jdt.internal.corext.buildpath.AddSelectedSourceFolderOperation
46  * @see org.eclipse.jdt.internal.corext.buildpath.RemoveFromClasspathOperation
47  * @see org.eclipse.jdt.internal.corext.buildpath.IncludeOperation
48  * @see org.eclipse.jdt.internal.corext.buildpath.UnincludeOperation
49  * @see org.eclipse.jdt.internal.corext.buildpath.ExcludeOperation
50  * @see org.eclipse.jdt.internal.corext.buildpath.UnexcludeOperation
51  * @see org.eclipse.jdt.internal.corext.buildpath.EditFiltersOperation
52  * @see org.eclipse.jdt.internal.corext.buildpath.ResetOperation
53  */

54 public interface IClasspathInformationProvider {
55     public static final int ADD_SEL_SF_TO_BP= 0x00;
56     public static final int REMOVE_FROM_BP= 0x01;
57     public static final int EXCLUDE= 0x02;
58     public static final int UNEXCLUDE= 0x03;
59     public static final int EDIT_FILTERS= 0x04;
60     public static final int CREATE_LINK= 0x05;
61     public static final int RESET_ALL= 0x06;
62     public static final int EDIT_OUTPUT= 0x07;
63     public static final int CREATE_OUTPUT= 0x08;
64     public static final int RESET= 0x09;
65     public static final int INCLUDE= 0xA;
66     public static final int UNINCLUDE= 0xB;
67     public static final int CREATE_FOLDER= 0xC;
68     public static final int ADD_JAR_TO_BP= 0xD;
69     public static final int ADD_LIB_TO_BP= 0xE;
70     public static final int ADD_SEL_LIB_TO_BP= 0xF;
71     
72     /**
73      * Method to invoce the <code>IClasspathInformationProvider</code> to
74      * process the result of the corresponding operation. Normally, operations
75      * call this method at the end of their computation an pass the result
76      * back to the provider.
77      *
78      * @param resultElements the result list of an operation, can be empty
79      * @param exception an exception object in case that an exception occurred,
80      * <code>null</code> otherwise. Note: clients should check the exception
81      * object before processing the result because otherwise, the result might be
82      * incorrect
83      * @param operationType constant to specify which kind of operation was executed;
84      * corresponds to one of the following constants of <code>IClasspathInformationProvider</code>:
85      * <li>CREATE_FOLDER</li>
86      * <li>ADD_TO_BP</li>
87      * <li>REMOVE_FROM_BP</li>
88      * <li>INCLUDE</li>
89      * <li>UNINCLUDE</li>
90      * <li>EXCLUDE</li>
91      * <li>UNEXCLUDE</li>
92      * <li>EDIT</li>
93      * <li>RESET</li>
94      * <li>CREATE_OUTPUT</li>
95      */

96     public void handleResult(List JavaDoc resultElements, CoreException exception, int operationType);
97     
98     /**
99      * Method to retrieve the current list of selected elements of the provider, this is
100      * the objects on which the operation should be executed on.
101      *
102      * For example: if a tree item is selected and an operation should be
103      * executed on behalf of this item, then <code>getSelection()</code>
104      * should return this item.
105      *
106      * @return the current list of selected elements from the provider, must not be
107      * <code>null</code>
108      */

109     public IStructuredSelection getSelection();
110     
111     /**
112      * Method to retrieve the Java project from the provider.
113      *
114      * @return the current Java project, must not be <code>null</code>
115      */

116     public IJavaProject getJavaProject();
117     
118     /**
119      * Method to retrieve an <code>IOutputFolderQuery</code> from
120      * the provider.
121      *
122      * @return an <code>IOutputFolderQuery</code>, must not be
123      * <code>null</code>
124      * @throws JavaModelException
125      *
126      * @see ClasspathModifierQueries#getDefaultFolderQuery(Shell, IPath)
127      */

128     public OutputFolderQuery getOutputFolderQuery() throws JavaModelException;
129     
130     /**
131      * Method to retrieve an <code>IInclusionExclusionQuery</code> from
132      * the provider.
133      *
134      * @return an <code>IInclusionExclusionQuery</code>, must not be
135      * <code>null</code>
136      * @throws JavaModelException
137      *
138      * @see ClasspathModifierQueries#getDefaultInclusionExclusionQuery(Shell)
139      */

140     public IInclusionExclusionQuery getInclusionExclusionQuery() throws JavaModelException;
141     
142     /**
143      * Method to retrieve an <code>IOutputLocationQuery</code> from
144      * the provider.
145      *
146      * @return an <code>IOutputLocationQuery</code>, must not be
147      * <code>null</code>
148      * @throws JavaModelException
149      *
150      * @see ClasspathModifierQueries#getDefaultOutputLocationQuery(Shell, IPath, List)
151      */

152     public IOutputLocationQuery getOutputLocationQuery() throws JavaModelException;
153     
154     /**
155      * Method to retrieve an <code>ILinkToQuery</code> from
156      * the provider.
157      *
158      * @return an <code>ILinkToQuery</code>, must not be
159      * <code>null</code>
160      * @throws JavaModelException
161      *
162      * @see ClasspathModifierQueries#getDefaultCreateFolderQuery(Shell, IJavaProject)
163      */

164     public ILinkToQuery getLinkFolderQuery() throws JavaModelException;
165     
166     /**
167      * Method to retrieve an <code>IRemoveLinkedFolderQuery</code> from
168      * the provider.
169      *
170      * @return an <code>IRemoveLinkedFolderQuery</code>, must not be
171      * <code>null</code>
172      * @throws JavaModelException
173      *
174      * @see ClasspathModifierQueries#getDefaultRemoveLinkedFolderQuery(Shell)
175      */

176     public IRemoveLinkedFolderQuery getRemoveLinkedFolderQuery() throws JavaModelException;
177     
178     /**
179      * Method to retrieve an <code>IAddArchivesQuery</code> from
180      * the provider.
181      *
182      * @return an <code>IAddArchivesQuery</code>, must not be
183      * <code>null</code>
184      * @throws JavaModelException
185      *
186      * @see ClasspathModifierQueries#getDefaultArchivesQuery(Shell)
187      */

188     public IAddArchivesQuery getExternalArchivesQuery() throws JavaModelException;
189     
190     /**
191      * Method to retrieve an <code>IAddLibrariesQuery</code> from
192      * the provider.
193      *
194      * @return an <code>IAddLibrariesQuery</code>, must not be
195      * <code>null</code>
196      * @throws JavaModelException
197      *
198      * @see ClasspathModifierQueries#getDefaultLibrariesQuery(Shell)
199      */

200     public IAddLibrariesQuery getLibrariesQuery() throws JavaModelException;
201
202     /**
203      * Method to retrieve an <code>ICreateFolderQuery</code> from
204      * the provider.
205      *
206      * @return an <code>IFolderCreationQuery</code>, must not be
207      * <code>null</code>
208      * @throws JavaModelException
209      *
210      * @see ClasspathModifierQueries#getDefaultCreateFolderQuery(Shell, IJavaProject)
211      */

212     public ICreateFolderQuery getCreateFolderQuery() throws JavaModelException;
213     
214     /**
215      * Delete all newly created folders and files.
216      * Resources that existed before will not be
217      * deleted. It is assumed that the implementor of
218      * this interface knows which resources have been
219      * created and therefore is also able to remove
220      * all of them.
221      */

222     public void deleteCreatedResources();
223 }
224
Popular Tags