if (cmd == this.positiveCommand) { this.positiveCommand = null; }
	public void removeCommand(Command cmd) {		//#debug		System.out.println("removing command " + cmd.getLabel() + " (" + cmd + ")");		// 1.case: cmd == this.singleLeftCommand		if ( cmd == this.singleLeftCommand ) {			this.singleLeftCommand = null;			if (this.isInitialised) {				this.isInitialised = false;				repaint();			}			//System.out.println("remiving single left");			return;		}				// 2.case: cmd == this.singleRightCommand		if ( cmd == this.singleRightCommand ) {			// remove single right command:			this.singleRightCommand = null;			//System.out.println("removing single right command");			// check if there is another BACK or CANCEL command and 			// select the one with the highest priority:			if (this.singleLeftCommand != null) {				if ( this.singleLeftCommand.getCommandType()  == Command.BACK 					|| this.singleLeftCommand.getCommandType()  == Command.CANCEL ) 				{					this.singleRightCommand = this.singleLeftCommand;					this.singleRightCommandItem.setText( this.singleLeftCommand.getLabel() );					this.singleLeftCommand = null;				}				if (this.isInitialised) {					this.isInitialised = false;					repaint();				}				return;			}			// there are several commands available, from the which the BACK/CANCEL command			// with the highest priority needs to be chosen:			Command[] myCommands = (Command[]) this.commandsList.toArray( new Command[ this.commandsList.size() ]);			int maxPriority = 1000;			int maxPriorityId = -1;			for (int i = 0; i < myCommands.length; i++) {				Command command = myCommands[i];				int type = command.getCommandType();				//#if polish.blackberry					if ((type == Command.BACK || type == Command.CANCEL || type == Command.EXIT)				//#else					//# if ((type == Command.BACK || type == Command.CANCEL)				//#endif						&& command.getPriority() < maxPriority ) 				{					maxPriority = command.getPriority();					maxPriorityId = i;				}			}			if ( maxPriorityId != -1 ) {				this.singleRightCommand = (Command) this.commandsList.remove(maxPriorityId);				this.singleRightCommandItem.setText( this.singleRightCommand.getLabel() );				this.commandsContainer.remove( maxPriorityId );			}			// don't return here yet, since it could well be that there is only			// one remaining item in the commandsList. In such a case the 			// single left command is used instead.		}				// 3.case: cmd belongs to command collection		int index = this.commandsList.indexOf( cmd );		if (index != -1) {			//System.out.println("removing normal command");			this.commandsList.remove( index );			this.commandsContainer.remove( index );		}		// if there is only one remaining item in the commandsList, the 		// single left command is used instead:		//#if !tmp.useInvisibleMenuBar		if (this.commandsList.size() == 1) {			//System.out.println("moving only left command to single-left-one");			Command command = (Command) this.commandsList.remove( 0 );			this.commandsContainer.remove( 0 );			this.singleLeftCommand = command;			this.singleLeftCommandItem.setText( command.getLabel() );		}		//#endif		if (this.isInitialised) {			this.isInitialised = false;			repaint();		}	}