Package org.pushingpixels.flamingo.api.common

Examples of org.pushingpixels.flamingo.api.common.JCommandButton$DefaultPopupButtonModel


  private JCommandButtonStrip getStrip2(double hgapScaleFactor,
      double vgapScaleFactor) {
    JCommandButtonStrip buttonStrip2 = new JCommandButtonStrip();
    buttonStrip2.setHGapScaleFactor(hgapScaleFactor);
    buttonStrip2.setVGapScaleFactor(vgapScaleFactor);
    buttonStrip2.add(new JCommandButton("", new format_text_bold()));
    buttonStrip2.add(new JCommandButton("", new format_text_italic()));
    buttonStrip2.add(new JCommandButton("", new format_text_underline()));
    JCommandButton strike = new JCommandButton("",
        new format_text_strikethrough());
    strike
        .setCommandButtonKind(CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION);
    strike.setPopupCallback(new PopupPanelCallback() {
      @Override
      public JPopupPanel getPopupPanel(JCommandButton commandButton) {
        return new SamplePopupMenu(commandButton
            .getComponentOrientation());
      }
View Full Code Here


      this.componentListener = null;
    }
  }

  protected JCommandButton createLeadingScroller() {
    JCommandButton b = new JCommandButton(
        null,
        new DoubleArrowResizableIcon(
            new Dimension(9, 9),
            this.scrollablePanel.getScrollType() == ScrollType.HORIZONTALLY ? SwingConstants.WEST
                : SwingConstants.NORTH));

    b.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    b.setFocusable(false);
    b.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    b.putClientProperty(BasicCommandButtonUI.EMULATE_SQUARE_BUTTON,
        Boolean.TRUE);
    b.putClientProperty(BasicCommandButtonUI.DONT_DISPOSE_POPUPS,
        Boolean.TRUE);
    return b;
  }
View Full Code Here

        Boolean.TRUE);
    return b;
  }

  protected JCommandButton createTrailingScroller() {
    JCommandButton b = new JCommandButton(
        null,
        new DoubleArrowResizableIcon(
            new Dimension(9, 9),
            this.scrollablePanel.getScrollType() == ScrollType.HORIZONTALLY ? SwingConstants.EAST
                : SwingConstants.SOUTH));

    b.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    b.setFocusable(false);
    b.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    b.putClientProperty(BasicCommandButtonUI.EMULATE_SQUARE_BUTTON,
        Boolean.TRUE);
    b.putClientProperty(BasicCommandButtonUI.DONT_DISPOSE_POPUPS,
        Boolean.TRUE);
    return b;
  }
View Full Code Here

import test.svg.transcoded.edit_paste;

public class TestCommandButtonsNoIcon extends TestCommandButtons {
  @Override
  protected JCommandButton createActionButton(CommandButtonDisplayState state) {
    JCommandButton result = new JCommandButton(resourceBundle
        .getString("Paste.text"));
    result.setExtraText(resourceBundle.getString("Paste.textExtra"));
    result.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        System.out.println(stamp() + ": Main paste");
      }
    });
    result
        .setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_ONLY);
    result.setDisplayState(state);
    result.setFlat(false);
    return result;
  }
View Full Code Here

  }

  @Override
  protected JCommandButton createActionAndPopupMainActionButton(
      CommandButtonDisplayState state) {
    JCommandButton result = new JCommandButton(resourceBundle
        .getString("Cut.text"));
    result.setExtraText(resourceBundle.getString("Cut.textExtra"));
    result.setPopupCallback(new TestPopupCallback());
    result
        .setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION);
    result.setDisplayState(state);
    result.setFlat(false);
    result.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        System.out.println(stamp() + ": Cut");
      }
    });
    return result;
View Full Code Here

  }

  @Override
  protected JCommandButton createActionAndPopupMainPopupButton(
      CommandButtonDisplayState state) {
    JCommandButton result = new JCommandButton(resourceBundle
        .getString("Copy.text"));
    result.setExtraText(resourceBundle.getString("Copy.textExtra"));
    result.setPopupCallback(new TestPopupCallback());
    result
        .setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_AND_POPUP_MAIN_POPUP);
    result.setDisplayState(state);
    result.setFlat(false);
    result.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        System.out.println(stamp() + ": Copy");
      }
    });
    return result;
View Full Code Here

    return result;
  }

  @Override
  protected JCommandButton createPopupButton(CommandButtonDisplayState state) {
    JCommandButton result = new JCommandButton(resourceBundle
        .getString("SelectAll.text"));
    result.setExtraText(resourceBundle.getString("SelectAll.textExtra"));
    result.setPopupCallback(new TestPopupCallback());
    result
        .setCommandButtonKind(JCommandButton.CommandButtonKind.POPUP_ONLY);
    result.setDisplayState(state);
    result.setFlat(false);
    return result;
  }
View Full Code Here

  private static void apply(Container cont, Command cmd) {
    for (int i = 0; i < cont.getComponentCount(); i++) {
      Component comp = cont.getComponent(i);
      if (comp instanceof JCommandButton) {
        JCommandButton cb = (JCommandButton) comp;
        cmd.apply(cb);
      }
      if (comp instanceof Container) {
        apply((Container) comp, cmd);
      }
View Full Code Here

      double vgapScaleFactor) {
    JCommandButtonStrip buttonStrip = new JCommandButtonStrip(
        StripOrientation.VERTICAL);
    buttonStrip.setHGapScaleFactor(hgapScaleFactor);
    buttonStrip.setVGapScaleFactor(vgapScaleFactor);
    buttonStrip.add(new JCommandButton("", new format_justify_left()));
    buttonStrip.add(new JCommandButton("", new format_justify_center()));
    buttonStrip.add(new JCommandButton("", new format_justify_right()));
    return buttonStrip;
  }
View Full Code Here

      double vgapScaleFactor) {
    JCommandButtonStrip buttonStrip2 = new JCommandButtonStrip(
        StripOrientation.VERTICAL);
    buttonStrip2.setHGapScaleFactor(hgapScaleFactor);
    buttonStrip2.setVGapScaleFactor(vgapScaleFactor);
    buttonStrip2.add(new JCommandButton("", new format_text_bold()));
    buttonStrip2.add(new JCommandButton("", new format_text_italic()));
    buttonStrip2.add(new JCommandButton("", new format_text_underline()));
    buttonStrip2
        .add(new JCommandButton("", new format_text_strikethrough()));
    return buttonStrip2;
  }
View Full Code Here

TOP

Related Classes of org.pushingpixels.flamingo.api.common.JCommandButton$DefaultPopupButtonModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.