private List<HotKeyItem> getIDEHotKey() { List<HotKeyItem> ideHotKeys = new ArrayList<>(); Scheme scheme = keyBindingAgent.getScheme(selectedSchemeId); for (String actionId : actionManager.getActionIds("")) { boolean isGlobal = false; CharCodeWithModifiers activeCharCodeWithModifiers = scheme.getKeyBinding(actionId); if (activeCharCodeWithModifiers == null) { activeCharCodeWithModifiers = keyBindingAgent.getKeyBinding(actionId); isGlobal = true; } if (activeCharCodeWithModifiers != null) { String hotKey = KeyMapUtil.getShortcutText(activeCharCodeWithModifiers); String description = actionManager.getAction(actionId).getTemplatePresentation().getDescription(); if (description != null && !description.isEmpty()) { ideHotKeys.add(new HotKeyItem(description, hotKey, isGlobal)); } } } return ideHotKeys; }
public ActionButton( Action action, ActionManager actionManager, Presentation presentation, ToolbarResources toolbarResources) { this.actionManager = actionManager; this.toolbarResources = toolbarResources; panel = new FlowPanel(); initWidget(panel); panel.setStyleName(toolbarResources.toolbar().iconButtonPanel()); this.action = action; this.presentation = presentation; addDomHandlers(); renderImage(); setEnabled(presentation.isEnabled()); setVisible(presentation.isVisible()); if (presentation.getDescription() != null) { tooltip = Tooltip.create( (elemental.dom.Element) panel.getElement(), PositionController.VerticalAlign.BOTTOM, PositionController.HorizontalAlign.MIDDLE, presentation.getDescription()); } }
setVisible(presentation.isVisible()); if (presentation.getDescription() != null) { tooltip = Tooltip.create( PositionController.VerticalAlign.BOTTOM, PositionController.HorizontalAlign.MIDDLE, presentation.getDescription());