Package org.yamcs.studio.script
Class ScriptUtil
java.lang.Object
org.yamcs.studio.script.ScriptUtil
- Direct Known Subclasses:
ScriptUtil
The utility class to facilitate BOY script programming.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidClose OPI associated with the provided widget.static voidClose current active OPI.static final voidexecInUI(Runnable runnable, AbstractBaseEditPart widget) Execute a runnable in UI thread.static final voidexecuteEclipseCommand(String commandId) Execute an Eclipse command.static final voidexecuteEclipseCommand(String commandId, String[] parameters) Execute an Eclipse command with optional parameters.static final voidexecuteSystemCommand(String command, int wait) Executing a system or shell command.static final org.osgi.framework.VersionDeprecated.static voidopenOPI(AbstractBaseEditPart widget, String opiPath, int target, MacrosInput macrosInput) Open an OPI.
-
Constructor Details
-
ScriptUtil
public ScriptUtil()
-
-
Method Details
-
openOPI
public static void openOPI(AbstractBaseEditPart widget, String opiPath, int target, MacrosInput macrosInput) Open an OPI.- Parameters:
widget- the widget to which the script is attached.opiPath- the path of the OPI. It can be either an absolute path or a relative path to the Display file of the widget.target- target place of the new OPI. 0: new tab; 1: replace current one; 2: new window; 3: view on left; 4: view on right; 5: view on top; 6: view on bottom; 7: detached view; 8: new shellmacrosInput- the macrosInput. null if no macros needed.
-
closeCurrentOPI
public static void closeCurrentOPI()Close current active OPI. -
closeAssociatedOPI
Close OPI associated with the provided widget. -
executeEclipseCommand
Execute an Eclipse command with optional parameters. Any parameters must be defined along with the command in plugin.xml.- Parameters:
commandId- the Eclipse command idparameters- a list of further String arguments alternating key, value: * executeEclipseCommand("id", ["pkey", "pvalue"])
-
executeEclipseCommand
Execute an Eclipse command.- Parameters:
commandId- the Eclipse command id
-
executeSystemCommand
Executing a system or shell command. On Unix, that could be anything in the PATH.Several things can happen:
- Command finishes OK right away
- Command gives error right away
- Command runs for a long time, eventually giving error or OK.
- Parameters:
command- Command to run. Format depends on OS.wait- Time to wait for completion in seconds
-
execInUI
Execute a runnable in UI thread.- Parameters:
runnable- the runnable to be executed.widget- any widget. It is referred to get the UI thread.
-
getBOYVersion
Deprecated.
-