this.isFocused = true; int newFocusIndex = this.focusedIndex;   if (this.view != null && false) {  Item[] myItems = getItems();  if (direction == Canvas.UP || direction == Canvas.LEFT ) {  for (int i = myItems.length; --i >= 0; ) { Item item = myItems[i]; if (item.appearanceMode != PLAIN) { newFocusIndex = i; break; } } } else {  for (int i = 0; i < myItems.length; i++) { Item item = myItems[i]; if (item.appearanceMode != PLAIN) { newFocusIndex = i; break; } }
return false; } Item item = (Item) this.itemsList.get(index ); if (item.appearanceMode != Item.PLAIN) { int direction = 0; if (this.isFocused) { if (this.focusedIndex == -1) {  } else if (this.focusedIndex < index ) { direction = Canvas.DOWN; } else if (this.focusedIndex > index) { direction = Canvas.UP;
	protected Style focus(Style focusstyle, int direction ) {		//#if polish.css.include-label			if ( this.includeLabel || this.itemsList.size() == 0) {		//#else			//# if ( this.itemsList.size() == 0) {		//#endif			return super.focus( this.focusedStyle, direction );		} else {			if (this.focusedStyle != null) {				focusstyle = this.focusedStyle;			}			//#if tmp.supportViewType				if (this.view != null) {					this.view.focus(focusstyle, direction);					//this.isInitialised = false; not required				}			//#endif			this.isFocused = true;			int newFocusIndex = this.focusedIndex;			//if (this.focusedIndex == -1) {			//#if tmp.supportViewType				if (this.view != null && false) {			//#endif				Item[] myItems = getItems();				// focus the first interactive item...				if (direction == Canvas.UP || direction == Canvas.LEFT ) {					//System.out.println("Container: direction UP with " + myItems.length + " items");					for (int i = myItems.length; --i >= 0; ) {						Item item = myItems[i];						if (item.appearanceMode != PLAIN) {							newFocusIndex = i;							break;						}					}				} else {					//System.out.println("Container: direction DOWN");					for (int i = 0; i < myItems.length; i++) {						Item item = myItems[i];						if (item.appearanceMode != PLAIN) {							newFocusIndex = i;							break;						}					}				}				this.focusedIndex = newFocusIndex;				if (newFocusIndex == -1) {					//System.out.println("DID NOT FIND SUITEABLE ITEM");					// this container has only non-focusable items!					return super.focus( this.focusedStyle, direction );				}			//}			//#if tmp.supportViewType				} else if (this.focusedIndex == -1) {					Item[] myItems = getItems();					//System.out.println("Container: direction DOWN through view type " + this.view);					for (int i = 0; i < myItems.length; i++) {						Item item = myItems[i];						if (item.appearanceMode != PLAIN) {							newFocusIndex = i;							break;						}					}					this.focusedIndex = newFocusIndex;					if (newFocusIndex == -1) {						//System.out.println("DID NOT FIND SUITEABLE ITEM");						// this container has only non-focusable items!						return super.focus( this.focusedStyle, direction );					}				}			//#endif			Item item = (Item) this.itemsList.get( this.focusedIndex );//			Style previousStyle = item.style;//			if (previousStyle == null) {//				previousStyle = StyleSheet.defaultStyle;//			}			focus( this.focusedIndex, item, direction );			if (item.commands == null && this.commands != null) {				Screen scr = getScreen();				if (scr != null) {					scr.setItemCommands(this);				}			}			// change the label-style of this container:			//#ifdef polish.css.label-style				if (this.label != null) {					Style labStyle = (Style) focusstyle.getObjectProperty("label-style");					if (labStyle != null) {						this.labelStyle = this.label.style;						this.label.setStyle( labStyle );					}				}			//#endif			return this.style;		}	}