示例#1
0
 public void hideWaitingScreen() {
   UiApplication.getUiApplication()
       .invokeLater(
           new Runnable() {
             public void run() {
               waiting_dialog.close();
             }
           });
 }
示例#2
0
 public void showWaitingScreen() {
   UiApplication.getUiApplication()
       .invokeLater(
           new Runnable() {
             public void run() {
               waiting_dialog.doModal();
             }
           });
 }
示例#3
0
 public void refresh() {
   invalidate();
   UiApplication.getUiApplication()
       .invokeLater(
           new Runnable() {
             public void run() {
               updateDisplay();
             }
           });
 }
示例#4
0
 public void openBrowser(final String url) {
   UiApplication.getUiApplication()
       .invokeLater(
           new Runnable() {
             public void run() {
               BrowserSession browserSession = Browser.getDefaultSession();
               browserSession.displayPage(url); // or your intranet site
             }
           });
 }
示例#5
0
  public void showMiniMenu() {
    if (menu_open) return;

    pushMiniMenu = true;
    UiApplication.getUiApplication()
        .invokeLater(
            new Runnable() {
              public void run() {
                m_this.onMenu(Menu.INSTANCE_CONTEXT);
              }
            });
  }
示例#6
0
  public static void popUpYesNoDialog(
      final int textAddr,
      final String yesButtonStr,
      final String noButtonStr,
      final int yesCallback,
      final int noCallback,
      final int blocking) {
    final String sText = CRunTime.charPtrToString(textAddr, 8000);
    UiApplication.getUiApplication()
        .invokeAndWait(
            new Runnable() {
              public void run() {
                Dialog d =
                    new Dialog(
                        sText,
                        new String[] {noButtonStr, yesButtonStr},
                        new int[] {Dialog.NO, Dialog.YES},
                        Dialog.YES,
                        new Bitmap(0, 0));

                if (blocking == 0) {
                  // None blocking option
                  d.setDialogClosedListener(
                      new DialogClosedListener() {
                        public void dialogClosed(Dialog d, int dialogReturnValue) {
                          if (dialogReturnValue == Dialog.NO) {
                            try {
                              UIWorker.addUIEvent(noCallback, 0, 0, 0, 0, true);
                            } catch (Exception t) {
                              UIWorker.addUIEventLog(
                                  "Exception while calling noCallback in FreemapMainScreen.java -> popUpYesNoDialog"
                                      + t);
                            }
                          }

                          if (dialogReturnValue == Dialog.YES) {;
                            try {
                              UIWorker.addUIEvent(yesCallback, 0, 0, 0, 0, true);
                            } catch (Exception t) {
                              UIWorker.addUIEventLog(
                                  "Exception while calling yesCallback in FreemapMainScreen.java -> popUpYesNoDialog"
                                      + t);
                            }
                          }
                        }
                      });
                  d.show();

                } else if (blocking == 1) {
                  int index_chosen;
                  index_chosen = d.doModal();
                  if (index_chosen == Dialog.YES) {
                    try {
                      UIWorker.addUIEvent(yesCallback, 0, 0, 0, 0, true);
                    } catch (Exception t) {
                      UIWorker.addUIEventLog(
                          "Exception while calling yesCallback in FreemapMainScreen.java -> popUpYesNoDialog"
                              + t);
                    }
                  } else if (index_chosen == Dialog.NO) {
                    try {
                      UIWorker.addUIEvent(noCallback, 0, 0, 0, 0, true);
                    } catch (Exception t) {
                      UIWorker.addUIEventLog(
                          "Exception while calling noCallback in FreemapMainScreen.java -> popUpYesNoDialog"
                              + t);
                    }
                  }
                } else {
                  UIWorker.addUIEventLog(
                      "ERROR - input parameter blocking in popUpYesNoDialog is not valid.");
                }
              }
            });
  }