protected void printDeviceList( IDevice[] devices ) {
prompter.notify( "-----------------------------" );
- prompter.notify( "Currnet connected target list" );
+ prompter.notify( "Current connected target list" );
prompter.notify( "-----------------------------" );
for( int i = 0; i < devices.length; i++ ) {
String msg = MessageFormat.format( "{0}) {1}( {2} )", (i+1), devices[i].toString(), devices[i].getDeviceName() );
);
if( cancel.equals( op ) ) {
- prompter.notify( "Process is canceled, please selected device." );
+ prompter.notify( "Process is canceled, please select a device." );
} else {
String answer = ((GenericOption)op).getAnswer();
if ( !StringUtil.isEmpty( answer ) ) {
if ( 0 < index && index <= devices.length )
{
selectDevice = ArrayUtil.get( devices, index-1 );
- String msg = MessageFormat.format( "Select Device is: {0}( {1} )" , selectDevice.toString(), selectDevice.getDeviceName() );
+ String msg = null;
+ if ( selectDevice != null )
+ msg = MessageFormat.format( "Selected device is: {0}( {1} )", selectDevice.toString(), selectDevice.getDeviceName() );
+ else
+ msg = MessageFormat.format( "Selected device is: {0}", selectDevice );
prompter.notify( msg );
+ } else {
+ prompter.notify( "Process is canceled, please select correct device." );
}
- else
- {
- prompter.notify( "Process is canceled, please selected correct device." );
- }
- }
- catch (NumberFormatException e)
+ } catch (NumberFormatException e)
{
- prompter.notify( "Process is canceled, please selected correct device. Input is not integer." );
+ prompter.notify( "Process is canceled, please select correct device. Input is not integer." );
}
- }
- else
- {
- prompter.notify( "Process is canceled, please selected correct device." );
+ } else {
+ prompter.notify( "Process is canceled, please select correct device." );
}
}
}
return selectDevice;
}
}
-