public JMenuBar getPanelMenuBar() {
   if (panelMenuBar == null) {
     JMenuItem menuItem;
     ICFLibAnyObj container = getSwingContainer();
     panelMenuBar = new JMenuBar();
     menuAdd = new JMenu("Add");
     actionAddSecGroupMember = new ActionAddSecGroupMember();
     if (container instanceof ICFSecuritySecGroupObj) {
       menuItem = new JMenuItem(actionAddSecGroupMember);
       menuAdd.add(menuItem);
     }
     if (getSwingContainer() != null) {
       panelMenuBar.add(menuAdd);
     }
     menuSelected = new JMenu("Selected");
     menuSelected.setEnabled(false);
     actionViewSelected = new ViewSelectedActionSecGroupMember();
     menuItem = new JMenuItem(actionViewSelected);
     menuSelected.add(menuItem);
     actionEditSelected = new EditSelectedActionSecGroupMember();
     menuItem = new JMenuItem(actionEditSelected);
     menuSelected.add(menuItem);
     actionDeleteSelected = new DeleteSelectedActionSecGroupMember();
     menuItem = new JMenuItem(actionDeleteSelected);
     menuSelected.add(menuItem);
     panelMenuBar.add(menuSelected);
   }
   return (panelMenuBar);
 }
 public JMenuBar getPanelMenuBar() {
   if (panelMenuBar == null) {
     JMenuItem menuItem;
     ICFLibAnyObj container = getSwingContainer();
     panelMenuBar = new JMenuBar();
     menuAdd = new JMenu("Add");
     actionAddMajorVersion = new ActionAddMajorVersion();
     if (container instanceof ICFInternetRealProjectObj) {
       menuItem = new JMenuItem(actionAddMajorVersion);
       menuAdd.add(menuItem);
     }
     actionAddMinorVersion = new ActionAddMinorVersion();
     if (container instanceof ICFInternetMajorVersionObj) {
       menuItem = new JMenuItem(actionAddMinorVersion);
       menuAdd.add(menuItem);
     }
     if (getSwingContainer() != null) {
       panelMenuBar.add(menuAdd);
     }
     menuSelected = new JMenu("Selected");
     menuSelected.setEnabled(false);
     actionViewSelected = new ViewSelectedActionVersion();
     menuItem = new JMenuItem(actionViewSelected);
     menuSelected.add(menuItem);
     actionEditSelected = new EditSelectedActionVersion();
     menuItem = new JMenuItem(actionEditSelected);
     menuSelected.add(menuItem);
     actionDeleteSelected = new DeleteSelectedActionVersion();
     menuItem = new JMenuItem(actionDeleteSelected);
     menuSelected.add(menuItem);
     panelMenuBar.add(menuSelected);
   }
   return (panelMenuBar);
 }
 public JMenuBar getPanelMenuBar() {
   if (panelMenuBar == null) {
     JMenuItem menuItem;
     ICFLibAnyObj container = getSwingContainer();
     panelMenuBar = new JMenuBar();
     menuAdd = new JMenu("Add");
     actionAddTextCol = new ActionAddTextCol();
     if (container instanceof ICFDbTestTableObj) {
       menuItem = new JMenuItem(actionAddTextCol);
       menuAdd.add(menuItem);
     }
     actionAddTextType = new ActionAddTextType();
     if (container instanceof ICFDbTestSchemaDefObj) {
       menuItem = new JMenuItem(actionAddTextType);
       menuAdd.add(menuItem);
     }
     if (getSwingContainer() != null) {
       panelMenuBar.add(menuAdd);
     }
     menuSelected = new JMenu("Selected");
     menuSelected.setEnabled(false);
     actionViewSelected = new ViewSelectedActionTextDef();
     menuItem = new JMenuItem(actionViewSelected);
     menuSelected.add(menuItem);
     actionEditSelected = new EditSelectedActionTextDef();
     menuItem = new JMenuItem(actionEditSelected);
     menuSelected.add(menuItem);
     actionDeleteSelected = new DeleteSelectedActionTextDef();
     menuItem = new JMenuItem(actionDeleteSelected);
     menuSelected.add(menuItem);
     panelMenuBar.add(menuSelected);
   }
   return (panelMenuBar);
 }
  private void addMenuItems(JMenu f, String m[]) {

    Dimension d = Toolkit.getDefaultToolkit().getScreenSize();

    for (int i = 0; i < m.length; i++) {
      if (m[i].equals("--")) {
        f.addSeparator();
      } else if (m[i].equals("---")) {

        // (ulrivo): full size on screen with less than 640 width
        if (d.width >= 640) {
          f.addSeparator();
        } else {
          return;
        }
      } else {
        JMenuItem item = new JMenuItem(m[i].substring(1));
        char c = m[i].charAt(0);

        if (c != '-') {
          item.setMnemonic(c);
        }

        item.addActionListener(this);
        f.add(item);
      }
    }
  }
