Package org.eclipse.jface.bindings.keys

Examples of org.eclipse.jface.bindings.keys.KeySequence


                .getAdapter(IBindingService.class);
        TriggerSequence[] activeBindingsFor = bindingSvc.getActiveBindingsFor(commandId);

        for (TriggerSequence seq : activeBindingsFor) {
            if (seq instanceof KeySequence) {
                KeySequence keySequence = (KeySequence) seq;
                if (matchesKeybinding(keyCode, stateMask, keySequence)) {
                    return true;
                }
            }
        }
View Full Code Here


                }
            }
        }
        for (Tuple<Binding, ParameterizedCommand> tuple : matches) {
            if (tuple.o1.getTriggerSequence() instanceof KeySequence) {
                KeySequence keySequence = (KeySequence) tuple.o1.getTriggerSequence();
                return keySequence;
            }
        }

        return null;
View Full Code Here

        b.setToolTipText(WrapAndCaseUtils.wrap("Enabling this will allow the editor to automatically write the"
                + "'import' string when you write a space after you've written 'from xxx '.", TOOLTIP_WIDTH));

        addCheckBox(appearanceComposite, "Add 'self' automatically when declaring methods?", AUTO_ADD_SELF, 0);

        KeySequence down = KeyBindingHelper.getCommandKeyBinding(ITextEditorActionDefinitionIds.MOVE_LINES_DOWN);
        KeySequence up = KeyBindingHelper.getCommandKeyBinding(ITextEditorActionDefinitionIds.MOVE_LINES_UP);
        String downKey = down != null ? down.format() : "Alt+Down"; //set the default if not there
        String upKey = up != null ? up.format() : "Alt+Up"; //set the default if not there
        addCheckBox(appearanceComposite,
                com.aptana.shared_core.string.StringUtils.format("Smart move for line up  (%s) and line down (%s)?.", upKey, downKey),
                SMART_LINE_MOVE, 0);

        addLabel(appearanceComposite, "Note: smart move line up/down change applied on editor restart.", 20);
View Full Code Here


public class TerminateAllLaunchesAction extends PyAction implements IUpdate {

    public TerminateAllLaunchesAction() {
        KeySequence binding = KeyBindingHelper
                .getCommandKeyBinding("org.python.pydev.debug.ui.actions.terminateAllLaunchesAction");
        String str = binding != null ? "(" + binding.format() + " when on Pydev editor)" : "(unbinded)";

        this.setImageDescriptor(PydevPlugin.getImageCache().getDescriptor(UIConstants.TERMINATE_ALL));
        this.setToolTipText("Terminate ALL." + str);

        update();
View Full Code Here

     * @see org.eclipse.ui.texteditor.IUpdate#update()
     */
    public void update() {
        IProcess process = console.getProcess();
        setEnabled(true);
        KeySequence binding = KeyBindingHelper
                .getCommandKeyBinding("org.python.pydev.debug.ui.actions.relaunchLastAction");
        String str = binding != null ? "(" + binding.format() + " when on Pydev editor)" : "(unbinded)";
        if (process.canTerminate()) {
            this.setImageDescriptor(PydevPlugin.getImageCache().getDescriptor(UIConstants.RELAUNCH));
            this.setToolTipText("Restart the current launch. " + str);

        } else {
View Full Code Here

                    return;
                }

                //It must be set before showing the tooltip, as we'll loose the focus to the tooltip and the
                //currently active bindings will become inactive.
                KeySequence activateEditorBinding = KeyBindingHelper
                        .getCommandKeyBinding("org.eclipse.ui.window.activateEditor");
                informationPresenterManager.setActivateEditorBinding(activateEditorBinding);
                Shell activeShell = UIUtils.getActiveShell();
                informationPresenterManager.setInitiallyActiveShell(activeShell);
View Full Code Here

    public void keyPressed(KeyEvent e) {
      if (!Helper.okToUse(fProposalShell))
        return;

      int accelerator= SWTKeySupport.convertEventToUnmodifiedAccelerator(e);
      KeySequence sequence= KeySequence.getInstance(SWTKeySupport.convertAcceleratorToKeyStroke(accelerator));
      if (sequence.equals(fCommandSequence))
        if (fContentAssistant.isPrefixCompletionEnabled())
          incrementalComplete();
        else
          showProposals(false);
View Full Code Here

   *
   * @param control the control to watch for focus
   * @since 3.2
   */
    private void addCommandSupport(final Control control) {
      final KeySequence commandSequence= fContentAssistant.getRepeatedInvocationKeySequence();
      if (commandSequence != null && !commandSequence.isEmpty() && fContentAssistant.isRepeatedInvocationMode()) {
        control.addFocusListener(new FocusListener() {
          private CommandKeyListener fCommandKeyListener;
          public void focusGained(FocusEvent e) {
            if (Helper.okToUse(control)) {
              if (fCommandKeyListener == null) {
View Full Code Here

       */
      public void assistSessionStarted(ContentAssistEvent event) {
        if (event.processor != CFEPrimaryAssist.this)
          return;
        fIterationGesture= getIterationGesture();
        KeySequence binding= getIterationBinding();

        // this may show the warning dialog if all categories are disabled
        fCategoryIteration= getCategoryIteration();
        for (Iterator it= fCategories.iterator(); it.hasNext();) {
          IAssistContributor cat= (IAssistContributor) it.next();
View Full Code Here

    /**
     * @see org.eclipse.jface.action.ExternalActionManager.ICallback#isAcceleratorInUse(int)
     */
    public final boolean isAcceleratorInUse(final int accelerator) {
      final KeySequence keySequence = KeySequence
          .getInstance(SWTKeySupport
              .convertAcceleratorToKeyStroke(accelerator));
      return bindingManager.isPerfectMatch(keySequence)
          || bindingManager.isPartialMatch(keySequence);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.bindings.keys.KeySequence

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.