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.pde.core.plugin;
011:
012: import org.eclipse.core.runtime.CoreException;
013:
014: /**
015: * The class that implements this interface represents a
016: * reference to the library that is defined in the plug-in
017: * manifest.
018: */
019: public interface IPluginLibrary extends IPluginObject {
020: /**
021: * A name of the property that will be used to
022: * notify about changes of the "exported" field.
023: */
024: String P_EXPORTED = "export"; //$NON-NLS-1$
025: /**
026: * A name of the property that will be used to
027: * notify about changes in the content filters.
028: */
029: String P_PACKAGES = "packages"; //$NON-NLS-1$
030:
031: /**
032: * A name of the property that will be used to
033: * notify about changes in the content filters.
034: */
035: String P_CONTENT_FILTERS = "contentFilters"; //$NON-NLS-1$
036: /**
037: * A name of the property that will be used to
038: * notify about of the 'type' field.
039: */
040: String P_TYPE = "type"; //$NON-NLS-1$
041: /**
042: * A library type indicating the library contains code.
043: */
044: String CODE = "code"; //$NON-NLS-1$
045: /**
046: * A library type indicating the library contains resource files.
047: */
048: String RESOURCE = "resource"; //$NON-NLS-1$
049:
050: /**
051: * Returns optional context filters that
052: * should be applied to calculate what classes
053: * to export from this library.
054: *
055: * @return an array of content filter strings
056: */
057: String[] getContentFilters();
058:
059: /**
060: * Returns optional package prefixes that can be used
061: * to make library lookup faster..
062: *
063: * @return an array of package prefixes
064: */
065: String[] getPackages();
066:
067: /**
068: * Returns true if this library contains types
069: * that will be visible to other plug-ins.
070: *
071: * @return true if there are exported types in the library
072: */
073: boolean isExported();
074:
075: /**
076: * Returns true if all the types in this library
077: * will be visible to other plug-ins.
078: *
079: * @return true if all the types are exported
080: * in the library
081: */
082: boolean isFullyExported();
083:
084: /**
085: * Returns a type of this library (CODE or RESOURCE)
086: */
087: String getType();
088:
089: /**
090: * Sets the optional content filters for
091: * this library. This method may throw
092: * a CoreException if the model is not
093: * editable.
094: *
095: * @param filters an array of filter strings
096: */
097: void setContentFilters(String[] filters) throws CoreException;
098:
099: /**
100: * Export a particular package in a library.
101: * This method may throw a CoreException if
102: * the model is not editable.
103: *
104: * @param filter a package name
105: */
106: void addContentFilter(String filter) throws CoreException;
107:
108: /**
109: * Remove a package from the export list.
110: * This method may throw a CoreException if
111: * the model is not editable.
112: *
113: * @param filter a package name
114: */
115: void removeContentFilter(String filter) throws CoreException;
116:
117: /**
118: * Sets the optional package prefixes for this library.
119: * This method may throw a CoreException if the model is not
120: * editable.
121: *
122: * @param packages an array of package prefixes
123: */
124: void setPackages(String[] packages) throws CoreException;
125:
126: /**
127: * Sets whether types in this library will be
128: * visible to other plug-ins. This method
129: * may throw a CoreException if the model is
130: * not editable.
131: */
132: void setExported(boolean value) throws CoreException;
133:
134: /**
135: * Sets the library type. Must be either CODE or RESOURCE.
136: * @throws CoreException if the model is not editable.
137: */
138: void setType(String type) throws CoreException;
139: }
|