|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpl.edu.agh.cast.resources.BaseProjectUtil
pl.edu.agh.cast.resources.ProjectUtil
public class ProjectUtil
Utility methods for operating on projects
Nested Class Summary | |
---|---|
static class |
ProjectUtil.NewDiagramInfo
|
Field Summary | |
---|---|
int |
diagramCounter
|
static java.lang.String[] |
PROJECT_NAME_FORBIDDEN_CHARS
|
Fields inherited from class pl.edu.agh.cast.resources.BaseProjectUtil |
---|
PROJECT_DISPLAY_NAME_PROPERTY, PROJECT_ID_PROPERTY |
Method Summary | |
---|---|
org.eclipse.core.resources.IProject |
changeProjectLocation(java.lang.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(java.lang.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(java.lang.String projectName,
org.eclipse.core.runtime.IPath location)
Create project of specified name if it does not exists. |
java.lang.String |
escapeName(java.lang.String name)
|
java.lang.String |
generateProjectId()
Create unique identifier for the project |
java.lang.String |
getDefaultDiagramName()
|
java.util.List<java.lang.String> |
getDiagramNames()
Returns list of names of diagrams contained in project identified by projectName |
java.lang.String |
getDisplayName(org.eclipse.core.resources.IProject project)
|
static ProjectUtil |
getInstance()
|
ProjectUtil.NewDiagramInfo |
getNewDiagramInfo(org.eclipse.core.resources.IProject project)
Returns new IFile for diagram. |
boolean |
handleExistingProjectAction(java.lang.String location)
|
void |
handleMissingProjectFile(java.lang.String location)
|
void |
handleNoProjectAction()
|
void |
handleWrongProjectLocationAction(java.lang.String location)
|
boolean |
openProject(java.lang.String location,
boolean force)
Opens existing project from specified directory |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
Property change notification |
void |
setDisplayName(org.eclipse.core.resources.IProject project,
java.lang.String name)
|
boolean |
tryOpenRecentProject(MostRecentlyUsedProject mrup)
Tries to open a project described by MostRecentlyUsedProject . |
Methods inherited from class pl.edu.agh.cast.resources.BaseProjectUtil |
---|
getProperty, setProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String[] PROJECT_NAME_FORBIDDEN_CHARS
public int diagramCounter
Method Detail |
---|
public static ProjectUtil getInstance()
public java.util.List<java.lang.String> getDiagramNames() throws org.eclipse.core.runtime.CoreException
projectName
- is the name of the project to look in
org.eclipse.core.runtime.CoreException
public java.lang.String getDisplayName(org.eclipse.core.resources.IProject project)
public void setDisplayName(org.eclipse.core.resources.IProject project, java.lang.String name)
public java.lang.String escapeName(java.lang.String name)
public org.eclipse.core.resources.IProject createProject(java.lang.String projectName, org.eclipse.core.runtime.IPath location) throws org.eclipse.core.runtime.CoreException
projectName
-
org.eclipse.core.runtime.CoreException
public org.eclipse.core.resources.IProject createAndActivateProject(java.lang.String projectName, org.eclipse.core.runtime.IPath location) throws org.eclipse.core.runtime.CoreException
projectName
- location
-
org.eclipse.core.runtime.CoreException
public boolean openProject(java.lang.String location, boolean force) throws java.io.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
java.io.FileNotFoundException
- if project description file (.project
) is not
found in specified location
org.eclipse.core.runtime.CoreException
- if loading description failed. Reasons include:
public ProjectUtil.NewDiagramInfo getNewDiagramInfo(org.eclipse.core.resources.IProject project)
project
-
public java.lang.String getDefaultDiagramName()
public org.eclipse.core.resources.IProject changeProjectLocation(java.lang.String newLocation)
newLocation
-
public java.lang.String generateProjectId()
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
public boolean tryOpenRecentProject(MostRecentlyUsedProject mrup)
MostRecentlyUsedProject
.
mrup
- project to open
public boolean closeProject(org.eclipse.core.resources.IProject project)
public boolean handleExistingProjectAction(java.lang.String location)
public void handleNoProjectAction()
public void handleWrongProjectLocationAction(java.lang.String location)
public void handleMissingProjectFile(java.lang.String location)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |