Пример #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);
              }
            });
  }
  public void ProcessError(int type, final String message) {
    System.out.println("-----ProcessError");
    System.out.println("-----type = " + type);
    System.out.println("-----message = " + message);

    UiApplication.getUiApplication()
        .invokeLater(
            new Runnable() {
              public void run() {
                try {
                  if (message.equals("Unauthorized")) {
                    System.out.println("-----ProcessError (message.equals(Unauthorized))");

                    doRequest(REQUEST_SESSION);
                  } else {
                    Status.show(message);
                  }

                } catch (Exception e) {

                }
              }
            });
  };
Пример #7
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.");
                }
              }
            });
  }