Package org.pushingpixels.flamingo.api.common

Examples of org.pushingpixels.flamingo.api.common.RichTooltip


            manipulatorButton = new JCommandButton(acm.getName());
        }
        manipulatorButton.setCommandButtonKind(JCommandButton.CommandButtonKind.POPUP_ONLY);
        manipulatorButton.setDisplayState(CommandButtonDisplayState.MEDIUM);
        if (acm.getDescription() != null && !acm.getDescription().isEmpty()) {
            manipulatorButton.setPopupRichTooltip(new RichTooltip(NbBundle.getMessage(DataTableTopComponent.class, "DataTableTopComponent.RichToolTip.title.text"), acm.getDescription()));
        }

        final ArrayList<AttributeColumn> availableColumns = new ArrayList<AttributeColumn>();
        for (final AttributeColumn column : columns) {
            if (acm.canManipulateColumn(table, column)) {
View Full Code Here


  @Override
  protected JPanel getButtonPanel() {
    JPanel result = super.getButtonPanel();
    apply(result, new Command() {
      public void apply(JCommandButton button) {
        RichTooltip actionRichTooltip = new RichTooltip();
        actionRichTooltip.setTitle(resourceBundle
            .getString("Tooltip.textActionTitle"));
        actionRichTooltip.addDescriptionSection(resourceBundle
            .getString("Tooltip.textParagraph1"));
        actionRichTooltip.addDescriptionSection(resourceBundle
            .getString("Tooltip.textParagraph2"));
        try {
          actionRichTooltip
              .setMainImage(ImageIO
                  .read(TestRichTooltipPanels.class
                      .getResource("/test/resource/address-book-new.png")));
          actionRichTooltip
              .setFooterImage(ImageIO
                  .read(TestRichTooltipPanels.class
                      .getResource("/test/resource/help-browser.png")));
        } catch (Exception exc) {
          exc.printStackTrace();
        }
        actionRichTooltip.addFooterSection(resourceBundle
            .getString("Tooltip.textFooterParagraph1"));

        button.setActionRichTooltip(actionRichTooltip);

        RichTooltip popupRichTooltip = new RichTooltip();
        popupRichTooltip.setTitle(resourceBundle
            .getString("Tooltip.textPopupTitle"));
        popupRichTooltip.addDescriptionSection(resourceBundle
            .getString("Tooltip.textParagraph1"));
        try {
          popupRichTooltip
              .setFooterImage(ImageIO
                  .read(TestRichTooltipPanels.class
                      .getResource("/test/resource/help-browser.png")));
        } catch (Exception exc) {
          exc.printStackTrace();
        }
        popupRichTooltip.addFooterSection(resourceBundle
            .getString("Tooltip.textFooterParagraph1"));

        button.setPopupRichTooltip(popupRichTooltip);
      };
    });
View Full Code Here

import org.pushingpixels.flamingo.api.common.RichTooltip;
import org.pushingpixels.flamingo.internal.ui.common.JRichTooltipPanel;

public class TestRichTooltipPanels extends JFrame {
  public TestRichTooltipPanels() {
    RichTooltip rt = new RichTooltip();
    rt
        .setTitle("Main title that can go over multiple lines of text even exceeding the bigger");
    rt
        .addDescriptionSection("Simple description that can go over multiple lines of text even exceeding the bigger");
    rt
        .addDescriptionSection("Second paragraph that can be multiline as well to test this feature");
    try {
      rt.setMainImage(ImageIO.read(TestRichTooltipPanels.class
          .getResource("/test/resource/address-book-new.png")));
      rt.setFooterImage(ImageIO.read(TestRichTooltipPanels.class
          .getResource("/test/resource/help-browser.png")));
    } catch (Exception exc) {
      exc.printStackTrace();
    }
    rt
        .addFooterSection("Multiline footer description to provide a little bit more information on this subject");

    JRichTooltipPanel panel = new JRichTooltipPanel(rt);
    this.add(panel);
View Full Code Here

   *            The new rich tooltip for the expand button of this ribbon
   *            band.
   * @see #getExpandButtonRichTooltip()
   */
  public void setExpandButtonRichTooltip(RichTooltip expandButtonRichTooltip) {
    RichTooltip old = this.expandButtonRichTooltip;
    this.expandButtonRichTooltip = expandButtonRichTooltip;
    this.firePropertyChange("expandButtonRichTooltip", old,
        this.expandButtonRichTooltip);
  }
View Full Code Here

                menuButton.addActionListener(action);
                menuButton.setCommandButtonKind(CommandButtonKind.ACTION_ONLY);
                menuButton.setHorizontalAlignment(SwingUtilities.LEADING);
                menuButton.setPopupOrientationKind(CommandButtonPopupOrientationKind.SIDEWARD);
                menuButton.setEnabled(true);
                menuButton.setActionRichTooltip(new RichTooltip((String) action
                    .getValue(Action.SHORT_DESCRIPTION), file.toString()));
                secondary.addButtonToLastGroup(menuButton);
              }
              JScrollablePanel<JCommandButtonPanel> scrollPanel = new JScrollablePanel<JCommandButtonPanel>(
                  secondary, ScrollType.VERTICALLY);
View Full Code Here

    button.setFocusable(false);
    return button;
  }
 
  public static void updateRichTooltip(final AbstractCommandButton button, AFreeplaneAction action, KeyStroke ks) {
    RichTooltip tip = getRichTooltip(action, ks);
    if(tip != null) {
      button.setActionRichTooltip(tip);
    }
    else {
      button.setActionRichTooltip(null);
View Full Code Here

      button.setActionRichTooltip(null);
    }
  }
 
  public static RichTooltip getRichTooltip(AFreeplaneAction action, KeyStroke ks) {
    RichTooltip tip = null;
    final String tooltip = TextUtils.getRawText(action.getTooltipKey(), null);
    if (tooltip != null && !"".equals(tooltip)) {
      tip = new RichTooltip(ActionUtils.getActionTitle(action), TextUtils.removeTranslateComment(tooltip));
    }
    if(ks != null) {
      if(tip == null) {
        tip = new RichTooltip(ActionUtils.getActionTitle(action), "  ");
      }
      tip.addFooterSection(formatShortcut(ks));
    }
    return tip;
  }
View Full Code Here

        parent.addChild(toggleButton, getDefaultProps(RibbonElementPriority.MEDIUM));
        return toggleButton;
    }

    private RichTooltip createRichTooltip(final String title) {
        final RichTooltip tooltip = new RichTooltip();
        tooltip.setTitle(title);
        return tooltip;
    }
View Full Code Here

        scriptEntry.setEnabled(metaData.getExecutionModes().contains(executionMode));
        return scriptEntry;
    }

    private RichTooltip createRichTooltip(String title, ScriptMetaData metaData) {
        final RichTooltip tooltip = createRichTooltip(TextUtils.format(LABEL_AVAILABLE_MODES_TOOLTIP, title));
        for (ExecutionMode executionMode : metaData.getExecutionModes()) {
            tooltip.addDescriptionSection(getTitleForExecutionMode(executionMode));
        }
        return tooltip;
    }
View Full Code Here

            ResizableIcon icon = ActionUtils.getActionIcon(action);
            ActionListener listener = new RibbonActionContributorFactory.RibbonActionListener(action);
            final RibbonApplicationMenuEntryFooter entry = new RibbonApplicationMenuEntryFooter(icon, title, listener);
            KeyStroke ks = context.getBuilder().getAcceleratorManager().getAccelerator(key);
            if(ks != null) {
              RichTooltip tip = RibbonActionContributorFactory.getRichTooltip(action, ks);
              if(tip != null) {
                entry.setActionRichTooltip(tip);
              }
            }
            parent.addChild(entry, new ChildProperties(parseOrderSettings(attributes.getProperty("orderPriority", ""))));
View Full Code Here

TOP

Related Classes of org.pushingpixels.flamingo.api.common.RichTooltip

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.