private IHandlerService getHandlerService() { IWorkbench wb = PlatformUI.getWorkbench(); if (wb != null) { Object serviceObject = wb.getAdapter(IHandlerService.class); if (serviceObject != null) { IHandlerService service = (IHandlerService)serviceObject; return service; } } return null; }
public void deactivated() { // remove EOF submissions IWorkbench workbench = PlatformUI.getWorkbench(); IHandlerService handlerService = (IHandlerService) workbench.getAdapter(IHandlerService.class); handlerService.deactivateHandler(fHandlerActivation); IContextService contextService = (IContextService) workbench.getAdapter(IContextService.class); contextService.deactivateContext(fContextActivation); }
public void deregisterCommands() { IHandlerService handlerService= PlatformUI.getWorkbench().getAdapter(IHandlerService.class); if (handlerService != null && fCorrectionHandlerActivations != null) { handlerService.deactivateHandlers(fCorrectionHandlerActivations); fCorrectionHandlerActivations= null; } }
private String getShortcutString() { IBindingService bindingService= (IBindingService)PlatformUI.getWorkbench().getAdapter(IBindingService.class); if (bindingService == null) return null; return bindingService.getBestActiveBindingFormattedFor(SurroundWithTemplateMenuAction.SURROUND_WITH_QUICK_MENU_ACTION_ID); }
/** * Unregister the {@link IHandlerActivation} from the shell. */ private void deactivateHandler() { IHandlerService handlerService= PlatformUI.getWorkbench().getAdapter(IHandlerService.class); if (handlerService != null) handlerService.deactivateHandler(fHandlerActivation); fHandlerActivation= null; } }
/** * Unregister the {@link IHandlerActivation} from the shell. */ private void deactivateHandler() { IHandlerService handlerService= PlatformUI.getWorkbench().getAdapter(IHandlerService.class); if (handlerService != null) handlerService.deactivateHandler(fHandlerActivation); fHandlerActivation= null; } }
private String getQuickAssistBinding() { final IBindingService bindingSvc= PlatformUI.getWorkbench().getAdapter(IBindingService.class); return bindingSvc.getBestActiveBindingFormattedFor(ITextEditorActionDefinitionIds.QUICK_ASSIST); } });
/** * WARNING: only works in workbench window context! * @return the keybinding for Refactor > Rename */ private static String getOpenDialogBinding() { IBindingService bindingService= PlatformUI.getWorkbench().getAdapter(IBindingService.class); if (bindingService == null) return ""; //$NON-NLS-1$ String binding= bindingService.getBestActiveBindingFormattedFor(IJavaEditorActionDefinitionIds.RENAME_ELEMENT); return binding == null ? "" : binding; //$NON-NLS-1$ }
private String getShortcutString() { IBindingService bindingService= (IBindingService)PlatformUI.getWorkbench().getAdapter(IBindingService.class); if (bindingService == null) return null; return bindingService.getBestActiveBindingFormattedFor(IJavaEditorActionDefinitionIds.SEARCH_OCCURRENCES_IN_FILE_QUICK_MENU); }
/** * WARNING: only works in workbench window context! * @return the keybinding for Refactor > Rename */ private static String getOpenDialogBinding() { IBindingService bindingService= (IBindingService)PlatformUI.getWorkbench().getAdapter(IBindingService.class); if (bindingService == null) return ""; //$NON-NLS-1$ String binding= bindingService.getBestActiveBindingFormattedFor(IJavaEditorActionDefinitionIds.RENAME_ELEMENT); return binding == null ? "" : binding; //$NON-NLS-1$ }
private KeySequence getIterationBinding() { final IBindingService bindingSvc= PlatformUI.getWorkbench().getAdapter(IBindingService.class); TriggerSequence binding= bindingSvc.getBestActiveBindingFor(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); if (binding instanceof KeySequence) return (KeySequence) binding; return null; }
public static String getShortCutString(String proposalId) { if (proposalId != null) { IBindingService bindingService= (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class); if (bindingService != null) { TriggerSequence[] activeBindingsFor= bindingService.getActiveBindingsFor(proposalId); if (activeBindingsFor.length > 0) { return activeBindingsFor[0].format(); } } } return null; }
public static String getShortCutString(String proposalId) { if (proposalId != null) { IBindingService bindingService= PlatformUI.getWorkbench().getAdapter(IBindingService.class); if (bindingService != null) { TriggerSequence[] activeBindingsFor= bindingService.getActiveBindingsFor(proposalId); if (activeBindingsFor.length > 0) { return activeBindingsFor[0].format(); } } } return null; }
/** * Returns the shortcut assigned to the sub menu or <code>null</code> if * no short cut is assigned. * * @return the shortcut as a human readable string or <code>null</code> */ private String getShortcutString() { IBindingService bindingService= (IBindingService)PlatformUI.getWorkbench().getAdapter(IBindingService.class); if (bindingService == null) return null; return bindingService.getBestActiveBindingFormattedFor(getActionDefinitionId()); }
private void removeListeners() { ICommandService commandService = PlatformUI.getWorkbench().getAdapter(ICommandService.class); if (commandService != null) commandService.removeExecutionListener(fEventListener); if (fWidgetEventSource != null) { fWidgetEventSource.removeFocusListener(fEventListener); fWidgetEventSource.removeMouseListener(fEventListener); fWidgetEventSource.removeVerifyKeyListener(fEventListener); fWidgetEventSource= null; } }
final protected TriggerSequence[] getInvokingCommandKeySequences() { if (fInvokingCommandKeySequences == null) { if (getInvokingCommand() != null) { IBindingService bindingService = PlatformUI.getWorkbench().getAdapter(IBindingService.class); fInvokingCommandKeySequences = bindingService.getActiveBindingsFor(getInvokingCommand().getId()); return fInvokingCommandKeySequences; } } return fInvokingCommandKeySequences; }
private void removeListeners(ITextViewer editor) { ICommandService commandService= (ICommandService)PlatformUI.getWorkbench().getAdapter(ICommandService.class); if (commandService != null) commandService.removeExecutionListener(fEventListener); if (fWidgetEventSource != null) { fWidgetEventSource.removeFocusListener(fEventListener); fWidgetEventSource.removeMouseListener(fEventListener); fWidgetEventSource.removeVerifyKeyListener(fEventListener); fWidgetEventSource= null; } }
private void removeListeners(ITextViewer editor) { ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getAdapter(ICommandService.class); if (commandService != null) commandService.removeExecutionListener(fEventListener); if (fWidgetEventSource != null) { fWidgetEventSource.removeFocusListener(fEventListener); fWidgetEventSource.removeMouseListener(fEventListener); fWidgetEventSource.removeVerifyKeyListener(fEventListener); fWidgetEventSource= null; } }
private void removeListeners() { ICommandService commandService= PlatformUI.getWorkbench().getAdapter(ICommandService.class); if (commandService != null) commandService.removeExecutionListener(fEventListener); if (fWidgetEventSource != null) { fWidgetEventSource.removeFocusListener(fEventListener); fWidgetEventSource.removeMouseListener(fEventListener); fWidgetEventSource.removeVerifyKeyListener(fEventListener); fWidgetEventSource= null; } }
private void addListeners(ITextViewer viewer) { fWidgetEventSource= viewer.getTextWidget(); if (fWidgetEventSource != null) { fWidgetEventSource.addVerifyKeyListener(fEventListener); fWidgetEventSource.addMouseListener(fEventListener); fWidgetEventSource.addFocusListener(fEventListener); } ICommandService commandService= (ICommandService)PlatformUI.getWorkbench().getAdapter(ICommandService.class); if (commandService != null) commandService.addExecutionListener(fEventListener); }