/* (non-Javadoc) * @see javax.microedition.lcdui.ItemCommandListener#commandAction(javax.microedition.lcdui.Command, javax.microedition.lcdui.Item) */ public void commandAction(Command command, Item item) { // System.out.println("DefaultRssItemCommandListner: command ="+ command.getLabel() ); if (command == RssTagHandler.CMD_RSS_ITEM_SELECT) { RssItem rssItem = (RssItem) UiAccess.getAttribute(item, RssItem.ATTRIBUTE_KEY); String rssUrl = rssItem.getLink(); if (rssUrl != null && this.rssBrowser != null) { this.rssBrowser.getRssTagHandler().onViewUrl(rssUrl, item); } if (rssItem != null && StyleSheet.display != null) { // #style rssDescriptionAlert Alert alert = new Alert( rssItem.getTitle(), rssItem.getDescription(), null, AlertType.INFO, de.enough.polish.ui.StyleSheet.rssdescriptionalertStyle); alert.setTimeout(Alert.FOREVER); alert.addCommand(RssTagHandler.CMD_GO_TO_ARTICLE); alert.addCommand(HtmlTagHandler.CMD_BACK); alert.setCommandListener(this); StyleSheet.display.setCurrent(alert); this.url = rssItem.getLink(); } } else { this.rssBrowser.handleCommand(command); } }
public void run() { Object o; while (!quit) { o = null; try { while (counter > 0) { Thread.sleep(300); counter--; } } catch (InterruptedException e) { } synchronized (queue) { if (queue.size() > 0) { /* //#debug info System.out.println("queue firstElement tooltip: " + queue.firstElement()); for(int i = 0; i < queue.size() ; i++ ) { //#debug info System.out.println("queue[" + i + "] tooltip: " + queue.elementAt(i)); } //#debug info System.out.println("queue lastElement tooltip: " + queue.lastElement()); */ o = queue.lastElement(); queue.removeAllElements(); } else { try { queue.wait(); } catch (InterruptedException e) { } } } if (o != null) { boolean setTooltip = false; if (_cutomTableItem.getClass() == CustomTableItem.class) { CustomImageItem customImageItem = (CustomImageItem) _tooltipObject; if ((_cutomTableItem.getFocusedItem() == customImageItem) && _cutomTableItem.isFocused && _cutomTableItem._workingForm.isActive()) { setTooltip = true; } } if (setTooltip == true) { // #style .centeredCell tooltipAlert.setString(o.toString()); tooltipAlert.setTimeout(4000); if (!tooltipAlert.isShown()) { Utility.show(Display.getDisplay(ABSALive.getInstance()), tooltipAlert); } } } } }