|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpl.edu.agh.cast.project.ProjectUtil
public final class ProjectUtil
Utility methods for operating on projects.
Nested Class Summary | |
---|---|
static class |
ProjectUtil.ProjectOpenStatus
Enumeration of open project result statuses. |
Field Summary | |
---|---|
static String |
PERSISTENCE_PROVIDER_CONFIG_PROPERTY
Project persistence provider config/store file property. |
static String |
PERSISTENCE_PROVIDER_ID_PROPERTY
Project persistence provider id property. |
static String[] |
PROJECT_BAD_CHARS
List of characters that cannot be used in a project name. |
static String |
PROJECT_DISPLAY_NAME_PROPERTY
Project display name property used. |
static String |
PROJECT_ID_PROPERTY
Project id property. |
static String |
PROJECT_VERSION
|
static String |
PROJECT_VERSION_PROPERTY
Project version property. |
Method Summary | |
---|---|
org.eclipse.core.resources.IProject |
changeProjectLocation(String newLocation)
Removes project from workspace and adds project pointed to by newLocation. |
boolean |
closeProject(org.eclipse.core.resources.IProject project)
Closes a project, closing all editors as well. |
org.eclipse.core.resources.IProject |
createAndActivateProject(String projectName,
org.eclipse.core.runtime.IPath location)
Create project of specified name if it does not exists and activates created project. |
org.eclipse.core.resources.IProject |
createProject(String projectName,
org.eclipse.core.runtime.IPath location)
Create project of specified name if it does not exists. |
void |
destroyPersistenceProvider()
Destroys persistence provider for active project. |
String |
escapeName(String name)
Escapes non-standard characters in project's name. |
String |
generateProjectId()
Create unique identifier for the project. |
String |
getDisplayName(org.eclipse.core.resources.IProject project)
Returns project's display name. |
static ProjectUtil |
getInstance()
Returns single, shared instance of ProjectUtil . |
static String |
getProperty(org.eclipse.core.resources.IProject project,
String propertyId)
Reads projects properties using Eclipse Preferences mechanism. |
boolean |
handleExistingProjectAction(String location)
Handles a situation when a project is already opened by another application. |
void |
handleInvalidProjectAction()
Handles a situation when invalid project is given. |
void |
handleMissingProjectFile(String location)
Handles a situation when project location does not contain .project file. |
void |
handleNoProjectAction()
Handles a situation when no project was selected to be opened. |
void |
handlePersistenceProviderInitializationError(org.eclipse.core.resources.IProject project)
Handles a situation when invalid project is given. |
void |
handleWrongProjectLocationAction(String location)
Handles a situation when invalid project location is given. |
void |
init(org.eclipse.core.resources.IProject project)
Initializes the new project. |
void |
initializePersistenceProvider(org.eclipse.core.resources.IProject project)
Initializes persistence provider for given project. |
ProjectUtil.ProjectOpenStatus |
openProject(String location,
boolean force)
Opens existing project from specified directory. |
void |
propertyChange(PropertyChangeEvent evt)
Property change notification. |
void |
removeProject(String projectName,
org.eclipse.core.runtime.IPath location)
|
void |
setDisplayName(org.eclipse.core.resources.IProject project,
String name)
Sets project's display name. |
static void |
setProperty(org.eclipse.core.resources.IProject project,
String propertyId,
String value)
Sets property for given project. |
boolean |
tryOpenRecentProject(MostRecentlyUsedProject mrup)
Tries to open a project described by MostRecentlyUsedProject . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROJECT_VERSION
public static final String[] PROJECT_BAD_CHARS
public static final String PROJECT_DISPLAY_NAME_PROPERTY
public static final String PROJECT_VERSION_PROPERTY
public static final String PROJECT_ID_PROPERTY
public static final String PERSISTENCE_PROVIDER_ID_PROPERTY
public static final String PERSISTENCE_PROVIDER_CONFIG_PROPERTY
Method Detail |
---|
public static String getProperty(org.eclipse.core.resources.IProject project, String propertyId)
project
- project which properties are readpropertyId
- id of property to read
public static void setProperty(org.eclipse.core.resources.IProject project, String propertyId, String value)
project
- project which property is to be setpropertyId
- property idvalue
- new value of propertypublic static ProjectUtil getInstance()
ProjectUtil
.
ProjectUtil
public String getDisplayName(org.eclipse.core.resources.IProject project)
project
- the project
public void setDisplayName(org.eclipse.core.resources.IProject project, String name)
project
- the projectname
- project's display namepublic String escapeName(String name)
name
- name to escape
public org.eclipse.core.resources.IProject createProject(String projectName, org.eclipse.core.runtime.IPath location) throws org.eclipse.core.runtime.CoreException
projectName
- name of the projectlocation
- location of the project
org.eclipse.core.runtime.CoreException
public void init(org.eclipse.core.resources.IProject project) throws org.eclipse.core.runtime.CoreException
project
- the new project
org.eclipse.core.runtime.CoreException
public org.eclipse.core.resources.IProject createAndActivateProject(String projectName, org.eclipse.core.runtime.IPath location) throws org.eclipse.core.runtime.CoreException
projectName
- name of the projectlocation
- location of the project
org.eclipse.core.runtime.CoreException
public ProjectUtil.ProjectOpenStatus openProject(String location, boolean force) throws FileNotFoundException, org.eclipse.core.runtime.CoreException
location
- project location which contains .project
description fileforce
- if true opens project with the same name which exists in the workspace
FileNotFoundException
- if project description file (.project
) is not found in specified location
org.eclipse.core.runtime.CoreException
- if loading description failed. Reasons include:
public org.eclipse.core.resources.IProject changeProjectLocation(String newLocation)
newLocation
- new project location
public String generateProjectId()
public boolean tryOpenRecentProject(MostRecentlyUsedProject mrup)
MostRecentlyUsedProject
.
mrup
- project to open
public boolean closeProject(org.eclipse.core.resources.IProject project)
project
- project to close
public void removeProject(String projectName, org.eclipse.core.runtime.IPath location) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
public boolean handleExistingProjectAction(String location)
location
- location of the project
true
if the project was successfully openedpublic void handleNoProjectAction()
ProjectStartupDialog
is shown.
public void handleWrongProjectLocationAction(String location)
location
- given project locationpublic void handleInvalidProjectAction()
public void handleMissingProjectFile(String location)
.project
file.
location
- project locationpublic void handlePersistenceProviderInitializationError(org.eclipse.core.resources.IProject project)
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)
public void initializePersistenceProvider(org.eclipse.core.resources.IProject project)
project
- the projectpublic void destroyPersistenceProvider()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |