if ( value != null && value instanceof String )
{
String s = ( String ) value;
// Trying to parse the value
GeneralizedTime generalizedTime = null;
try
{
generalizedTime = "".equals( s ) ? null : new GeneralizedTime( s ); //$NON-NLS-1$
}
catch ( ParseException pe )
{
// The value could not be parsed correctly
// Displaying an error window indicating to the user that the value is bogus
// and asking him if he wants to continue to edit the value with current date and time selected
if ( MessageDialog.openConfirm( PlatformUI.getWorkbench().getDisplay().getActiveShell(), Messages
.getString( "GeneralizedTimeValueEditor.BogusDateAndTimeValue" ), NLS.bind( //$NON-NLS-1$
Messages.getString( "GeneralizedTimeValueEditor.TheValueIsBogus" ), new String[] //$NON-NLS-1$
{ s } ) ) )
{
// Generating today's date and time
generalizedTime = new GeneralizedTime( Calendar.getInstance() );
}
else
{
return false;
}