Package ghidra.jython
Class JythonCodeCompletionFactory
java.lang.Object
ghidra.jython.JythonCodeCompletionFactory
Generates CodeCompletions from Jython objects.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
changeOptions
(Options options, String name, Object oldValue, Object newValue) Handle an Option change.static Object[]
getCallMethods
(org.python.core.PyObject obj) Returns the Java __call__ methods declared for a Jython object.static ghidra.app.plugin.core.console.CodeCompletion
newCodeCompletion
(String description, String insertion, org.python.core.PyObject pyObj) Deprecated.static ghidra.app.plugin.core.console.CodeCompletion
newCodeCompletion
(String description, String insertion, org.python.core.PyObject pyObj, String userInput) Creates a new CodeCompletion from the given Jython objects.static void
setupOptions
(JythonPlugin plugin, Options options) Sets up Jython code completion Options.
-
Field Details
-
COMPLETION_LABEL
- See Also:
-
NULL_COLOR
-
FUNCTION_COLOR
-
PACKAGE_COLOR
-
CLASS_COLOR
-
METHOD_COLOR
-
CODE_COLOR
-
INSTANCE_COLOR
-
SEQUENCE_COLOR
-
MAP_COLOR
-
NUMBER_COLOR
-
SPECIAL_COLOR
-
-
Constructor Details
-
JythonCodeCompletionFactory
public JythonCodeCompletionFactory()
-
-
Method Details
-
newCodeCompletion
@Deprecated public static ghidra.app.plugin.core.console.CodeCompletion newCodeCompletion(String description, String insertion, org.python.core.PyObject pyObj) Deprecated.usenewCodeCompletion(String, String, PyObject, String)
instead, it allows creation of substituting code completionsCreates a new CodeCompletion from the given Jython objects.- Parameters:
description
- description of the new CodeCompletioninsertion
- what will be inserted to make the code completepyObj
- a Jython Object- Returns:
- A new CodeCompletion from the given Jython objects.
-
newCodeCompletion
public static ghidra.app.plugin.core.console.CodeCompletion newCodeCompletion(String description, String insertion, org.python.core.PyObject pyObj, String userInput) Creates a new CodeCompletion from the given Jython objects.- Parameters:
description
- description of the new CodeCompletioninsertion
- what will be inserted to make the code completepyObj
- a Jython ObjectuserInput
- a word we want to complete, can be an empty string. It's used to determine which part (if any) of the input should be removed before the insertion of the completion- Returns:
- A new CodeCompletion from the given Jython objects.
-
setupOptions
Sets up Jython code completion Options.- Parameters:
plugin
- jython plugin as options owneroptions
- an Options handle
-
changeOptions
Handle an Option change. This is named slightly differently because it is a static method, not an instance method. By the time we get here, we assume that the Option changed is indeed ours.- Parameters:
options
- the Options handlename
- name of the Option changedoldValue
- the old valuenewValue
- the new value
-
getCallMethods
Returns the Java __call__ methods declared for a Jython object. Some Jython "methods" in the new-style Jython objects are actually classes in and of themselves, re-implementing __call__ methods to tell us how to call them. This returns an array of those Methods (for code completion help).- Parameters:
obj
- a PyObject- Returns:
- the Java __call__ methods declared for the Jython object
-
newCodeCompletion(String, String, PyObject, String)
instead, it allows creation of substituting code completions