Interface ProjectManager

  • All Known Implementing Classes:
    DefaultProjectManager, TestProjectManager

    public interface ProjectManager
    Interface for methods to create, open, and delete projects; maintains a list of known project views that the user opened. It has a handle to the currently opened project. A project can be opened by one user at a time.
    • Field Detail


        static final java.lang.String APPLICATION_TOOL_EXTENSION
        See Also:
        Constant Field Values

        static final java.lang.String APPLICATION_TOOLS_DIR_NAME
        See Also:
        Constant Field Values
    • Method Detail

      • createProject

        Project createProject​(ProjectLocator projectLocator,
                              RepositoryAdapter repAdapter,
                              boolean remember)
        Create a project on the local filesystem.
        projectLocator - location for where the project should be created
        repAdapter - repository adapter if this project is to be a shared project; may be null if the project is not shared.
        remember - if false the new project should not be remembered (i.e., recently opened, etc.)
        the new project
        Throws: - if user cannot access/write the project location
      • getRecentProjects

        ProjectLocator[] getRecentProjects()
        Get list of projects that user most recently opened.
        list of project URLs
      • getRecentViewedProjects[] getRecentViewedProjects()
        Get list of projects that user most recently viewed.
        list of project URLs
      • getActiveProject

        Project getActiveProject()
        Get the project that is currently open.
        currently open project, return null if there is no project opened
      • getLastOpenedProject

        ProjectLocator getLastOpenedProject()
        Get the last opened (active) project.
        project last opened by the user; returns NULL if a project was never opened OR the last opened project is no longer valid
      • setLastOpenedProject

        void setLastOpenedProject​(ProjectLocator projectLocator)
        Set the projectLocator of last opened (active) project; this projectLocator is returned in the getLastOpenedProject() method.
        projectLocator - project location of last project that was opened
      • rememberProject

        void rememberProject​(ProjectLocator projectLocator)
        Keep the projectLocator on the list of known projects.
        projectLocator - project location
      • rememberViewedProject

        void rememberViewedProject​( url)
        Keep the url on the list of known projects.
        url - project identifier
      • forgetViewedProject

        void forgetViewedProject​( url)
        Remove the project url from the list of known viewed projects.
        url - project identifier
      • openProject

        Project openProject​(ProjectLocator projectLocator,
                            boolean doRestore,
                            boolean resetOwner)
                     throws NotFoundException,
        Open a project from the file system. Add the project url to the list of known projects.
        projectLocator - project location
        doRestore - true if the project should be restored
        resetOwner - if true, the owner of the project will be changed to the current user.
        opened project
        NotFoundException - if the file for the project was not found.
        NotOwnerException - if the project owner is not the user
        LockException - if the project is already opened by another user
      • deleteProject

        boolean deleteProject​(ProjectLocator projectLocator)
        Delete the project in the given location.
        projectLocator - project location
        false if no project was deleted.
      • projectExists

        boolean projectExists​(ProjectLocator projectLocator)
        Returns true if a project with the given projectLocator exists.
        projectLocator - project location
      • getRepositoryServerAdapter

        RepositoryServerAdapter getRepositoryServerAdapter​(java.lang.String host,
                                                           int portNumber,
                                                           boolean forceConnect)
        Establish a connection to the given host and port number.
        host - server name or IP address
        portNumber - server port or 0 for default
        forceConnect - if true and currently not connected, an attempt will be be to connect
        a handle to the remote server containing shared repositories
      • getMostRecentServerInfo

        ServerInfo getMostRecentServerInfo()
        Get the information that was last used to access a repository managed by a Ghidra server.
      • getUserToolChest

        ToolChest getUserToolChest()
        Return the user's ToolChest