Beispiel #1
0
 /**
  * Create the associated menu
  *
  * @return the menu
  */
 public static MenuItem createMenuItem() {
   MenuItem menuItem = ScilabMenuItem.createMenuItem();
   menuItem.setText(LABEL);
   menuItem.setMnemonic(MNEMONIC);
   menuItem.setCallback(getCallBack());
   ((SwingScilabMenuItem) menuItem.getAsSimpleMenuItem()).setIcon(new ImageIcon(ICON));
   return menuItem;
 }
Beispiel #2
0
 /**
  * Create the associated menu
  *
  * @return the menu
  */
 public MenuItem createMenuItem() {
   MenuItem menuItem = ScilabMenuItem.createMenuItem();
   menuItem.setText(UiDataMessages.DELETE + " '" + getSelectedVariable() + "'");
   menuItem.setMnemonic(MNEMONIC);
   menuItem.setCallback(this);
   ((SwingScilabMenuItem) menuItem.getAsSimpleMenuItem()).setIcon(icon);
   return menuItem;
 }
Beispiel #3
0
  /**
   * Create a menu item
   *
   * @param callBack the associated callBack
   * @return the menu item
   */
  protected static MenuItem createMenu(CommonCallBack callBack) {
    MenuItem item = ScilabMenuItem.createMenuItem();

    SwingScilabMenuItem swingItem = (SwingScilabMenuItem) item.getAsSimpleMenuItem();
    swingItem.setAction(callBack);

    return item;
  }
Beispiel #4
0
  /** @return a menuitem associated with this action */
  public static MenuItem createMenu() {
    MenuItem item = ScilabMenuItem.createMenuItem();
    SwingScilabMenuItem swingItem = (SwingScilabMenuItem) item.getAsSimpleMenuItem();
    swingItem.setAction(new CloseAction());
    swingItem.setText(UiDataMessages.CLOSE);
    swingItem.setAccelerator(KEY);

    return item;
  }
Beispiel #5
0
  /** Initialize the tab */
  private void initTab() {
    final TextBox infobar = ScilabTextBox.createTextBox();
    setWindowIcon("system-search");
    updateUI();

    CommonCallBack callback =
        new CommonCallBack(null) {
          @Override
          public void callBack() {
            ClosingOperationsManager.startClosingOperation((SwingScilabTab) SearchFile.this);
          }

          @Override
          public void actionPerformed(ActionEvent e) {
            callBack();
          }
        };

    setCallback(callback);
    MenuBar menubar = ScilabMenuBar.createMenuBar();
    Menu fileMenu = ScilabMenu.createMenu();
    fileMenu.setText(SciNotesMessages.FILE);
    fileMenu.setMnemonic('F');
    MenuItem menu = ScilabMenuItem.createMenuItem();
    menu.setCallback(callback);
    ((SwingScilabMenuItem) menu.getAsSimpleMenuItem())
        .setAccelerator(SciNotes.getActionKeys().get("scinotes-exit"));
    menu.setText(SciNotesMessages.EXIT);
    fileMenu.add(menu);
    menubar.add(fileMenu);

    addMenuBar(menubar);
    addInfoBar(infobar);

    setPreferredSize(new Dimension(650, 250));
  }