com.pnfsoftware.jeb.client.api.IGraphicalClientContext |
This important interface represents a client context for scripting inside a GUI client. Specialized context for clients displaying a graphical user interface.
Note: The public context of the official RCP desktop client implements this interface.
Note: Additional methods will be provided in to offer basic manipulation of UI elements.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract String |
displayFileOpenSelector(String caption)
Display a file selector dialog (Open file).
| ||||||||||
abstract String |
displayFileSaveSelector(String caption)
Display a file selector dialog (Save file).
| ||||||||||
abstract String |
displayFolderSelector(String caption)
Display a folder selection dialog.
| ||||||||||
abstract Object[] |
displayForm(String caption, String description, FormEntry...<?> entries)
Display a form dialog prompting the user for inputs.
| ||||||||||
abstract void |
displayGraph(String caption, Digraph graph)
Create a graph dialog.
| ||||||||||
abstract void |
displayGraph(String caption, Digraph graph, GraphDialogExtensions ext)
Create a graph dialog.
| ||||||||||
abstract int |
displayList(String caption, String message, String[] headers, Object[][] rows)
Display a table of elements.
| ||||||||||
abstract int |
displayMessageBox(String caption, String message, IconType iconType, ButtonGroupType bgType)
Display a message box to the user.
| ||||||||||
abstract String |
displayQuestionBox(String caption, String message, String defaultValue)
Display a message box prompting the user for input.
| ||||||||||
abstract String[] |
displaySimpleForm(String caption, String description, String... entries)
Display a simple form dialog prompting the user for inputs.
| ||||||||||
abstract String |
displayText(String caption, String text, boolean editable)
Display a text box.
| ||||||||||
abstract void |
executeAsync(String taskName, Runnable runnable)
Execute a task asynchronously.
| ||||||||||
abstract <T> T |
executeAsyncWithReturn(String taskName, Callable<T> callable)
Execute a task asynchronously, and retrieve a value returned by the task.
| ||||||||||
abstract IUnitFragment |
findFragment(IUnit unit, String label, boolean focus)
Find and activate a view fragment for the provided unit with the provided name.
| ||||||||||
abstract String |
getFocusedAddress()
Get the currently active
unit address of the focused fragment. | ||||||||||
abstract IUnitFragment |
getFocusedFragment()
Get the currently focused fragment.
| ||||||||||
abstract IItem |
getFocusedItem()
Get the currently active
unit item of the focused fragment.. | ||||||||||
abstract IUnit |
getFocusedUnit()
Get the IUnit object represented by the currently focused fragment.
| ||||||||||
abstract IUnitView |
getFocusedView()
Get view containing the currently focused view
| ||||||||||
abstract List<? extends IUnitView> |
getViews()
Get the list of all views in the current UI client.
| ||||||||||
abstract List<? extends IUnitView> |
getViews(IUnit targetUnit)
Get the list of views representing the given unit within the UI client.
| ||||||||||
abstract boolean |
navigate(IUnit unit, String unitAddress)
Convenience method used to find and open a unit fragment, and navigate to an
optionally-provided address within that fragment.
| ||||||||||
abstract boolean |
openView(IUnit unit)
Create or open the view or set of views representing a given unit.
| ||||||||||
abstract void |
registerUnitFragmentPositionChangeListener(IUnitFragmentPositionChangeListener listener)
Register a listener for positional changes in unit fragments.
| ||||||||||
abstract void |
uiExecute(Runnable runnable)
Execute a task on the UI thread.
| ||||||||||
abstract void |
uiExecuteBlocking(Runnable runnable)
Execute a task on the UI thread.
| ||||||||||
abstract void |
uiExecuteWithDelay(int delay, Runnable runnable)
Execute a task on the UI thread after the provided delay.
| ||||||||||
abstract void |
unregisterUnitFragmentPositionChangeListener(IUnitFragmentPositionChangeListener listener)
Unregister a listener for positional changes in unit fragments.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.pnfsoftware.jeb.client.api.IClientContext
|
Display a file selector dialog (Open file).
caption | optional caption |
---|
Display a file selector dialog (Save file).
caption | optional caption |
---|
Display a folder selection dialog.
caption | optional caption |
---|
Display a form dialog prompting the user for inputs.
caption | title for the dialog |
---|---|
description | optional form description line |
entries | a list of form entries |
Create a graph dialog. The dialog is modeless. This method opens the dialog and returns immediately.
Also see the extended version of
this method
.
caption | shell title |
---|---|
graph | directed graph model |
Create a graph dialog. The dialog is modeless. This method opens the dialog and returns immediately.
caption | shell title |
---|---|
graph | directed graph model |
ext | optional; used to customize the graph and provide action handlers |
Display a table of elements.
caption | optional caption |
---|---|
message | optional message |
headers | table headers |
rows | rows; a row must have the same number of elements as the provided headers; objects are rendered using their #toString() method |
Display a message box to the user.
caption | title for the message box |
---|---|
message | text to be displayed, can be multi-line |
iconType | icon to be displayed in the message box (default: INFORMATION) |
bgType | button to be provided in the message box (default: OK) |
Display a message box prompting the user for input.
caption | title for the message box |
---|---|
message | information, should be a single line of text |
defaultValue | optional default input value, will be selected if provided |
Display a simple form dialog prompting the user for inputs.
caption | title for the dialog |
---|---|
description | optional form description line |
entries | a 2N-array of (header, default value) entries; example: ("First name", "Your first name", "Last name", "") |
Display a text box.
caption | title for the message box |
---|
Execute a task asynchronously. The task will not be executed on the UI thread. Users are
offered a way to cancel task execution. Therefore, if possible, the runnable should check for
user-requested interruption (using interrupted()
), and interrupt processing
accordingly.
taskName | optional task name |
---|---|
runnable | a task |
InterruptedException | the task was interrupted |
---|---|
InvocationTargetException | an exception happened during execution of the task - retrieve it with getTargetException() or getCause() |
Execute a task asynchronously, and retrieve a value returned by the task. Users are offered a
way to cancel task execution. Therefore, if possible, the runnable should check for
user-requested interruption (using interrupted()
), and interrupt processing
accordingly.
This method must be called on the UI thread.
taskName | optional task name |
---|---|
callable | a task |
InterruptedException | the task was interrupted |
---|---|
InvocationTargetException | an exception happened during execution of the task - retrieve it with getTargetException() or getCause() |
Find and activate a view fragment for the provided unit with the provided name.
unit | target unit |
---|---|
label | fragment name, e.g. "disassembly" |
focus | if true, on success, the fragment will also receive focus |
Get the currently active unit address
of the focused fragment. Convenience method
~equivalent to getFocusedFragment().getActiveAddress()
.
Get the currently focused fragment. Convenience method ~equivalent to
getFocusedView().getActiveFragment()
.
Get the currently active unit item
of the focused fragment.. Convenience method
~equivalent to getFocusedFragment().getActiveItem()
.
Get the IUnit object represented by the currently focused fragment. Convenience method
~equivalent to getFocusedView().getUnit()
.
Get the list of all views in the current UI client.
Get the list of views representing the given unit within the UI client.
targetUnit | the target unit, null to get all views |
---|
Convenience method used to find and open a unit fragment, and navigate to an optionally-provided address within that fragment.
unit | mandatory |
---|---|
unitAddress | optional; a unit address (refer to IAddressableUnit ) |
Create or open the view or set of views representing a given unit. On success, one view will also receive focus.
unit | the unit |
---|
getViews(IUnit)
Register a listener for positional changes in unit fragments.
Execute a task on the UI thread. The method returns immediately.
This method may be called from any thread.
runnable | a task |
---|
Execute a task on the UI thread. The method returns after the task completed.
This method may be called from any thread.
runnable | a task |
---|
Execute a task on the UI thread after the provided delay.
This method must be called on the UI thread.
delay | in milliseconds |
---|---|
runnable | a task |
Unregister a listener for positional changes in unit fragments.