public class RootModelManager
extends java.lang.Object
The RootModelManager mitigates this problem by maintaing a file-based cache of known root models that is read in quickly and used to initialize the model menu. Once the menu is created, a background thread is started to update the root model set. When the thread completes, the model menu is updated to reflect any changes.
Modifier and Type | Field and Description |
---|---|
static int |
INCLUDE_HIDDEN |
static int |
RECURSIVE |
static int |
USE_CACHE |
Constructor and Description |
---|
RootModelManager() |
Modifier and Type | Method and Description |
---|---|
boolean |
cacheDiffersFromMain() |
boolean |
cacheDiffersFromMain(java.lang.String pkgName) |
boolean |
compareCacheToMain() |
java.lang.String |
findModelFromSimpleName(java.lang.String simpName)
Try to find the class name of a model given its simple name.
|
java.util.ArrayList<java.lang.String> |
findModels(java.lang.String pkgName,
int flags) |
java.io.File |
getCacheFile() |
java.util.Collection<java.lang.String> |
getKnownPackageNames() |
static java.lang.String |
getLeafName(java.lang.String pathName)
Returns the trailing part of a full package or class name that follows the
last '.'.
|
static java.lang.String |
getParentName(java.lang.String pathName)
Returns the "parent" part of a full package or class name that preceeds
the last '.'.
|
boolean |
hasCache() |
void |
readCacheFile() |
boolean |
saveCacheIfModified() |
void |
setCacheFile(java.io.File file) |
void |
updateModelSet() |
void |
writeCacheFile() |
public static final int RECURSIVE
public static final int USE_CACHE
public static final int INCLUDE_HIDDEN
public static java.lang.String getLeafName(java.lang.String pathName)
public static java.lang.String getParentName(java.lang.String pathName)
public void updateModelSet()
public boolean compareCacheToMain()
public boolean cacheDiffersFromMain()
public boolean cacheDiffersFromMain(java.lang.String pkgName)
public java.lang.String findModelFromSimpleName(java.lang.String simpName)
public java.util.ArrayList<java.lang.String> findModels(java.lang.String pkgName, int flags)
public void setCacheFile(java.io.File file)
public java.io.File getCacheFile()
public void readCacheFile()
public boolean hasCache()
public boolean saveCacheIfModified()
public void writeCacheFile()
public java.util.Collection<java.lang.String> getKnownPackageNames()