|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
nl.lxtreme.ols.tool.base.BaseToolDialog<RESULT_TYPE>
public abstract class BaseToolDialog<RESULT_TYPE>
Provides a base tool dialog.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JDialog |
---|
JDialog.AccessibleJDialog |
Nested classes/interfaces inherited from class java.awt.Dialog |
---|
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType |
Nested classes/interfaces inherited from class java.awt.Window |
---|
Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected static Insets |
COMP_INSETS
Provides insets (padding) that can be used for components. |
protected static Insets |
LABEL_INSETS
Provides insets (padding) that can be used for labels. |
Fields inherited from class javax.swing.JDialog |
---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Dialog |
---|
DEFAULT_MODALITY_TYPE |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
protected |
BaseToolDialog(Window aOwner,
Dialog.ModalityType aModalityType,
nl.lxtreme.ols.api.tools.ToolContext aContext,
org.osgi.framework.BundleContext aBundleContext,
nl.lxtreme.ols.api.tools.Tool<RESULT_TYPE> aTool)
Creates a new BaseToolDialog instance that is document modal. |
protected |
BaseToolDialog(Window aOwner,
nl.lxtreme.ols.api.tools.ToolContext aContext,
org.osgi.framework.BundleContext aBundleContext,
nl.lxtreme.ols.api.tools.Tool<RESULT_TYPE> aTool)
Creates a new BaseToolDialog instance that is document modal. |
Method Summary | ||
---|---|---|
void |
cancelTool()
Called to cancel the tool (if it is running). |
|
void |
close()
|
|
protected org.osgi.framework.BundleContext |
getBundleContext()
Returns the current value of bundleContext. |
|
nl.lxtreme.ols.api.tools.ToolContext |
getContext()
|
|
protected nl.lxtreme.ols.api.acquisition.AcquisitionResult |
getData()
Returns the acquisition result data. |
|
RESULT_TYPE |
getLastResult()
Returns the current value of lastResult. |
|
nl.lxtreme.ols.api.tools.Tool<RESULT_TYPE> |
getTool()
Returns the current value of tool. |
|
boolean |
invokeTool()
Called to invoke the actual tool. |
|
protected void |
onBeforeCloseDialog()
Called right before this dialog is made invisible. |
|
protected void |
onBeforeShowDialog()
Called right before this dialog is made visible. |
|
protected abstract void |
onToolEnded(RESULT_TYPE aResult)
Called when the tool finished its job. |
|
protected void |
onToolFailed(Exception aException)
Called when the tool is failed. |
|
protected abstract void |
onToolStarted()
Called when the tool is just started to do its task. |
|
protected void |
prepareToolTask(nl.lxtreme.ols.api.tools.ToolTask<RESULT_TYPE> aToolTask)
Allows additional preparations to be performed on the given ToolTask instance, such as setting parameters and such. |
|
protected void |
setComboBoxIndex(JComboBox aComboBox,
nl.lxtreme.ols.api.UserSettings aSettings,
String aSettingName)
Convenience method to set the combobox index to a "safe" value, based on the given user settings. |
|
protected void |
setControlsEnabled(boolean aEnabled)
set the controls of the dialog enabled/disabled |
|
void |
showDialog()
Shows the dialog with the given capture results. |
|
|
taskEnded(nl.lxtreme.ols.api.task.Task<RT> aTask,
RT aResult)
|
|
|
taskFailed(nl.lxtreme.ols.api.task.Task<RT> aTask,
Exception aException)
|
|
|
taskStarted(nl.lxtreme.ols.api.task.Task<RT> aTask)
|
|
protected boolean |
validateToolSettings()
Called right before the tool is invoked to allow additional validation on the tool settings. |
Methods inherited from class java.awt.Dialog |
---|
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, show, toBack |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface nl.lxtreme.ols.tool.base.ToolDialog |
---|
reset |
Methods inherited from interface nl.lxtreme.ols.api.Configurable |
---|
readPreferences, writePreferences |
Field Detail |
---|
protected static final Insets LABEL_INSETS
protected static final Insets COMP_INSETS
Constructor Detail |
---|
protected BaseToolDialog(Window aOwner, Dialog.ModalityType aModalityType, nl.lxtreme.ols.api.tools.ToolContext aContext, org.osgi.framework.BundleContext aBundleContext, nl.lxtreme.ols.api.tools.Tool<RESULT_TYPE> aTool)
BaseToolDialog
instance that is document modal.
aOwner
- the owning window of this dialog;aTitle
- the title of this dialog;aModalityType
- the modality type;aContext
- the tool context to use in this dialog.protected BaseToolDialog(Window aOwner, nl.lxtreme.ols.api.tools.ToolContext aContext, org.osgi.framework.BundleContext aBundleContext, nl.lxtreme.ols.api.tools.Tool<RESULT_TYPE> aTool)
BaseToolDialog
instance that is document modal.
aOwner
- the owning window of this dialog;aTitle
- the title of this dialog;aContext
- the tool context to use in this dialog.Method Detail |
---|
public final void cancelTool() throws IllegalStateException
cancelTool
in interface ToolDialog
IllegalStateException
- in case the tool isn't running.public final void close()
close
in interface nl.lxtreme.ols.util.swing.StandardActionFactory.CloseAction.Closeable
public final nl.lxtreme.ols.api.tools.ToolContext getContext()
public final RESULT_TYPE getLastResult()
public final nl.lxtreme.ols.api.tools.Tool<RESULT_TYPE> getTool()
public final boolean invokeTool() throws IllegalStateException
invokeTool
in interface ToolDialog
IllegalStateException
- in case the tool is already running.public final void showDialog()
showDialog
in interface ToolDialog
public final <RT> void taskEnded(nl.lxtreme.ols.api.task.Task<RT> aTask, RT aResult)
taskEnded
in interface nl.lxtreme.ols.api.task.TaskStatusListener
public final <RT> void taskFailed(nl.lxtreme.ols.api.task.Task<RT> aTask, Exception aException)
taskFailed
in interface nl.lxtreme.ols.api.task.TaskStatusListener
public final <RT> void taskStarted(nl.lxtreme.ols.api.task.Task<RT> aTask)
taskStarted
in interface nl.lxtreme.ols.api.task.TaskStatusListener
protected final org.osgi.framework.BundleContext getBundleContext()
protected final nl.lxtreme.ols.api.acquisition.AcquisitionResult getData()
null
.protected void onBeforeCloseDialog()
protected void onBeforeShowDialog()
protected abstract void onToolEnded(RESULT_TYPE aResult)
THIS METHOD WILL BE INVOKED ON THE EVENT-DISPATCH THREAD (EDT)!
aResult
- the result of the tool, can be null
.protected void onToolFailed(Exception aException)
By default, shows a error dialog with the details of the failure.
THIS METHOD WILL BE INVOKED ON THE EVENT-DISPATCH THREAD (EDT)!
aException
- the exception with the failure, can be null
.protected abstract void onToolStarted()
THIS METHOD WILL BE INVOKED ON THE EVENT-DISPATCH THREAD (EDT)!
protected void prepareToolTask(nl.lxtreme.ols.api.tools.ToolTask<RESULT_TYPE> aToolTask)
ToolTask
instance, such as setting parameters and such.
This method will be called right before the tool task is to be executed.
aToolTask
- the tool task to prepare, cannot be null
.protected final void setComboBoxIndex(JComboBox aComboBox, nl.lxtreme.ols.api.UserSettings aSettings, String aSettingName)
aComboBox
- the combobox to set the selected index for;aSettings
- the user settings to take the selected index from;aSettingName
- the name of the user setting to use.protected void setControlsEnabled(boolean aEnabled)
aEnabled
- status of the controlsprotected boolean validateToolSettings()
true
if the tool settings are correct and the task can
be started, false
if the settings are incorrect and
the task should not be started.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |