コード例 #1
0
 /* (non-Javadoc)
  * @see Displayable#addCommand(Command)
  */
 public void addCommand(Command command) {
   if (command != DISMISS_COMMAND) {
     super.addCommand(command);
     super.removeCommand(DISMISS_COMMAND);
     setCommandsVisibility(isModal());
   }
 }
コード例 #2
0
 /* (non-Javadoc)
  * @see Displayable#removeCommand(Command)
  */
 public void removeCommand(Command command) {
   if (command != DISMISS_COMMAND) {
     super.removeCommand(command);
     if (getNumCommands() == 0) {
       super.addCommand(DISMISS_COMMAND);
     }
     setCommandsVisibility(isModal());
   }
 }
コード例 #3
0
 /**
  * Create a new Alert with the specified title, text, image, and alert type.
  *
  * @param title the title string
  * @param text the text string
  * @param image the image
  * @param type the alert type
  */
 public Alert(String title, String text, Image image, AlertType type) {
   super(title);
   construct();
   this.type = type;
   setImage(image);
   setString(text);
   setTimeout(getDefaultTimeout());
   super.addCommand(DISMISS_COMMAND);
   super.setCommandListener(implicitListener);
 }