Package at.bestsolution.efxclipse.runtime.bindings

Examples of at.bestsolution.efxclipse.runtime.bindings.Binding


    }
    return !sequenceBeforeKeyStroke.isEmpty();
  }
 
  private ParameterizedCommand getPerfectMatch(KeySequence keySequence) {
    Binding perfectMatch = getBindingService().getPerfectMatch(keySequence);
    return perfectMatch == null ? null : perfectMatch.getParameterizedCommand();
  }
View Full Code Here


   * @param bindingTable
   * @param binding
   */
  private void defineBinding(BindingTable bindingTable,
      Context bindingContext, MKeyBinding binding) {
    Binding keyBinding = createBinding(bindingContext,
        binding.getCommand(), binding.getParameters(),
        binding.getKeySequence(), binding);
    if (keyBinding != null
        && !binding.getTags().contains(
            EBindingService.DELETED_BINDING_TAG)) {
View Full Code Here

    }
  }

  private Binding createBinding(Context bindingContext, MCommand cmdModel,
      List<MParameter> modelParms, String keySequence, MKeyBinding binding) {
    Binding keyBinding = null;

    if (binding.getTransientData()
        .get(EBindingService.MODEL_TO_BINDING_KEY) != null) {
      try {
        keyBinding = (Binding) binding.getTransientData().get(
View Full Code Here

    if (table == null) {
      logger.error("Trying to create \'" + binding //$NON-NLS-1$
          + "\' without binding table " + bindingContext.getId());//$NON-NLS-1$
      return;
    }
    Binding keyBinding = createBinding(bindingContext,
        binding.getCommand(), binding.getParameters(),
        binding.getKeySequence(), binding);
    if (keyBinding != null) {
      if (add) {
        table.addBinding(keyBinding);
View Full Code Here

            final BindingTable table = new BindingTable(
                bindingContext);
            bindingTables.addTable(table);
            List<MKeyBinding> bindings = bt.getBindings();
            for (MKeyBinding binding : bindings) {
              Binding keyBinding = createBinding(bindingContext,
                  binding.getCommand(),
                  binding.getParameters(),
                  binding.getKeySequence(), binding);
              if (keyBinding != null) {
                table.addBinding(keyBinding);
View Full Code Here

    if (!getId().equals(binding.getContextId())) {
      throw new IllegalArgumentException("Binding context " + binding.getContextId() //$NON-NLS-1$
          + " does not match " + getId()); //$NON-NLS-1$
    }

    Binding conflict;
    ArrayList<Binding> conflictsList;
    boolean isConflict = false;

    // if this binding conflicts with one other active binding
    if (bindingsByTrigger.containsKey(binding.getTriggerSequence())) {
View Full Code Here

      conflictBindings.remove(binding);

      // if there is only one binding left in the list, then it's not really a conflict
      // binding anymore and can be re-added to the binding table
      if (conflictBindings.size() == 1) {
        Binding bindingToReAdd = conflictBindings.remove(0);
        addBinding(bindingToReAdd);
      }

    } else {
      bindings.remove(binding);
View Full Code Here

    }
    return conflictsList;
  }

  public Binding getPerfectMatch(ContextSet contextSet, TriggerSequence triggerSequence) {
    Binding result = null;
    Binding currentResult = null;
    List<Context> contexts = contextSet.getContexts();
    ListIterator<Context> it = contexts.listIterator(contexts.size());
    while (it.hasPrevious()) {
      Context c = it.previous();
      BindingTable table = getTable(c.getId());
      if (table != null) {
        currentResult = table.getPerfectMatch(triggerSequence);
      }
      if (currentResult != null) {
        if (isMostActiveScheme(currentResult)) {
          return currentResult;
        }
        if (result == null) {
          result = currentResult;
        } else {
          int rc = compareSchemes(result.getSchemeId(), currentResult.getSchemeId());
          if (rc < 0) {
            result = currentResult;
          }
        }
      }
View Full Code Here

   *
   * @seeorg.eclipse.e4.ui.bindings.EBindingService#getBestSequenceFor(org.eclipse
   * .core.commands. ParameterizedCommand)
   */
  public TriggerSequence getBestSequenceFor(ParameterizedCommand command) {
    Binding binding = manager.getBestSequenceFor(contextSet, command);
    return binding == null ? null : binding.getTriggerSequence();
  }
View Full Code Here

TOP

Related Classes of at.bestsolution.efxclipse.runtime.bindings.Binding

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.