You're viewing an older version of Vaadin JavaDoc. Please see version 24.7.0 for the latest.
com.vaadin.copilot.ide.

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

    • writeBase64File

      public void writeBase64File(File file, String undoLabel, String content) throws IOException

      Calls plugin writeBase64 file operation

      Parameters:

      file - file to be written

      undoLabel - custom undo label

      content - file contents as base 64 encoded string

      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

    • supports

      public boolean supports(CopilotIDEPlugin.Commands command)

      Checks if given command is supported by plugin

      Parameters:

      command - command to be checked

      Returns:

      true if supported, false otherwise

    • undoLabel

      public static String undoLabel(String operation)