Class UIManager

java.lang.Object
net.bioclipse.managers.UIManager
All Implemented Interfaces:
IBactingManager, net.bioclipse.managers.business.IBioclipseManager

public class UIManager extends Object implements IBactingManager
Bioclipse manager providing core functionality, focusing on the Bioclipse workspace and user interface interaction.
  • Constructor Details

    • UIManager

      public UIManager(String workspaceRoot)
      Creates a new UIManager.
      Parameters:
      workspaceRoot - location of the workspace, e.g. "."
  • Method Details

    • fileExists

      public boolean fileExists(String file)
      Determines if the given file exists in the Bioclipse workspace.
      Parameters:
      file - the location of the file in the Bioclipse workspace
      Returns:
      true, if the file exists
    • newFile

      public String newFile(String path) throws IOException
      Creates a new file in the Bioclipse workspace.
      Parameters:
      path - the location of the file in the Bioclipse workspace
      Returns:
      the location of the file in the Bioclipse workspace
      Throws:
      IOException - when the file could not be created
    • renewFile

      public String renewFile(String file) throws IOException
      Creates a new empty file in the Bioclipse workspace or empties the existing file.
      Parameters:
      file - the location of the file in the Bioclipse workspace
      Returns:
      the location of the file in the Bioclipse workspace
      Throws:
      IOException - when the file could not be created
    • newFile

      public String newFile(String path, String content) throws IOException
      Creates a new file in the Bioclipse workspace with the given content
      Parameters:
      path - the location of the file in the Bioclipse workspace
      content - the content of the new file
      Returns:
      the location of the file in the Bioclipse workspace
      Throws:
      IOException - when the file could not be created
    • remove

      public void remove(String path)
      Deletes the file in the Bioclipse workspace.
      Parameters:
      path - the location of the file in the Bioclipse workspace
    • append

      public void append(String path, String toWrite)
      Appends the new content to write to a new or existing file in the Bioclipse workspace.
      Parameters:
      path - the location of the file in the Bioclipse workspace
      toWrite - the content to append to the new file
    • append

      public void append(String path, byte[] toWrite)
      Appends the new content to write to a new or existing file in the Bioclipse workspace.
      Parameters:
      path - the location of the file in the Bioclipse workspace
      toWrite - the content to append to the new file
    • append

      public void append(String path, InputStream toWrite)
      Appends the new content to write to a new or existing file in the Bioclipse workspace.
      Parameters:
      path - the location of the file in the Bioclipse workspace
      toWrite - the content to append to the new file
    • open

      public void open(Object object)
      Not currently implemented.
      Parameters:
      object - the object to be opened in Bioclipse
    • newProject

      public String newProject(String name) throws IOException
      Creates a new project in the Bioclipse workspace.
      Parameters:
      name - the location of the project in the Bioclipse workspace
      Returns:
      the location of the project in the Bioclipse workspace
      Throws:
      IOException - when the project could not be created
    • readFile

      public String readFile(String path) throws net.bioclipse.core.business.BioclipseException
      Read a file content line by line into memory.
      Parameters:
      path - IFile to read from
      Returns:
      String with contents
      Throws:
      net.bioclipse.core.business.BioclipseException - when the file does not exist or could not be opened or read
    • readFileIntoArray

      public String[] readFileIntoArray(String path) throws net.bioclipse.core.business.BioclipseException
      Read a file line by line into memory.
      Parameters:
      path - IFile to read from
      Returns:
      String[] with one entry per line
      Throws:
      net.bioclipse.core.business.BioclipseException - when the file does not exist or could not be opened or read
    • getManagerName

      public String getManagerName()
      Specified by:
      getManagerName in interface net.bioclipse.managers.business.IBioclipseManager
    • doi

      public List<String> doi()
      Description copied from interface: IBactingManager
      Lists the DOIs of the articles associated to this manager.
      Specified by:
      doi in interface IBactingManager
      Returns:
      a List of String with DOIs