RETURN_CODE
- The return code.public class UIFeedBack<RETURN_CODE> extends Object implements IUserInterfaceFeedback<RETURN_CODE>
Modifier and Type | Field and Description |
---|---|
static String |
CANCEL_STRING_CODE
The "\0" return code for cancel, to check by reference and not string
comparison.
|
protected RETURN_CODE |
cancelCode
The cancel return code.
|
Constructor and Description |
---|
UIFeedBack(Shell parent,
RETURN_CODE cancelCode)
A feed-back requires parent shell
where dialog boxes are placed.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addCancelListener(Runnable listener)
Adds a cancel listener.
|
boolean |
cancel()
Requests cancel of the feedback or dialog.
|
void |
createDialog(int type,
Object... params)
Creates the UI dialog.
|
void |
dispose()
Disposes of the dialog.
|
RETURN_CODE |
getCancelReturnCode()
Gets the cancel return code from the constructor parameter.
|
Shell |
getDialogShell()
Gets the dialog shell.
|
Display |
getDisplay()
Gets the display that is valid for the shells created, parent or dialog shell.
|
RETURN_CODE |
getReturnCode()
Gets the current return code.
|
boolean |
isCanceled()
Checks if cancel is requested by the user.
|
RETURN_CODE |
processDialogBlocked(Thread threadToStart)
When this is method called from an unknown thread, it is blocked until the user
feed-back dialog is closed.
|
boolean |
removeCancelListener(Runnable listener)
Removes a cancel listener.
|
void |
setReturnCode(RETURN_CODE returnCode)
Assigns the return code BEFORE disposing the dialog.
|
String |
updateFeedBack(Object... objects)
Updates the feed-back dialog.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
processDialogBlocked
public static final String CANCEL_STRING_CODE
protected final RETURN_CODE cancelCode
public UIFeedBack(Shell parent, RETURN_CODE cancelCode)
parent
- The parent shell, null for none. If null,
it will be the topmost one at the moment.cancelCode
- The cancel code.public final Shell getDialogShell()
public void createDialog(int type, Object... params)
createDialog
in interface IUserInterfaceFeedback<RETURN_CODE>
type
- Type of dialog: 1=connection feed-back, 2=final data received.params
- Parameters: params[0]=title, params[1]="Please wait...".public String updateFeedBack(Object... objects)
updateFeedBack
in interface IUserInterfaceFeedback<RETURN_CODE>
objects
- The objects to update.public final Display getDisplay()
public RETURN_CODE processDialogBlocked(Thread threadToStart)
processDialogBlocked
in interface IUserInterfaceFeedback<RETURN_CODE>
threadToStart
- Thread to start when dialog is opened, null for none.CANCEL_STRING_CODE
, this code will be returned as is, and
NOT return null
.public RETURN_CODE getReturnCode()
getReturnCode
in interface IUserInterfaceFeedback<RETURN_CODE>
public void setReturnCode(RETURN_CODE returnCode)
dispose()
. This method can be called from any thread.setReturnCode
in interface IUserInterfaceFeedback<RETURN_CODE>
returnCode
- The return code Object, or null for cancel.public boolean addCancelListener(Runnable listener)
addCancelListener
in interface IUserInterfaceFeedback<RETURN_CODE>
listener
- The listener to add.public boolean removeCancelListener(Runnable listener)
removeCancelListener
in interface IUserInterfaceFeedback<RETURN_CODE>
listener
- The listener to remove.public RETURN_CODE getCancelReturnCode()
getCancelReturnCode
in interface IUserInterfaceFeedback<RETURN_CODE>
cancelCode
constructor parameter UIFeedBack(Shell, Object)
.public boolean cancel()
cancel
in interface IUserInterfaceFeedback<RETURN_CODE>
public boolean isCanceled()
isCanceled
in interface IUserInterfaceFeedback<RETURN_CODE>
public void dispose()
dispose
in interface IUserInterfaceFeedback<RETURN_CODE>
iizi® is a registered trademark of Mindus SARL. © Copyright Mindus SARL, 2020. All rights reserved.