Пример #1
0
  /**
   * Build the top level menu
   *
   * @param context
   */
  private void buildMenu(Context context) {
    // build the menu
    Menu bar = new MenuImpl();
    bar.add(new MenuEntry(rb.getString("archive.button.single"), "doView_single"));
    bar.add(new MenuEntry(rb.getString("archive.button.batch"), "doView_batch"));
    bar.add(new MenuEntry(rb.getString("archive.button.download"), "doView_download"));

    context.put(Menu.CONTEXT_MENU, bar);
    context.put(Menu.CONTEXT_ACTION, "ArchiveAction");
  }
 /** Add the menus for search. */
 protected void addSearchMenus(Menu bar, SessionState state) {
   bar.add(new MenuDivider());
   bar.add(
       new MenuField(
           FORM_SEARCH, "toolbar", "doSearch", (String) state.getAttribute(STATE_SEARCH)));
   bar.add(
       new MenuEntry(
           rb.getString("sea.sea"), null, true, MenuItem.CHECKED_NA, "doSearch", "toolbar"));
   if (state.getAttribute(STATE_SEARCH) != null) {
     bar.add(new MenuEntry(rb.getString("sea.cleasea"), "doSearch_clear"));
   }
 } // addSearchMenus
 /** Add the menus for a view mode for paging. */
 protected void addViewPagingMenus(Menu bar, SessionState state) {
   bar.add(
       new MenuEntry(
           rb.getString("viepag.prev"),
           (state.getAttribute(STATE_PREV_EXISTS) != null),
           "doView_prev"));
   bar.add(
       new MenuEntry(
           rb.getString("viepag.next"),
           (state.getAttribute(STATE_NEXT_EXISTS) != null),
           "doView_next"));
 } // addViewPagingMenus
  /** Add the menus for manual / auto - refresh. */
  protected void addRefreshMenus(Menu bar, SessionState state) {
    // only offer if there's an observer
    ObservingCourier observer = (ObservingCourier) state.getAttribute(STATE_OBSERVER);
    if (observer == null) return;

    bar.add(new MenuDivider());
    bar.add(
        new MenuEntry(
            (observer.getEnabled() ? rb.getString("ref.manref") : rb.getString("ref.autoref")),
            "doAuto"));
    if (!observer.getEnabled()) {
      bar.add(new MenuEntry(rb.getString("ref.refresh"), "doRefresh"));
    }
  } // addRefreshMenus
 /** Add the menus for a list mode for paging. */
 protected void addListPagingMenus(Menu bar, SessionState state) {
   bar.add(
       new MenuEntry(
           "First Page", (state.getAttribute(STATE_PREV_PAGE_EXISTS) != null), "doList_first"));
   bar.add(
       new MenuEntry(
           "Previous Page", (state.getAttribute(STATE_PREV_PAGE_EXISTS) != null), "doList_prev"));
   bar.add(
       new MenuEntry(
           "Next Page", (state.getAttribute(STATE_NEXT_PAGE_EXISTS) != null), "doList_next"));
   bar.add(
       new MenuEntry(
           "Last Page", (state.getAttribute(STATE_NEXT_PAGE_EXISTS) != null), "doList_last"));
 } // addListPagingMenus