Пример #5
0
  private void initUI() {
    // Create tabbed pane with commands in it
    tabbedPane = new JTabbedPane();
    getContentPane().add(tabbedPane, BorderLayout.NORTH);

    tabbedPane.addTab("Book", null, createBookPane(), "View book information");
    tabbedPane.addTab("Author", null, createAuthorPane(), "View author information");
    tabbedPane.addTab("Customer", null, createCustomerPane(), "View customer information");
    tabbedPane.addTab("Borrow Book", null, createBorrowPane(), "Borrow books for a customer");
    tabbedPane.addTab("Return Book", null, createReturnPane(), "Return books for a customer");

    // Create output area with scrollpane
    outputArea = new JTextArea();
    // outputArea.setFont(new Font("Monospaced",Font.PLAIN,12));
    outputArea.setFont(new Font("Monospaced", Font.ROMAN_BASELINE, 12));
    outputArea.setEditable(false);
    outputArea.setFocusable(false);
    outputArea.setTabSize(2);
    JScrollPane sp = new JScrollPane(outputArea);
    sp.setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_ALWAYS);

    getContentPane().add(sp, BorderLayout.CENTER);

    // Create menus
    JMenu fileMenu = new JMenu("File");
    fileMenu.setMnemonic('F');

    JMenuItem clearTextMenuItem = new JMenuItem(clearTextAction);
    JMenuItem exitMenuItem = new JMenuItem(exitAction);

    fileMenu.add(clearTextMenuItem);
    fileMenu.addSeparator();
    fileMenu.add(exitMenuItem);

    JMenuBar menuBar = new JMenuBar();
    menuBar.add(fileMenu);
    setJMenuBar(menuBar);

    // Pack it all
    pack();
  }
 public JMenuBar getFrameMenuBar() {
   if (frameMenuBar == null) {
     JMenuItem menuItem;
     frameMenuBar = new JMenuBar();
     menuFile = new JMenu("File");
     actionEdit = new ActionEdit();
     menuItem = new JMenuItem(actionEdit);
     menuFile.add(menuItem);
     actionSave = new ActionSave();
     menuItem = new JMenuItem(actionSave);
     menuFile.add(menuItem);
     actionClose = new ActionClose();
     menuItem = new JMenuItem(actionClose);
     menuFile.add(menuItem);
     actionDelete = new ActionDelete();
     menuItem = new JMenuItem(actionDelete);
     menuFile.add(menuItem);
     frameMenuBar.add(menuFile);
   }
   return (frameMenuBar);
 }
 public JMenuBar getFinderMenuBar() {
   if (finderMenuBar == null) {
     JMenuItem menuItem;
     finderMenuBar = new JMenuBar();
     menuFile = new JMenu("File");
     actionAddServiceType = new ActionAddServiceType();
     menuItem = new JMenuItem(actionAddServiceType);
     menuFile.add(menuItem);
     actionViewSelected = new ActionViewSelectedServiceType();
     menuItem = new JMenuItem(actionViewSelected);
     menuFile.add(menuItem);
     actionEditSelected = new ActionEditSelectedServiceType();
     menuItem = new JMenuItem(actionEditSelected);
     menuFile.add(menuItem);
     actionDeleteSelected = new ActionDeleteSelectedServiceType();
     menuItem = new JMenuItem(actionDeleteSelected);
     menuFile.add(menuItem);
     actionClose = new ActionClose();
     menuItem = new JMenuItem(actionClose);
     menuFile.add(menuItem);
     finderMenuBar.add(menuFile);
   }
   return (finderMenuBar);
 }