Class CopilotIDEPlugin

java.lang.Object
com.vaadin.copilot.ide.CopilotIDEPlugin

public class CopilotIDEPlugin extends Object
IDE plugin support utility
  • Method Details

    • getInstance

      public static CopilotIDEPlugin getInstance()
      Gets instance of CopilotIDEPlugin. Project root must be set before.
      Returns:
      gets or create new instance of CopilotIDEPlugin
    • setProjectRoot

      public static void setProjectRoot(Path projectRoot)
      Sets project root
      Parameters:
      projectRoot - project root path
    • isActive

      public boolean isActive()
      Check if plugin is active based on existing properties file
      Returns:
      true if active, false otherwise
    • getProperties

      public CopilotIDEPluginProperties getProperties()
    • writeFile

      public void writeFile(File file, String undoLabel, String content) throws IOException
      Calls plugin write file operation
      Parameters:
      file - file to be written
      undoLabel - custom undo label
      content - file content
      Throws:
      IOException - exception if command cannot be serialized
    • undo

      public void undo(List<String> files) throws IOException
      Performs Undo for given files
      Parameters:
      files - list of files to perform undo
      Throws:
      IOException - thrown on exception
    • redo

      public void redo(List<String> files) throws IOException
      Performs Redo for given files
      Parameters:
      files - list of files to perform redo
      Throws:
      IOException - thrown on exception
    • showInIde

      public void showInIde(String file, Integer line, Integer column) throws IOException
      Opens editor and places caret on given line and column
      Parameters:
      line - line number, use 0 as first line
      column - column number to put caret before, 0 as first column
      Throws:
      IOException - thrown on exception
    • refresh

      public void refresh() throws IOException
      Sends request to synchronize project files with filesystem
      Throws:
      IOException - thrown on exception
    • undoLabel

      public static String undoLabel(String operation)