if ( currentText.endsWith( this.appendChoiceDelimiter ) ) { choiceText = currentText + choiceText + this.appendChoiceDelimiter;
if (this.appendChoiceDelimiter == null) { choiceText = currentText + choiceText;
	protected boolean handleKeyPressed(int keyCode, int gameAction) {		//#debug		System.out.println("keyPressed( keyCode=" + keyCode + ", gameAction=" + gameAction +  ", isInChoice=" + this.isInChoice + " )");		if (this.isInChoice) {			if ( this.choicesContainer.handleKeyPressed(keyCode, gameAction) ) {				//#debug				System.out.println("keyPressed handled by choices container");				return true;			}			//System.out.println("focusing textfield again, isFocused=" + this.isFocused);			enterChoices( false );						if (gameAction == Canvas.FIRE) {				// option has been selected!				Item item = this.choicesContainer.getFocusedItem();				String choiceText;				if ( item instanceof ChoiceItem ) {					choiceText = ((ChoiceItem) item).getText();				} else {					choiceText = item.toString();				}				if (this.isAppendMode) {					String currentText = getString();					if ( (currentText != null) && (currentText.length() > 1) ) {						if (this.appendDelimiterIndex != -1 && this.appendDelimiterIndex < currentText.length() ) {							currentText = currentText.substring( 0, this.appendDelimiterIndex );						}						if (this.appendChoiceDelimiter == null) {							choiceText = currentText + choiceText; 						} else {							if ( currentText.endsWith( this.appendChoiceDelimiter ) ) {								choiceText = currentText + choiceText + this.appendChoiceDelimiter;							} else {								choiceText = currentText + this.appendChoiceDelimiter + choiceText + this.appendChoiceDelimiter;							}						}					} else if (this.appendChoiceDelimiter != null) {						choiceText += this.appendChoiceDelimiter;					}					this.appendDelimiterIndex = choiceText.length();				}				if (!this.isAllowFreeTextEntry) {					this.lastMatchingText = choiceText;				}				//#if polish.usePolishGui						setString( choiceText );					//# setCaretPosition( choiceText.length() );				//#endif				this.numberOfMatches = 0;				openChoices( false );				super.notifyStateChanged();			}			return true;		} else if ( (gameAction == Canvas.DOWN && keyCode != Canvas.KEY_NUM8)				&& this.numberOfMatches > 0) {			//System.out.println("focusing choices container");			enterChoices( true );			return true;		} else if (gameAction == Canvas.FIRE && keyCode != Canvas.KEY_NUM5) {			//if (this.numberOfMatches == 0) {				if (this.choices == null) {					//#if polish.usePolishGui						//# return super.handleKeyPressed(keyCode, gameAction);					//#else						return true;					//#endif				}				if (this.numberOfMatches == this.choices.length) {					this.numberOfMatches = 0; // close choices container					openChoices( false );				} else {					this.appendDelimiterIndex = -1;//					if (!this.isAllowFreeTextEntry) {//						//					}					this.choicesContainer.clear();					for (int i = 0; i < this.choices.length; i++) {						Item item = this.choiceItems[i];						if (item == null) {							// create new ChoiceItem (lazy initialisation)							item = new ChoiceItem( this.choices[i], null, Choice.IMPLICIT, this.choiceItemStyle );						}						this.choicesContainer.add( item );					}					this.numberOfMatches = this.choicesContainer.size();					openChoices( true );				}			//}			return true;		}		//#if polish.usePolishGui			//# return super.handleKeyPressed(keyCode, gameAction);		//#else			return true;		//#endif	}