use of org.pushingpixels.flamingo.api.common.icon.ResizableIcon in project freeplane by freeplane.
the class RibbonActionContributorFactory method createCommandToggleButton.
public static JCommandToggleButton createCommandToggleButton(final AFreeplaneAction action) {
String title = ActionUtils.getActionTitle(action);
ResizableIcon icon = ActionUtils.getActionIcon(action);
final JCommandToggleButton button = new JCommandToggleButton(title, icon);
updateRichTooltip(button, action, null);
button.addActionListener(new RibbonActionListener(action));
button.setFocusable(false);
return button;
}
use of org.pushingpixels.flamingo.api.common.icon.ResizableIcon in project freeplane by freeplane.
the class RibbonActionContributorFactory method createCommandButton.
public static JCommandButton createCommandButton(final AFreeplaneAction action) {
String title = ActionUtils.getActionTitle(action);
ResizableIcon icon = ActionUtils.getActionIcon(action);
final JCommandButton button = new JCommandButton(title, icon);
updateRichTooltip(button, action, null);
button.addActionListener(new RibbonActionListener(action));
button.setFocusable(false);
return button;
}
use of org.pushingpixels.flamingo.api.common.icon.ResizableIcon in project freeplane by freeplane.
the class ScriptingRibbonsContributor method createScriptButton.
private JCommandMenuButton createScriptButton(final String scriptName, final String scriptPath, ExecutionMode executionMode) {
final ScriptMetaData metaData = configuration.getMenuTitleToMetaDataMap().get(scriptName);
final String title = scriptNameToMenuItemTitle(scriptName);
AFreeplaneAction action = new ExecuteScriptAction(scriptName, title, scriptPath, executionMode, metaData.cacheContent(), metaData.getPermissions());
ResizableIcon icon = ActionUtils.getActionIcon(action);
final JCommandMenuButton scriptEntry = new JCommandMenuButton(title, icon);
scriptEntry.setActionRichTooltip(createRichTooltip(title, metaData));
scriptEntry.addActionListener(action);
scriptEntry.setFocusable(false);
scriptEntry.setEnabled(metaData.getExecutionModes().contains(executionMode));
return scriptEntry;
}
use of org.pushingpixels.flamingo.api.common.icon.ResizableIcon in project freeplane by freeplane.
the class RibbonMenuPrimaryContributorFactory method createMenuEntry.
/**
*********************************************************************************
* METHODS
*********************************************************************************
*/
public static RibbonApplicationMenuEntryPrimary createMenuEntry(final AFreeplaneAction action, CommandButtonKind kind) {
String title = ActionUtils.getActionTitle(action);
ResizableIcon icon = ActionUtils.getActionIcon(action);
RibbonApplicationMenuEntryPrimary entry = new RibbonApplicationMenuEntryPrimary(icon, title, new RibbonActionContributorFactory.RibbonActionListener(action), kind);
return entry;
}
use of org.pushingpixels.flamingo.api.common.icon.ResizableIcon in project freeplane by freeplane.
the class ActionUtils method getActionIcon.
public static ResizableIcon getActionIcon(final AFreeplaneAction action) {
ResizableIcon icon = null;
ImageIcon ico = (ImageIcon) action.getValue(Action.SMALL_ICON);
if (ico != null) {
icon = ImageWrapperResizableIcon.getIcon(ico.getImage(), new Dimension(ico.getIconWidth(), ico.getIconHeight()));
} else {
String resource = ResourceController.getResourceController().getProperty(action.getIconKey(), null);
if (resource != null) {
URL location = ResourceController.getResourceController().getResource(resource);
icon = ImageWrapperResizableIcon.getIcon(location, new Dimension(16, 16));
}
}
if (icon == null) {
icon = RibbonActionContributorFactory.BLANK_ACTION_ICON;
}
return icon;
}
Aggregations