Package org.gephi.project.api
Interface Project
-
- All Superinterfaces:
org.openide.util.Lookup.Provider
- All Known Implementing Classes:
ProjectImpl
public interface Project extends org.openide.util.Lookup.ProviderProject interface that internally stores, through its Lookup, various information and workspaces.The lookup is a generic container for any instance, thus modules are free to store and query anything they want to be stored within a project.
- Author:
- Mathieu Bastian
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadd(Object instance)Adds an object to this project.WorkspacegetCurrentWorkspace()Returns the current workspace.FilegetFile()Returns the file associated with this project.StringgetFileName()Returns the filename associated with this project.org.openide.util.LookupgetLookup()Gets any optional object from this project.StringgetName()Returns the name of the project.ProjectMetaDatagetProjectMetadata()Returns the project's metadata.StringgetUniqueIdentifier()Returns the project's unique identifier.WorkspacegetWorkspace(int id)Retrieve a workspace based on its unique identifier.Collection<Workspace>getWorkspaces()Returns all the workspaces.booleanhasCurrentWorkspace()Returns true if the project has a current workspace.booleanhasFile()Returns true if the project is associated with a file.booleanisClosed()Returns true if the project is closed.booleanisInvalid()Returns true if the project is invalid.booleanisOpen()Returns true if the project is open.voidremove(Object instance)Removes an object to this project.
-
-
-
Method Detail
-
add
void add(Object instance)
Adds an object to this project.- Parameters:
instance- the instance that is to be added to the lookup
-
remove
void remove(Object instance)
Removes an object to this project.- Parameters:
instance- the instance that is to be removed from the lookup
-
getLookup
org.openide.util.Lookup getLookup()
Gets any optional object from this project.May contains:
ProjectMetaData- Specified by:
getLookupin interfaceorg.openide.util.Lookup.Provider- Returns:
- the project's lookup
-
getCurrentWorkspace
Workspace getCurrentWorkspace()
Returns the current workspace.- Returns:
- current workspace or
nullif no workspace is set.
-
hasCurrentWorkspace
boolean hasCurrentWorkspace()
Returns true if the project has a current workspace.- Returns:
- true if it has a current workspace, false otherwise
-
getWorkspaces
Collection<Workspace> getWorkspaces()
Returns all the workspaces.Returns an empty collection if no workspaces.
- Returns:
- a list of all workspaces, unmodifiable
-
getWorkspace
Workspace getWorkspace(int id)
Retrieve a workspace based on its unique identifier.- Parameters:
id- workspace's unique identifier- Returns:
- found workspace or null if not found
-
isOpen
boolean isOpen()
Returns true if the project is open.- Returns:
- true if open, false otherwise
-
isClosed
boolean isClosed()
Returns true if the project is closed.- Returns:
- true if closed, false otherwise
-
isInvalid
boolean isInvalid()
Returns true if the project is invalid.- Returns:
- true if invalid, false otherwise
-
getName
String getName()
Returns the name of the project.The name can't be null and has a default value (e.g. Project 1).
- Returns:
- the project's name
-
getUniqueIdentifier
String getUniqueIdentifier()
Returns the project's unique identifier.This identifier is assigned at the project creation and is unique.
- Returns:
- the project's unique identifier
-
hasFile
boolean hasFile()
Returns true if the project is associated with a file.A project is associated with a file if it has been saved/loaded to/from a file.
- Returns:
- true if associated with a file, false otherwise
-
getFileName
String getFileName()
Returns the filename associated with this project.Returns an empty string if the project isn't associated with a file.
- Returns:
- file name
- See Also:
hasFile()
-
getFile
File getFile()
Returns the file associated with this project.Returns null if the project isn't associated with a file.
- Returns:
- file or null if none
- See Also:
hasFile()
-
getProjectMetadata
ProjectMetaData getProjectMetadata()
Returns the project's metadata.- Returns:
- project metadata
-
-