if (this.singleLeftCommand != null) { Command cmd = this.singleLeftCommand; this.singleLeftCommand = null; addCommand( cmd ); }
	public void addSubCommand(Command childCommand, Command parentCommand, Style commandStyle) {        //#if tmp.useInvisibleMenuBar	        if (parentCommand == this.positiveCommand) {	            this.positiveCommand = null;	        }	    //#endif		// find parent CommandItem, could be tricky, especially when there are nested commands over several layers		int index = this.commandsList.indexOf( parentCommand );		CommandItem parentCommandItem = null;		if (index != -1) {			// found it:			parentCommandItem = (CommandItem) this.commandsContainer.get( index );		} else if (parentCommand == this.singleLeftCommand ){			parentCommandItem = new CommandItem( parentCommand, this );			this.commandsContainer.add( parentCommandItem );			this.commandsList.add( parentCommand );			this.singleLeftCommand = null;		} else if (parentCommand == this.singleRightCommand ){			parentCommandItem = new CommandItem( parentCommand, this );			this.commandsContainer.add( parentCommandItem );			this.commandsList.add( parentCommand );			this.singleRightCommand = null;		} else {			// search through all commands			for ( int i=0; i < this.commandsContainer.size(); i++ ) {				CommandItem item = (CommandItem) this.commandsContainer.get( i );				parentCommandItem = item.getChild( parentCommand );				if ( parentCommandItem != null ) {					break;				}			}		}		if ( parentCommandItem == null ) {			throw new IllegalStateException();		}		parentCommandItem.addChild( childCommand, commandStyle );		if (this.isOpened) {			this.isInitialised = false;			repaint();		}	}