public final class JavaProject extends HashStructureAdapter
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASSPATH_PROPERTY |
static java.lang.String |
DEFAULT_PACKAGE |
static java.lang.String |
DOCPATH_PROPERTY |
static java.lang.String |
EXT |
static java.lang.String |
OUTPUT_DIRECTORY |
static java.lang.String |
OUTPUT_DIRECTORY_LOCAL_KEY |
static java.lang.String |
PROJECT_SOURCEPATH_PROPERTY |
static java.lang.String |
SOURCEPATH_PROPERTY |
static int |
SRC_PATH_ADD
Source path has been added.
|
static int |
SRC_PATH_CANCEL_ADD
User indicated that the source path should not be added.
|
static int |
SRC_PATH_EXIST
No source path has been added since the source path already exists.
|
static int |
SRC_PATH_NOT_ADDED
Source path not added because source path is invalid.
|
_hash
Modifier and Type | Method and Description |
---|---|
void |
addToProject(java.util.Collection elements,
boolean askToAdd)
Adds the collection of elements to the project.
|
int |
addToProjectSourcePath(JavaSourceNode node)
Attempts to add the package of the incoming JavaSourceNode to the
source path of the project.
|
int |
addToProjectSourcePath(java.net.URL srcURL)
Attempts to add the incoming URL to the source path of the project
IFF the URL is not on any source path yet.
|
int |
addToProjectSourcePath(java.net.URL srcURL,
boolean askToAdd)
Attempts to add the incoming URL to the source path of the project
IFF the URL is not on any source path yet.
|
static boolean |
askDynamicProjectSourcePathUpdate()
Ask the user for permission to update the project source path.
|
static java.lang.String |
generateDefaultPackageName(Project project)
Returns a valid package name based on the project name.
|
static java.lang.String |
generateDefaultPackageName(java.lang.String projectName)
Returns a valid package name based on the project name.
|
java.lang.String |
getDefaultPackage()
Gets the user-specified default package name.
|
static JavaProject |
getInstance(Project project) |
static JavaProject |
getInstance(Project project,
HashStructure hash) |
java.lang.String |
getMostRecentPackage()
Gets the name of the last-used package.
|
java.net.URL |
getOutputDirectory() |
ListStructure |
getRecentPackages()
Gets the list of most-recently used packages.
|
static void |
init()
This method should be considered package-protected.
|
void |
setDefaultPackage(java.lang.String defaultPackage)
Sets the project's default package.
|
void |
setMostRecentPackage(java.lang.String mostRecentPackage)
Sets the name of the last-used package.
|
void |
setOutputDirectory(java.net.URL outputDirectory) |
void |
setRecentPackages(java.util.List pkgs)
Sets the list of most-recently used packages.
|
addStructureChangeListener, containsKey, copyTo, copyToImpl, equals, equalsImpl, findOrCreate, forcedCopyTo, getHashStructure, removeStructureChangeListener, useObjectEquals
public static final java.lang.String EXT
public static final java.lang.String SOURCEPATH_PROPERTY
public static final java.lang.String CLASSPATH_PROPERTY
public static final java.lang.String PROJECT_SOURCEPATH_PROPERTY
public static final java.lang.String DOCPATH_PROPERTY
public static final int SRC_PATH_EXIST
public static final int SRC_PATH_ADD
public static final int SRC_PATH_CANCEL_ADD
public static final int SRC_PATH_NOT_ADDED
public static final java.lang.String OUTPUT_DIRECTORY_LOCAL_KEY
public static final java.lang.String OUTPUT_DIRECTORY
public static final java.lang.String DEFAULT_PACKAGE
public static JavaProject getInstance(Project project)
public static JavaProject getInstance(Project project, HashStructure hash)
public java.net.URL getOutputDirectory()
public void setOutputDirectory(java.net.URL outputDirectory)
public java.lang.String getDefaultPackage()
getMostRecentPackage()
,
setMostRecentPackage(java.lang.String)
public static java.lang.String generateDefaultPackageName(Project project)
project
- the project to use to generate the package namepublic static java.lang.String generateDefaultPackageName(java.lang.String projectName)
projectName
- a project namepublic void setDefaultPackage(java.lang.String defaultPackage)
setMostRecentPackage(java.lang.String)
instead.defaultPackage
- a valid package namegetMostRecentPackage()
,
setMostRecentPackage(java.lang.String)
,
setRecentPackages(java.util.List)
public java.lang.String getMostRecentPackage()
public void setMostRecentPackage(java.lang.String mostRecentPackage)
mostRecentPackage
- the name of the last-used packagepublic ListStructure getRecentPackages()
public void setRecentPackages(java.util.List pkgs)
pkgs
- a list of package namespublic int addToProjectSourcePath(JavaSourceNode node)
node
- A JavaSourceNode which should not be nullpublic int addToProjectSourcePath(java.net.URL srcURL)
srcURL
- An existing directory URL representing a source directorypublic int addToProjectSourcePath(java.net.URL srcURL, boolean askToAdd)
srcURL
- An existing directory URL representing a source directoryaskToAdd
- If true, user will be asked for permission to add to the source pathpublic void addToProject(java.util.Collection elements, boolean askToAdd)
public static boolean askDynamicProjectSourcePathUpdate()
public static void init()