public static void addKeyText(final MenuItem mntm, final String text, final Task t) { mntm.setText(text + "\t" + taskKeyMap.get(t)); //$NON-NLS-1$ mntm.addArmListener(new ArmListener() { @Override public void widgetArmed(ArmEvent e) { mntm.setText(text + "\t" + taskKeyMap.get(t)); //$NON-NLS-1$ } }); }
public static void addKeyText(final MenuItem mntm, final String text, final TextTask t) { mntm.setText(text + "\t" + textTaskKeyMap.get(t)); //$NON-NLS-1$ mntm.addArmListener(new ArmListener() { @Override public void widgetArmed(ArmEvent e) { mntm.setText(text + "\t" + textTaskKeyMap.get(t)); //$NON-NLS-1$ } }); }
private void installTooltip(final MenuItem menuItem, final IToolTipTextProvider toolTipTextProvider) { final ArmListener armListener = new ArmListener() { @Override public void widgetArmed(final ArmEvent e) { final boolean wasVisible = toolTip.isVisible(); toolTip.setVisible(false); final String toolTipText = toolTipTextProvider.getToolTipText(); final boolean hasToolTip = toolTipText != null && !toolTipText.isEmpty(); if (wasVisible) { if (hasToolTip) { showToolTip(toolTipText); } } else if (hasToolTip) { lastArmListener = this; final ArmListener thisListener = this; Display.getCurrent().timerExec(400, new Runnable() { @Override public void run() { if (lastArmListener == thisListener) { showToolTip(toolTipText); } } }); } } }; if (toolTip != null) { menuItem.addArmListener(armListener); } }
@Override public void widgetArmed(final ArmEvent e) { manageItems(); }
@Override public void widgetArmed(final ArmEvent e) { execute(); }
@Override public void widgetArmed(final ArmEvent e) { manageExportCsvItem(); }
@Override public void widgetArmed(final ArmEvent ae) { execute(); }
@Override public void widgetArmed(final ArmEvent event) { execute(); }
@Override public void widgetArmed(final ArmEvent event) { onArmEvent(event); }
private void onArmEvent(final ArmEvent event) { final MenuItem menuItem = (MenuItem) event.widget; if (_isAutoOpen && menuItem.isEnabled()) { final Object itemData = menuItem.getData(); if (itemData instanceof ActionContributionItem) { final String itemId = ((ActionContributionItem) itemData).getId(); final String actionId = _actionContributionItem.getId(); if (itemId != null && itemId.equals(actionId)) { /* * the item is hovered which is associated with the action for the advanced menu */ _armItemTimeAction = System.currentTimeMillis(); _armMenuItem = menuItem; _armActionText = _actionContributionItem.getAction().getText(); onAnimation10Start(); return; } } } restoreMenuItemText(); _armMenuItem = null; _isAnimating = false; // system time is needed because OSX has the same time for all arm events until the menu is closed _armItemTimeOther = System.currentTimeMillis(); }