Exemplo n.º 1
0
 /**
  * Create the associated button
  *
  * @return the button
  */
 public static PushButton createPushButton() {
   PushButton pushButton = ScilabPushButton.createPushButton();
   pushButton.setIcon(ICON);
   pushButton.setToolTipText(LABEL);
   pushButton.setCallback(getCallBack());
   return pushButton;
 }
Exemplo n.º 2
0
  /**
   * Create a button for a tool bar
   *
   * @param title tooltip for the button
   * @return the button
   */
  public static PushButton createButton(SwingScilabVariableBrowser variableBrowser, String title) {
    PushButton button = ScilabPushButton.createPushButton();
    ((SwingScilabPushButton) button.getAsSimplePushButton())
        .addActionListener(new DeleteAction(variableBrowser));
    button.setToolTipText(title);
    ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(icon);

    return button;
  }
Exemplo n.º 3
0
  /** @return the corresponding button */
  public static PushButton createButton() {
    PushButton button = ScilabPushButton.createPushButton();
    button.setCallback(new GoToSCIAction());
    ((SwingScilabPushButton) button.getAsSimplePushButton())
        .setToolTipText(UiDataMessages.SCIFOLDER);
    ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(FileUtils.getSCIIcon());

    return button;
  }
  /**
   * Create a button for a tool bar
   *
   * @param editor the associated editor
   * @param title tooltip for the button
   * @return the button
   */
  public static PushButton createButton(SwingScilabVariableEditor editor, String title) {
    PushButton button = ScilabPushButton.createPushButton();
    ((SwingScilabPushButton) button.getAsSimplePushButton())
        .addActionListener(new SetPrecisionShortAction(editor, title));
    button.setToolTipText(title);
    ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("short"));
    ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);

    return button;
  }
Exemplo n.º 5
0
  /**
   * Create a button
   *
   * @param callback the associated callback
   * @return the push button
   */
  protected static PushButton createButton(CommonCallBack callback) {
    PushButton item = ScilabPushButton.createPushButton();

    SwingScilabPushButton swingItem = (SwingScilabPushButton) item.getAsSimplePushButton();
    swingItem.setAction(callback);

    // Not compatible with java 1.5
    // Hide the name text
    // swingItem.setHideActionText(true);
    swingItem.setText("");

    return item;
  }