public interface

IGraphicalClientContext

implements IClientContext
com.pnfsoftware.jeb.client.api.IGraphicalClientContext

Class Overview

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.

Summary

Public Methods
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 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 focus a view fragment for the provided unit with the provided name.
abstract IUnitFragment getFocusedFragment()
Get 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 openView(IUnit unit)
Create or open the view or set of views representing a given unit.
[Expand]
Inherited Methods
From interface com.pnfsoftware.jeb.client.api.IClientContext

Public Methods

public abstract int displayList (String caption, String message, String[] headers, Object[][] rows)

Display a table of elements.

Parameters
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
Returns
  • the 0-based index of the selected row, or -1 if none

public abstract int displayMessageBox (String caption, String message, IconType iconType, ButtonGroupType bgType)

Display a message box to the user.

Parameters
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: none)
bgType button to be provided in the message box (default: OK)
Returns
  • 0(cancel), 1(ok), 2(yes), 3(no)

public abstract String displayQuestionBox (String caption, String message, String defaultValue)

Display a message box prompting the user for input.

Parameters
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
Returns
  • the user input text, or null if none

public abstract void executeAsync (String taskName, Runnable runnable)

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.

Parameters
taskName optional task name
runnable a runnable
Returns
  • true if the execution was successful, false otherwise
Throws
InterruptedException the task was interrupted
InvocationTargetException an exception happened during execution of the task - retrieve it with getTargetException() or getCause()

public abstract T executeAsyncWithReturn (String taskName, Callable<T> callable)

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.

Parameters
taskName optional task name
callable a callable
Returns
  • the object returned by the callable on success, null on failure
Throws
InterruptedException the task was interrupted
InvocationTargetException an exception happened during execution of the task - retrieve it with getTargetException() or getCause()

public abstract IUnitFragment findFragment (IUnit unit, String label, boolean focus)

Find and focus a view fragment for the provided unit with the provided name.

Parameters
unit target unit
label fragment name, e.g. "disassembly"
focus if true, on success, the fragment will also receive focus
Returns
  • the fragment or null

public abstract IUnitFragment getFocusedFragment ()

Get the currently focused fragment.

public abstract IUnitView getFocusedView ()

Get view containing the currently focused view

public abstract List<? extends IUnitView> getViews ()

Get the list of all views in the current UI client.

Returns
  • a list of views

public abstract List<? extends IUnitView> getViews (IUnit targetUnit)

Get the list of views representing the given unit within the UI client.

Parameters
targetUnit the target unit, null to get all views
Returns
  • a list of views

public abstract boolean openView (IUnit unit)

Create or open the view or set of views representing a given unit. On success, one view will also receive focus.

Parameters
unit the unit
Returns
  • true if at least one view was open or created. The full set of views associated to the unit can always be retrieved using getViews(IUnit)