| OLD | NEW |
| 1 package com.google.dart.tools.core.analysis.model; | 1 package com.google.dart.tools.core.analysis.model; |
| 2 | 2 |
| 3 import com.google.dart.engine.context.AnalysisContext; | 3 import com.google.dart.engine.context.AnalysisContext; |
| 4 import com.google.dart.engine.source.Source; | 4 import com.google.dart.engine.source.Source; |
| 5 | 5 |
| 6 import org.eclipse.core.resources.IContainer; | 6 import org.eclipse.core.resources.IContainer; |
| 7 import org.eclipse.core.resources.IProject; | 7 import org.eclipse.core.resources.IProject; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Instances of {@code Project} represents an Eclipse project that has a Dart na
ture. | 10 * Instances of {@code Project} represents an Eclipse project that has a Dart na
ture. |
| 11 * | 11 * |
| 12 * @coverage dart.tools.core.model | 12 * @coverage dart.tools.core.model |
| 13 */ | 13 */ |
| 14 public interface Project extends ContextManager { | 14 public interface Project extends ContextManager { |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * Discard all analysis contexts in the specified container | 17 * Discard all analysis contexts in the specified container |
| 18 * | 18 * |
| 19 * @param container the container (not {@code null}) | 19 * @param container the container (not {@code null}) |
| 20 */ | 20 */ |
| 21 void discardContextsIn(IContainer container); | 21 void discardContextsIn(IContainer container); |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * Answer the default analysis context. If the receiver contains a {@link PubF
older} which | 24 * Answer the default analysis context. If the receiver contains a {@link PubF
older} which |
| 25 * contains all of the resources contained in the receiver, then the analysis
context for that | 25 * contains all of the resources contained in the receiver, then the analysis
context for that |
| 26 * {@link PubFolder} will be the same the receiver's default analysis context. | 26 * {@link PubFolder} will be the same the receiver's default analysis context. |
| 27 * | 27 * |
| 28 * @return the analysis context (not {@code null}) | 28 * @return the analysis context (not {@code null}) |
| 29 */ | 29 */ |
| 30 AnalysisContext getDefaultContext(); | 30 AnalysisContext getDefaultContext(); |
| 31 | 31 |
| 32 /** | 32 /** |
| 33 * Answer with all the library sources that are in the project. These include
all the sdk and | 33 * Answer with all the library sources that are in the project. These include
all the sdk and |
| 34 * external libraries referenced by code in the project | 34 * external libraries referenced by code in the project |
| 35 * | 35 * |
| 36 * @return the {@link Source}[] for all the libraries that are in the project. | 36 * @return the {@link Source}[] for all the libraries that are in the project. |
| 37 */ | 37 */ |
| 38 Source[] getLibrarySources(); | 38 Source[] getLibrarySources(); |
| 39 | 39 |
| 40 /** | 40 /** |
| 41 * Answer the {@link PubFolder}s contained in the receiver. | 41 * Answer the {@link PubFolder}s contained in the receiver. |
| 42 * | 42 * |
| 43 * @return an array of zero or more folders (not {@code null}, contains no {@c
ode null}s) | 43 * @return an array of zero or more folders (not {@code null}, contains no {@c
ode null}s) |
| 44 */ | 44 */ |
| 45 PubFolder[] getPubFolders(); | 45 PubFolder[] getPubFolders(); |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * Answer the Eclipse project associated with this Dart project | 48 * Answer the Eclipse project associated with this Dart project |
| 49 * | 49 * |
| 50 * @return the Eclipse project (not {@code null}) | 50 * @return the Eclipse project (not {@code null}) |
| 51 */ | 51 */ |
| 52 @Override | 52 @Override |
| 53 IProject getResource(); | 53 IProject getResource(); |
| 54 | 54 |
| 55 /** | 55 /** |
| 56 * Test if the given context is associated with this project. | 56 * Test if the given context is associated with this project. |
| 57 * | 57 * |
| 58 * @param context the context to test | 58 * @param context the context to test |
| 59 * @return {@code true} if the given context is associated with this project | 59 * @return {@code true} if the given context is associated with this project |
| 60 */ | 60 */ |
| 61 boolean isContextInProject(AnalysisContext context); | 61 boolean isContextInProject(AnalysisContext context); |
| 62 | 62 |
| 63 /** | 63 /** |
| 64 * Called when a pubspec file is added | 64 * Called when a pubspec file is added |
| 65 * | 65 * |
| 66 * @param container the container (not {@code null}) to which a pubspec file w
as added | 66 * @param container the container (not {@code null}) to which a pubspec file w
as added |
| 67 */ | 67 */ |
| 68 void pubspecAdded(IContainer container); | 68 void pubspecAdded(IContainer container); |
| 69 | 69 |
| 70 /** | 70 /** |
| 71 * Called when a pubspec file is removed | 71 * Called when a pubspec file is removed |
| 72 * | 72 * |
| 73 * @param container the container (not {@code null}) from which a pubspec file
was removed | 73 * @param container the container (not {@code null}) from which a pubspec file
was removed |
| 74 */ | 74 */ |
| 75 void pubspecRemoved(IContainer container); | 75 void pubspecRemoved(IContainer container); |
| 76 | 76 |
| 77 /** |
| 78 * Resolve the given file path to a package uri path, if any |
| 79 * |
| 80 * @param path the file path for the resource wrt to package structure |
| 81 * @return the package name or {@code null} if resource is not in a package |
| 82 */ |
| 83 String resolvePathToPackage(String path); |
| 84 |
| 77 } | 85 } |
| OLD | NEW |