Package com.vaadin.copilot.ide
Class CopilotIDEPlugin
java.lang.Object
com.vaadin.copilot.ide.CopilotIDEPlugin
IDE plugin support utility
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic class -
Method Summary
Modifier and TypeMethodDescriptionstatic CopilotIDEPluginGets instance of CopilotIDEPlugin.Optional<tools.jackson.databind.JsonNode> Optional<tools.jackson.databind.JsonNode> booleanisActive()Check if plugin is active based on existing properties fileOptional<tools.jackson.databind.JsonNode> Performs Redo for given filesOptional<tools.jackson.databind.JsonNode> refresh()Sends request to synchronize project files with filesystemOptional<tools.jackson.databind.JsonNode> restartApplication(String mainClass) Send requests to restart applicationstatic voidsetDevToolsInterface(com.vaadin.base.devserver.DevToolsInterface devToolsInterface) Sets dev tools interface for user notificationsstatic voidsetFolderInLaunchedModule(Path folderInLaunchedModule) Sets a reference folder used to find the plugin metadata file.Optional<tools.jackson.databind.JsonNode> Opens editor and places caret on given line and columnbooleansupports(CopilotIDEPlugin.Commands command) Checks if given command is supported by pluginOptional<tools.jackson.databind.JsonNode> Performs Undo for given filesstatic StringOptional<tools.jackson.databind.JsonNode> writeBase64File(File file, String undoLabel, String content) Calls plugin writeBase64 file operationOptional<tools.jackson.databind.JsonNode> Calls plugin write file operation
-
Method Details
-
getInstance
Gets instance of CopilotIDEPlugin. Project root must be set before.- Returns:
- gets or create new instance of CopilotIDEPlugin
-
setFolderInLaunchedModule
Sets a reference folder used to find the plugin metadata file.- Parameters:
folderInLaunchedModule- some folder inside the module containing the launched application
-
setDevToolsInterface
public static void setDevToolsInterface(com.vaadin.base.devserver.DevToolsInterface devToolsInterface) Sets dev tools interface for user notifications- Parameters:
devToolsInterface-
-
isActive
public boolean isActive()Check if plugin is active based on existing properties file- Returns:
- true if active, false otherwise
-
getProperties
-
getPluginInfo
-
writeFile
public Optional<tools.jackson.databind.JsonNode> writeFile(File file, String undoLabel, String content) throws IOException Calls plugin write file operation- Parameters:
file- file to be writtenundoLabel- custom undo labelcontent- file content- Throws:
IOException- exception if command cannot be serialized
-
writeBase64File
public Optional<tools.jackson.databind.JsonNode> writeBase64File(File file, String undoLabel, String content) throws IOException Calls plugin writeBase64 file operation- Parameters:
file- file to be writtenundoLabel- custom undo labelcontent- file contents as base 64 encoded string- Throws:
IOException- exception if command cannot be serialized
-
undo
Performs Undo for given files- Parameters:
files- list of files to perform undo- Throws:
IOException- thrown on exception
-
redo
Performs Redo for given files- Parameters:
files- list of files to perform redo- Throws:
IOException- thrown on exception
-
showInIde
public Optional<tools.jackson.databind.JsonNode> 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 linecolumn- column number to put caret before, 0 as first column- Throws:
IOException- thrown on exception
-
refresh
Sends request to synchronize project files with filesystem- Throws:
IOException- thrown on exception
-
getModulePaths
-
restartApplication
Send requests to restart application- Parameters:
mainClass- name of main class to be matched with runner- Returns:
- response from IDE plugin
-
heartbeat
-
supports
Checks if given command is supported by plugin- Parameters:
command- command to be checked- Returns:
- true if supported, false otherwise
-
undoLabel
-