public class LibraryImpl extends TraceableDisposable implements LibraryEx.ModifiableModelEx, LibraryEx, RootProvider
LibraryEx.ModifiableModelEx
Library.ModifiableModel
Disposable.Parent
RootProvider.RootSetChangedListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ELEMENT |
static java.lang.String |
EXCLUDED_ROOTS_TAG |
static java.lang.String |
LIBRARY_NAME_ATTR |
static java.lang.String |
LIBRARY_TYPE_ATTR |
static java.lang.String |
PROPERTIES_ELEMENT |
static java.lang.String |
ROOT_PATH_ELEMENT |
static java.lang.String |
ROOT_TYPE_ATTR |
EMPTY_ARRAY
Modifier and Type | Method and Description |
---|---|
void |
addExcludedRoot(java.lang.String url)
Add a URL to list of directories excluded from the library.
|
void |
addJarDirectory(java.lang.String url,
boolean recursive) |
void |
addJarDirectory(java.lang.String url,
boolean recursive,
OrderRootType rootType) |
void |
addJarDirectory(VirtualFile file,
boolean recursive) |
void |
addJarDirectory(VirtualFile file,
boolean recursive,
OrderRootType rootType) |
void |
addRoot(java.lang.String url,
OrderRootType rootType) |
void |
addRoot(VirtualFile file,
OrderRootType rootType) |
void |
addRootSetChangedListener(RootProvider.RootSetChangedListener listener) |
void |
addRootSetChangedListener(RootProvider.RootSetChangedListener listener,
Disposable parentDisposable) |
Library |
cloneLibrary(RootModelImpl rootModel) |
void |
commit() |
void |
dispose()
Usually not invoked directly, see class javadoc.
|
boolean |
equals(java.lang.Object o) |
void |
forgetKind()
Removes custom library kind and associated properties if any
|
VirtualFile [] |
getExcludedRoots() |
java.lang.String [] |
getExcludedRootUrls()
Returns URLs of directories under the library roots which are excluded from the library.
|
ProjectModelExternalSource |
getExternalSource()
Return non-null value if this element was automatically created by the IDE during importing from some external project system rather
than created by user manually via UI.
|
VirtualFile [] |
getFiles(OrderRootType rootType) |
java.util.List<java.lang.String> |
getInvalidRootUrls(OrderRootType type) |
PersistentLibraryKind<?> |
getKind() |
LibraryEx.ModifiableModelEx |
getModifiableModel()
As soon as you obtaining modifiable model you will have to commit it or call Disposer.dispose(model)!
|
Module |
getModule() |
java.lang.String |
getName() |
LibraryProperties |
getProperties() |
RootProvider |
getRootProvider() |
Library |
getSource()
In case of modifiable library returns origin library it was created from
|
LibraryTable |
getTable() |
java.lang.String [] |
getUrls(OrderRootType rootType) |
int |
hashCode() |
boolean |
isChanged() |
boolean |
isDisposed() |
boolean |
isJarDirectory(java.lang.String url) |
boolean |
isJarDirectory(java.lang.String url,
OrderRootType rootType) |
boolean |
isValid(java.lang.String url,
OrderRootType rootType) |
void |
moveRootDown(java.lang.String url,
OrderRootType rootType) |
void |
moveRootUp(java.lang.String url,
OrderRootType rootType) |
void |
readExternal(Element element) |
boolean |
removeExcludedRoot(java.lang.String url) |
boolean |
removeRoot(java.lang.String url,
OrderRootType rootType) |
void |
removeRootSetChangedListener(RootProvider.RootSetChangedListener listener) |
void |
restoreKind() |
void |
setKind(PersistentLibraryKind<?> kind) |
void |
setName(java.lang.String name) |
void |
setProperties(LibraryProperties properties) |
java.lang.String |
toString() |
void |
writeExternal(Element rootElement) |
getStackTrace, kill, killExceptionally, throwDisposalError, throwObjectNotDisposedError
public static final java.lang.String LIBRARY_NAME_ATTR
public static final java.lang.String LIBRARY_TYPE_ATTR
public static final java.lang.String ROOT_PATH_ELEMENT
public static final java.lang.String ELEMENT
public static final java.lang.String PROPERTIES_ELEMENT
public static final java.lang.String EXCLUDED_ROOTS_TAG
public static final java.lang.String ROOT_TYPE_ATTR
public void dispose()
Disposable
dispose
in interface Disposable
public boolean isDisposed()
isDisposed
in interface LibraryEx
public java.lang.String getName()
getName
in interface Library
getName
in interface Library.ModifiableModel
public java.lang.String [] getUrls(OrderRootType rootType)
getUrls
in interface Library
getUrls
in interface Library.ModifiableModel
getUrls
in interface RootProvider
public VirtualFile [] getFiles(OrderRootType rootType)
getFiles
in interface Library
getFiles
in interface Library.ModifiableModel
getFiles
in interface RootProvider
public void setName(java.lang.String name)
setName
in interface Library.ModifiableModel
public LibraryEx.ModifiableModelEx getModifiableModel()
Library
getModifiableModel
in interface LibraryEx
getModifiableModel
in interface Library
public Library cloneLibrary(RootModelImpl rootModel)
public java.util.List<java.lang.String> getInvalidRootUrls(OrderRootType type)
getInvalidRootUrls
in interface LibraryEx
public void setProperties(LibraryProperties properties)
setProperties
in interface LibraryEx.ModifiableModelEx
public RootProvider getRootProvider()
getRootProvider
in interface Library
public ProjectModelExternalSource getExternalSource()
ProjectModelElement
getExternalSource
in interface ProjectModelElement
public void readExternal(Element element) throws InvalidDataException
readExternal
in interface JDOMExternalizable
InvalidDataException
public void writeExternal(Element rootElement)
writeExternal
in interface JDOMExternalizable
public PersistentLibraryKind<?> getKind()
getKind
in interface LibraryEx
getKind
in interface LibraryEx.ModifiableModelEx
public void forgetKind()
LibraryEx.ModifiableModelEx
forgetKind
in interface LibraryEx.ModifiableModelEx
public void restoreKind()
restoreKind
in interface LibraryEx.ModifiableModelEx
public void addExcludedRoot(java.lang.String url)
LibraryEx.ModifiableModelEx
url
must be located under some
of the library roots.addExcludedRoot
in interface LibraryEx.ModifiableModelEx
url
- URL of a directory to be excludedLibraryEx.getExcludedRootUrls()
public boolean removeExcludedRoot(java.lang.String url)
removeExcludedRoot
in interface LibraryEx.ModifiableModelEx
public java.lang.String [] getExcludedRootUrls()
LibraryEx
getExcludedRootUrls
in interface LibraryEx
getExcludedRootUrls
in interface LibraryEx.ModifiableModelEx
public VirtualFile [] getExcludedRoots()
getExcludedRoots
in interface LibraryEx
LibraryEx.getExcludedRootUrls()
public LibraryProperties getProperties()
getProperties
in interface LibraryEx
getProperties
in interface LibraryEx.ModifiableModelEx
public void setKind(PersistentLibraryKind<?> kind)
setKind
in interface LibraryEx.ModifiableModelEx
public void addRoot(java.lang.String url, OrderRootType rootType)
addRoot
in interface Library.ModifiableModel
public void addRoot(VirtualFile file, OrderRootType rootType)
addRoot
in interface Library.ModifiableModel
public void addJarDirectory(java.lang.String url, boolean recursive)
addJarDirectory
in interface Library.ModifiableModel
public void addJarDirectory(VirtualFile file, boolean recursive)
addJarDirectory
in interface Library.ModifiableModel
public void addJarDirectory(java.lang.String url, boolean recursive, OrderRootType rootType)
addJarDirectory
in interface Library.ModifiableModel
public void addJarDirectory(VirtualFile file, boolean recursive, OrderRootType rootType)
addJarDirectory
in interface Library.ModifiableModel
public boolean isJarDirectory(java.lang.String url)
isJarDirectory
in interface Library
isJarDirectory
in interface Library.ModifiableModel
public boolean isJarDirectory(java.lang.String url, OrderRootType rootType)
isJarDirectory
in interface Library
isJarDirectory
in interface Library.ModifiableModel
public boolean isValid(java.lang.String url, OrderRootType rootType)
isValid
in interface Library
isValid
in interface Library.ModifiableModel
public boolean removeRoot(java.lang.String url, OrderRootType rootType)
removeRoot
in interface Library.ModifiableModel
public void moveRootUp(java.lang.String url, OrderRootType rootType)
moveRootUp
in interface Library.ModifiableModel
public void moveRootDown(java.lang.String url, OrderRootType rootType)
moveRootDown
in interface Library.ModifiableModel
public boolean isChanged()
isChanged
in interface Library.ModifiableModel
public Library getSource()
LibraryEx
public void commit()
commit
in interface Library.ModifiableModel
public LibraryTable getTable()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void addRootSetChangedListener(RootProvider.RootSetChangedListener listener)
addRootSetChangedListener
in interface RootProvider
public void removeRootSetChangedListener(RootProvider.RootSetChangedListener listener)
removeRootSetChangedListener
in interface RootProvider
public void addRootSetChangedListener(RootProvider.RootSetChangedListener listener, Disposable parentDisposable)
addRootSetChangedListener
in interface RootProvider