本文整理了Java中org.eclipse.jface.bindings.Binding.getSchemeId()
方法的一些代码示例,展示了Binding.getSchemeId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Binding.getSchemeId()
方法的具体详情如下:
包路径:org.eclipse.jface.bindings.Binding
类名称:Binding
方法名:getSchemeId
[英]Returns the identifier of the scheme in which this binding applies.
[中]返回应用此绑定的方案的标识符。
代码示例来源:origin: org.eclipse.e4.ui/bindings
/**
* @param currentResult
* @return
*/
private boolean isMostActiveScheme(Binding currentResult) {
if (activeSchemeIds == null || activeSchemeIds.length < 2) {
return true;
}
final String mostActive = activeSchemeIds[0];
return mostActive == null ? false : mostActive.equals(currentResult.getSchemeId());
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.bindings
/**
* @param currentResult
* @return
*/
private boolean isMostActiveScheme(Binding currentResult) {
if (activeSchemeIds == null || activeSchemeIds.length < 2) {
return true;
}
final String mostActive = activeSchemeIds[0];
return mostActive == null ? false : mostActive.equals(currentResult.getSchemeId());
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.bindings
Binding msb = bindingList.get(0);
Binding lsb = bindingList.get(1);
int rc = compareSchemes(BEST_SEQUENCE.getActiveSchemes(), msb.getSchemeId(),
lsb.getSchemeId());
if (rc == 0) {
ArrayList<Binding> conflictList = conflicts.get(sequence);
while (i.hasNext() && rc == 0) {
Binding next = i.next();
rc = compareSchemes(BEST_SEQUENCE.getActiveSchemes(), prev.getSchemeId(),
next.getSchemeId());
if (rc == 0) {
conflictList.add(next);
代码示例来源:origin: org.eclipse.e4.ui/bindings
Binding msb = bindingList.get(0);
Binding lsb = bindingList.get(1);
int rc = compareSchemes(BEST_SEQUENCE.getActiveSchemes(), msb.getSchemeId(),
lsb.getSchemeId());
if (rc == 0) {
ArrayList<Binding> conflictList = conflicts.get(sequence);
while (i.hasNext() && rc == 0) {
Binding next = i.next();
rc = compareSchemes(BEST_SEQUENCE.getActiveSchemes(), prev.getSchemeId(),
next.getSchemeId());
if (rc == 0) {
conflictList.add(next);
代码示例来源:origin: org.eclipse.e4.ui/bindings
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;
}
}
}
}
return result;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.bindings
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;
}
}
}
}
return result;
}
代码示例来源:origin: org.eclipse.e4.ui/bindings
while (matchesIter.hasNext()) {
bindingToAdd = matchesIter.next();
if (!bindingToAdd.getSchemeId().equals(EBindingService.DEFAULT_SCHEME_ID)) {
sortedMatches.add(bindingToAdd);
break;
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.bindings
while (matchesIter.hasNext()) {
bindingToAdd = matchesIter.next();
if (!bindingToAdd.getSchemeId().equals(EBindingService.DEFAULT_SCHEME_ID)) {
sortedMatches.add(bindingToAdd);
break;
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
return false;
if (!Objects.equals(getSchemeId(), binding.getSchemeId())) {
return false;
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
private MKeyBinding findMKeyBinding(MBindingTable table, Binding binding) {
List<MKeyBinding> mBindings = table.getBindings();
String bindingSchemeId = binding.getSchemeId() == null ? IBindingService.DEFAULT_DEFAULT_ACTIVE_SCHEME_ID
: binding.getSchemeId();
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
String schemeId = binding.getSchemeId();
if (schemeId != null && !schemeId.equals(BindingPersistence.getDefaultSchemeId())) {
if (!modelTags.contains(EBindingService.SCHEME_ID_ATTR_TAG + ":" + schemeId)) //$NON-NLS-1$
代码示例来源:origin: org.eclipse.e4.ui/bindings
public int compare(Binding o1, Binding o2) {
int rc = compareSchemes(activeSchemeIds, o1.getSchemeId(), o2.getSchemeId());
if (rc != 0) {
return rc;
}
/*
* Check to see which has the least number of triggers in the trigger sequence.
*/
final Trigger[] bestTriggers = o1.getTriggerSequence().getTriggers();
final Trigger[] currentTriggers = o2.getTriggerSequence().getTriggers();
int compareTo = bestTriggers.length - currentTriggers.length;
if (compareTo != 0) {
return compareTo;
}
/*
* Compare the number of keys pressed in each trigger sequence. Some types of keys count
* less than others (i.e., some types of modifiers keys are less likely to be chosen).
*/
compareTo = countStrokes(bestTriggers) - countStrokes(currentTriggers);
if (compareTo != 0) {
return compareTo;
}
// If this is still a tie, then just chose the shortest text.
return o1.getTriggerSequence().format().length()
- o2.getTriggerSequence().format().length();
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
/**
* Compare 2 bindings, taking into account Scheme and type.
*
* @param current
* the existing binding
* @param addition
* the incoming binding
* @return an int indicating current > addition
*/
private int compareTo(Binding current, Binding addition) {
final Scheme s1 = manager.getScheme(current.getSchemeId());
final Scheme s2 = manager.getScheme(addition.getSchemeId());
if (!s1.equals(s2)) {
int rc = compareSchemes(s1.getId(), s2.getId());
if (rc != 0) {
// this is because the compare is inverted
return rc > 0 ? -1 : 1;
}
}
return current.getType() - addition.getType();
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.bindings
@Override
public int compare(Binding o1, Binding o2) {
int rc = compareSchemes(activeSchemeIds, o1.getSchemeId(), o2.getSchemeId());
if (rc != 0) {
return rc;
}
/*
* Check to see which has the least number of triggers in the trigger sequence.
*/
final Trigger[] bestTriggers = o1.getTriggerSequence().getTriggers();
final Trigger[] currentTriggers = o2.getTriggerSequence().getTriggers();
int compareTo = bestTriggers.length - currentTriggers.length;
if (compareTo != 0) {
return compareTo;
}
/*
* Compare the number of keys pressed in each trigger sequence. Some types of keys count
* less than others (i.e., some types of modifiers keys are less likely to be chosen).
*/
compareTo = countStrokes(bestTriggers) - countStrokes(currentTriggers);
if (compareTo != 0) {
return compareTo;
}
// If this is still a tie, then just chose the shortest text.
return o1.getTriggerSequence().format().length()
- o2.getTriggerSequence().format().length();
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
: parameterizedCommand.getId();
element.putString(ATT_COMMAND_ID, commandId);
element.putString(ATT_KEY_CONFIGURATION_ID, binding.getSchemeId());
element.putString(ATT_KEY_SEQUENCE, binding.getTriggerSequence()
.toString());
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
return false;
if (!Util.equals(getSchemeId(), binding.getSchemeId())) {
return false;
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
return false;
if (!Util.equals(getSchemeId(), binding.getSchemeId())) {
return false;
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
/**
* Computes the hash code for this key binding based on all of its
* attributes.
*
* @return The hash code for this key binding.
*/
public final int hashCode() {
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode = HASH_INITIAL;
hashCode = hashCode * HASH_FACTOR
+ Util.hashCode(getParameterizedCommand());
hashCode = hashCode * HASH_FACTOR + Util.hashCode(getContextId());
hashCode = hashCode * HASH_FACTOR
+ Util.hashCode(getTriggerSequence());
hashCode = hashCode * HASH_FACTOR + Util.hashCode(getLocale());
hashCode = hashCode * HASH_FACTOR + Util.hashCode(getPlatform());
hashCode = hashCode * HASH_FACTOR + Util.hashCode(getSchemeId());
hashCode = hashCode * HASH_FACTOR + Util.hashCode(getType());
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode++;
}
}
return hashCode;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
/**
* Computes the hash code for this key binding based on all of its
* attributes.
*
* @return The hash code for this key binding.
*/
@Override
public final int hashCode() {
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode = HASH_INITIAL;
hashCode = hashCode * HASH_FACTOR
+ Util.hashCode(getParameterizedCommand());
hashCode = hashCode * HASH_FACTOR + Util.hashCode(getContextId());
hashCode = hashCode * HASH_FACTOR
+ Util.hashCode(getTriggerSequence());
hashCode = hashCode * HASH_FACTOR + Util.hashCode(getLocale());
hashCode = hashCode * HASH_FACTOR + Util.hashCode(getPlatform());
hashCode = hashCode * HASH_FACTOR + Util.hashCode(getSchemeId());
hashCode = hashCode * HASH_FACTOR + Util.hashCode(getType());
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode++;
}
}
return hashCode;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
/**
* Computes the hash code for this key binding based on all of its
* attributes.
*
* @return The hash code for this key binding.
*/
@Override
public final int hashCode() {
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode = HASH_INITIAL;
hashCode = hashCode * HASH_FACTOR
+ Util.hashCode(getParameterizedCommand());
hashCode = hashCode * HASH_FACTOR + Util.hashCode(getContextId());
hashCode = hashCode * HASH_FACTOR
+ Util.hashCode(getTriggerSequence());
hashCode = hashCode * HASH_FACTOR + Util.hashCode(getLocale());
hashCode = hashCode * HASH_FACTOR + Util.hashCode(getPlatform());
hashCode = hashCode * HASH_FACTOR + Util.hashCode(getSchemeId());
hashCode = hashCode * HASH_FACTOR + Util.hashCode(getType());
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode++;
}
}
return hashCode;
}
内容来源于网络,如有侵权,请联系作者删除!