if ( numOfCommands != 0 ) {  input.setText( ( String ) commandHistory.get( recentCommand ) + " " );
if ( numOfCommands != 0 ) { input.setText( ( String ) commandHistory.get( recentCommand ));
                public void keyPressed( KeyEvent e ) {                    int numLinesDisplayed =                              infoDisplay.getClientArea().height / infoDisplay.getLineHeight();                    if ( e.keyCode == SWT.PAGE_UP ) {                        if ( infoDisplay.getTopIndex() > numLinesDisplayed )                            infoDisplay.setTopIndex( infoDisplay.getTopIndex() - ( numLinesDisplayed ) );                        else                            infoDisplay.setTopIndex( 0 );                    }                    else if ( e.keyCode == SWT.PAGE_DOWN )                        infoDisplay.setTopIndex( infoDisplay.getTopIndex() + ( numLinesDisplayed ) );                    else if ( e.character == SWT.CR ) {                        if ( clientId > 0 )                            infoDisplay.append( getTimeStamp() + "> " );                        int start = infoDisplay.getCharCount();                        String outText = input.getText();                        infoDisplay.append( outText + getLineDelimiter() );                        infoDisplay.setStyleRange( new StyleRange( start, outText.length(), highlightColor,                                                                   infoDisplay.getBackground() ) );                        setChanged();                        notifyObservers( input.getText() );                        commandHistory.add( numOfCommands, input.getText() );                        /*                         * Add the command to history and increase counter for                         * command history                         */						numOfCommands++;						recentCommand = numOfCommands - 1;                                                input.setText( "" );                    }                    /*next two cases are for brwosing through command-history*/                                        else if ( e.keyCode == SWT.ARROW_UP ) {					if ( numOfCommands != 0 ) {							/*additional +" " is nescessary, because ARROW_UP also steps one char back*/											input.setText( ( String ) commandHistory.get( recentCommand ) + " " );						/*set the cursor at the end of the line*/						input.setSelection( input.getText().length() );						if ( recentCommand > 0 )					                								recentCommand--; 						}			                   }				   else if ( e.keyCode == SWT.ARROW_DOWN ) {				   				   	if ( recentCommand < commandHistory.size() - 1 ) {												recentCommand++;						input.setText( ( String ) commandHistory.get( recentCommand ) );						/*set the cursor at the end of the line*/						input.setSelection( input.getText().length() );				   	}				   }				                   }