Example #1
0
  public void setMiniMenuItem(
      String text, int ordinal, final int wrapper_callback, final int callback) {
    if (callback != 0) {
      MenuItem menu_item = null;
      menu_item =
          new MenuItem(text, ordinal, 1) {
            public void run() {
              try {
                int c_on_menuItem = CibylCallTable.getAddressByName("rim_on_menuItem");
                if (c_on_menuItem != 0) {
                  UIWorker.addUIEvent(c_on_menuItem, wrapper_callback, callback, 0, 0, true);
                }
              } catch (Exception ex) {
                UIWorker.addUIEventLog("Exception run (menuMiniItem): " + ex.toString());
              }
            }
          };

      m_MiniMenuItems.setElementAt(menu_item, ordinal - 1);
    } else {
      m_menuItems.setElementAt(MenuItem.separator(ordinal - 1), ordinal - 1);
    }
  }
Example #2
0
  public void setContextMenuItem(String text, final int ordinal, final int callback) {
    // System.out.println("***** setContextMenuItem *****");
    // System.out.println("text=" + text+text.length());

    MenuItem menu = null;

    if (text.length() > 0) {
      menu =
          new MenuItem(text, ordinal, 1) {
            public void run() {
              try {
                int c_on_menuItem = CibylCallTable.getAddressByName("rim_on_menuItem");
                if (c_on_menuItem != 0) {
                  UIWorker.addUIEvent(c_on_menuItem, callback, ordinal, 0, 0, true);
                }
              } catch (Exception ex) {
                UIWorker.addUIEventLog("Exception run (contextMiniItem): " + ex.toString());
              }
            }
          };
    }

    m_contextMenuItems.setElementAt(menu, ordinal - 1);
  }
Example #3
0
 protected void onMenuDismissed(Menu menu) {
   menu_open = false;
   for (int i = 0; i < m_contextMenuItems.size(); ++i) {
     m_MiniMenuItems.setElementAt(null, i);
   }
 }