Skip to content

Services

Some functionality, like code viewer actions can be accessed via global Services. The process of getting a service instance differs in plugins and scripts.

Plugins

CodeViewerService codeViewer = getTool().getService(CodeViewerService.class);

Here getTool() is a protected method of the Plugin ancestor class.

Scripts

code_viewer = state.getTool().getService(CodeViewerService)

Here state is a predefined variable in the scripting context.