/*************************************************************************** * To display the result of the test in a javax.microedition.lcdui.List * screen. */ public void showResult() { if (bScreenOutput) Display.getDisplay(this).setCurrent(getResultsList()); }
/** * DOCUMENT ME! * * @return DOCUMENT ME! */ public Displayable getCurrent() { return this.display.getCurrent(); }
/** * @see net.sf.microlog.midp.RecordStoreLogViewer.AbstractCommand#execute() */ public void execute() { display.setCurrent(logScreen); } }
/** * Show an information alert. * * @param message * the message to show. * @param exception * an optional exception to append to the message. Could be null. */ protected void showInfoAlert(String message, Throwable exception) { StringBuffer buffer = new StringBuffer(message); if (exception != null) { buffer.append("\r\n"); buffer.append(exception); } Alert alert = new Alert("Info", buffer.toString(), null, AlertType.INFO); display.setCurrent(alert, display.getCurrent()); }
/** * Creates a new HospitalMIDlet object. */ public HospitalMIDlet() { super(); display = Display.getDisplay(this); midlet = this; }
/** * DOCUMENT ME! * * @param toShowDisplayable DOCUMENT ME! * @param toSave DOCUMENT ME! */ public void show(Displayable toShowDisplayable, boolean toSave) { this.display.setCurrent(toShowDisplayable); if (toSave) this.toShow.push(toShowDisplayable); }
private DisplayManager(MIDlet midlet) { this.midlet = midlet; this.display = Display.getDisplay(this.midlet); this.toShow = new Stack(); this.back = new Stack(); }
/** * DOCUMENT ME! * * @param alertToShow DOCUMENT ME! * @param nextDisplayableToShow DOCUMENT ME! * @param toSave DOCUMENT ME! */ public void show(Alert alertToShow, Displayable nextDisplayableToShow, boolean toSave) { this.display.setCurrent(alertToShow, nextDisplayableToShow); if (toSave) this.toShow.push(nextDisplayableToShow); }
private void start(final Test aTestSuite) { final Display rDisplay = Display.getDisplay(this); Form aForm = new Form("TestRunner"); if (nCount == 0) { aForm.append("No tests found."); rDisplay.setCurrent(aForm); return; aForm.setCommandListener(this); rDisplay.setCurrent(aForm);
/** * Create a RecordStoreLogViewer. */ public RecordStoreLogViewer() { super(); display = Display.getDisplay(this); logScreen = new Form("Log content"); logScreen.addCommand(loadLogCommand); logScreen.addCommand(clearLogCommand); logScreen.addCommand(preferenceCommand); logScreen.addCommand(exitCommand); logScreen.addCommand(switchComparatorCommand); logScreen.setCommandListener(this); preferenceScreen = new Form("Preferences"); nameField = new TextField("RecordStore name ", null, MAX_NAME_LENGTH, TextField.ANY); preferenceScreen.append(nameField); preferenceScreen.addCommand(preferenceOkCommand); preferenceScreen.addCommand(preferenceCancelCommand); preferenceScreen.addCommand(exitCommand); preferenceScreen.setCommandListener(this); }
/** * DOCUMENT ME! * * @param alertToShow DOCUMENT ME! * * @throws DisplayManagerException DOCUMENT ME! */ public void show(Alert alertToShow) throws DisplayManagerException { if (this.toShow.empty()) throw new DisplayManagerException("Not enough displayables at stack."); this.display.setCurrent(alertToShow, (Displayable) this.toShow.peek()); }
/** * DOCUMENT ME! * * @throws DisplayManagerException DOCUMENT ME! */ public void show() throws DisplayManagerException { if (this.toShow.empty()) throw new DisplayManagerException("Not enough displayables at stack."); display.setCurrent((Displayable) this.toShow.peek()); }
/** * DOCUMENT ME! * * @param displayable DOCUMENT ME! */ public static void setCurrent(Displayable displayable) { if (exception != null) { Alert alert = new Alert("Error", exception.getMessage(), null, AlertType.ERROR); alert.setTimeout(Alert.FOREVER); display.setCurrent(alert, displayable); exception = null; } else { display.setCurrent(displayable); } }
/** * Start the MIDlet. * * @throws MIDletStateChangeException * if the MIDlet fails to change the state. */ protected void startApp() throws MIDletStateChangeException { Properties properties = new MidletProperties(this, MicrologConstants.DEFAULT_PROPERTY_FILE); loader = new RecordStoreLogLoader(properties); display.setCurrent(logScreen); }
/** * @see net.sf.microlog.midp.RecordStoreLogViewer.AbstractCommand#execute() */ public void execute() { nameField.setString(loader.getRecordStoreName()); display.setCurrent(preferenceScreen); }