public MediaItemsListCellRenderer() { super(); NedMidlet.getInstance().getDownloadManager().setMediaListUpdater(this); if (com.sun.lwuit.Display.getInstance().isTouchScreenDevice()) { getStyle().setPadding(10, 10, 2, 2); getSelectedStyle().setPadding(10, 10, 2, 2); } if (getPreferredH() < ICON_FIT_SIZE) { setPreferredH(ICON_FIT_SIZE); } displayW = Display.getInstance().getDisplayWidth(); setLayout(new BoxLayout(BoxLayout.X_AXIS)); setWidth(displayW); setFocusable(true); mMediaType = new Label(" "); // must set some text to render properly mMediaType.getStyle().setPadding(0, 0, 0, 0); mMediaType.getStyle().setMargin(0, 0, 0, 0); mMediaType.getSelectedStyle().setPadding(0, 0, 0, 0); mMediaType.getSelectedStyle().setMargin(0, 0, 0, 0); mMediaType.setAlignment(Label.LEFT); mMediaType.getStyle().setBgTransparency(0); mMediaType.setPreferredW(ICON_WIDTH); mMediaType.setCellRenderer(true); mTitle.setPreferredW(displayW - 3 * ICON_WIDTH); removeComponent(mTitle); mFlag = new Label(); mFlag.getStyle().setPadding(0, 0, 0, 0); mFlag.getStyle().setMargin(0, 0, 0, 0); mFlag.getSelectedStyle().setPadding(0, 0, 0, 0); mFlag.getSelectedStyle().setMargin(0, 0, 0, 0); mFlag.setAlignment(Label.RIGHT); mFlag.getStyle().setBgTransparency(0); mFlag.setPreferredW(ICON_WIDTH); mFlag.setCellRenderer(true); addComponent(mMediaType); addComponent(mTitle); addComponent(mFlag); local = NedResources.getRes().getImage("Local"); remote = NedResources.getRes().getImage("Remote"); }
protected void doAction(Object aParam) { GeneralAlert.show( NedResources.VERSION + ' ' + NedMidlet.getInstance().getVersion(), GeneralAlert.INFO); }