public class DialogErrorHandling extends AbstractEditErrorHandler
Modifier and Type | Field and Description |
---|---|
protected boolean |
allowCommit
Flag to configure if this dialog allows to commit invalid data.
|
protected ICellEditor |
editor
The
ICellEditor for which this DialogErrorHandling is activated. |
underlyingErrorHandler
Constructor and Description |
---|
DialogErrorHandling()
Create a new
DialogErrorHandling with no underlying IEditErrorHandler
that does not support cross validation. |
DialogErrorHandling(boolean allowCommit)
Create a new
DialogErrorHandling with no underlying IEditErrorHandler
that gives the opportunity to configure the error handling for cross validation. |
DialogErrorHandling(IEditErrorHandler underlyingErrorHandler)
Create a new
DialogErrorHandling using the given IEditErrorHandler as
the underlying to allow chaining of error handling. |
DialogErrorHandling(IEditErrorHandler underlyingErrorHandler,
boolean allowCommit)
Create a new
DialogErrorHandling using the given IEditErrorHandler as
the underlying to allow chaining of error handling. |
Modifier and Type | Method and Description |
---|---|
void |
displayError(ICellEditor cellEditor,
Exception e)
If an error occurs on conversion/validation of data, this method will be called
for showing that error to the user.
|
String |
getChangeButtonLabel() |
String |
getConversionFailureShellTitle() |
String |
getDiscardButtonLabel() |
String |
getFailureShellTitle() |
String |
getValidationFailureShellTitle() |
protected boolean |
isWarningDialogActive()
Checks if the current active Shell is a conversion/validation failure warning dialog.
|
void |
setChangeButtonLabel(String changeButtonLabel) |
void |
setConversionFailureShellTitle(String conversionFailureShellTitle) |
void |
setDiscardButtonLabel(String discardButtonLabel) |
void |
setFailureShellTitle(String failureShellTitle) |
void |
setValidationFailureShellTitle(String validationFailureShellTitle) |
protected void |
showWarningDialog(String dialogMessage,
String dialogTitle)
Shows a warning dialog if the conversion or the validation returned an error message.
|
removeError
protected ICellEditor editor
ICellEditor
for which this DialogErrorHandling
is activated.
Needed so it is possible to operate on it dependent on the users choice.protected boolean allowCommit
false
as cross validation is not
the default validation use case.public DialogErrorHandling()
DialogErrorHandling
with no underlying IEditErrorHandler
that does not support cross validation.public DialogErrorHandling(boolean allowCommit)
DialogErrorHandling
with no underlying IEditErrorHandler
that gives the opportunity to configure the error handling for cross validation.allowCommit
- Flag to configure if this dialog allows to commit invalid data.
If this parameter is set to true
, an additional button for committing
the invalid data will be provided within the dialog.public DialogErrorHandling(IEditErrorHandler underlyingErrorHandler)
DialogErrorHandling
using the given IEditErrorHandler
as
the underlying to allow chaining of error handling. Using this constructor there is
no cross validation support.underlyingErrorHandler
- The underlying IEditErrorHandler
public DialogErrorHandling(IEditErrorHandler underlyingErrorHandler, boolean allowCommit)
DialogErrorHandling
using the given IEditErrorHandler
as
the underlying to allow chaining of error handling.underlyingErrorHandler
- The underlying IEditErrorHandler
allowCommit
- Flag to configure if this dialog allows to commit invalid data.
If this parameter is set to true
, an additional button for committing
the invalid data will be provided within the dialog.public void displayError(ICellEditor cellEditor, Exception e)
Exception
will be shown to the user.
This implementation will call its underlying IEditErrorHandler
.
After the error is handled by its underlying IEditErrorHandler
,
a dialog will be opened showing the error message to the user, giving the
opportunity to decide if the entered value should be discarded or if the
editor should stay open so the value can be modified.
displayError
in interface IEditErrorHandler
displayError
in class AbstractEditErrorHandler
cellEditor
- The ICellEditor
on which the conversion/validation error
occurred. Needed to add error styling or special handling.e
- The Exception
that contains information about the conversion/validation
error. Used to show a more detailed description on the error to the user.protected void showWarningDialog(String dialogMessage, String dialogTitle)
protected boolean isWarningDialogActive()
true
if a warning dialog is activepublic String getFailureShellTitle()
public void setFailureShellTitle(String failureShellTitle)
failureShellTitle
- The shell title that should be used if there is no conversion or
validation shell title configured.public String getConversionFailureShellTitle()
DialogErrorHandling
is called
to handle a ConversionFailedException
.public void setConversionFailureShellTitle(String conversionFailureShellTitle)
conversionFailureShellTitle
- The shell title that should be used in case this
DialogErrorHandling
is called to handle a ConversionFailedException
.public String getValidationFailureShellTitle()
DialogErrorHandling
is called to handle
a ValidationFailedException
.public void setValidationFailureShellTitle(String validationFailureShellTitle)
validationFailureShellTitle
- The shell title that should be used in case this
DialogErrorHandling
is called to handle a ValidationFailedException
.public String getChangeButtonLabel()
public void setChangeButtonLabel(String changeButtonLabel)
changeButtonLabel
- The text on the button for changing the entered value.public String getDiscardButtonLabel()
public void setDiscardButtonLabel(String discardButtonLabel)
discardButtonLabel
- The text on the button to discard the entered value.Copyright © 2013. All Rights Reserved.