本文整理了Java中org.eclipse.jface.bindings.Binding.getPlatform()
方法的一些代码示例,展示了Binding.getPlatform()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Binding.getPlatform()
方法的具体详情如下:
包路径:org.eclipse.jface.bindings.Binding
类名称:Binding
方法名:getPlatform
[英]Returns the platform on which this binding applies. If the platform is null
, then this binding applies to all platforms. This string is the same format as returned by SWT.getPlatform()
.
[中]返回应用此绑定的平台。如果平台为null
,则此绑定适用于所有平台。此字符串的格式与SWT.getPlatform()
返回的格式相同。
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
/**
* <p>
* Tests whether the platform for the binding matches one of the active
* platforms.
* </p>
* <p>
* This method completes in <code>O(n)</code>, where <code>n</code> is
* the number of active platforms.
* </p>
*
* @param binding
* The binding with which to test; must not be <code>null</code>.
* @return <code>true</code> if the binding's platform matches;
* <code>false</code> otherwise.
*/
private final boolean platformMatches(final Binding binding) {
boolean matches = false;
final String platform = binding.getPlatform();
if (platform == null) {
return true; // shortcut a common case
}
for (String platformString : platforms) {
if (Objects.equals(platformString, platform)) {
matches = true;
break;
}
}
return matches;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
/**
* <p>
* Tests whether the platform for the binding matches one of the active
* platforms.
* </p>
* <p>
* This method completes in <code>O(n)</code>, where <code>n</code> is
* the number of active platforms.
* </p>
*
* @param binding
* The binding with which to test; must not be <code>null</code>.
* @return <code>true</code> if the binding's platform matches;
* <code>false</code> otherwise.
*/
private final boolean platformMatches(final Binding binding) {
boolean matches = false;
final String platform = binding.getPlatform();
if (platform == null) {
return true; // shortcut a common case
}
for (int i = 0; i < platforms.length; i++) {
if (Util.equals(platforms[i], platform)) {
matches = true;
break;
}
}
return matches;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
/**
* <p>
* Tests whether the platform for the binding matches one of the active
* platforms.
* </p>
* <p>
* This method completes in <code>O(n)</code>, where <code>n</code> is
* the number of active platforms.
* </p>
*
* @param binding
* The binding with which to test; must not be <code>null</code>.
* @return <code>true</code> if the binding's platform matches;
* <code>false</code> otherwise.
*/
private final boolean platformMatches(final Binding binding) {
boolean matches = false;
final String platform = binding.getPlatform();
if (platform == null) {
return true; // shortcut a common case
}
for (int i = 0; i < platforms.length; i++) {
if (Util.equals(platforms[i], platform)) {
matches = true;
break;
}
}
return matches;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
for (int i = 0; i < bindings.length; i++) {
Binding binding = bindings[i];
String p = binding.getPlatform();
if (p == null) {
newList.add(binding);
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
String p = binding.getPlatform();
if (p == null) {
newList.add(binding);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
for (int i = 0; i < bindings.length; i++) {
Binding binding = bindings[i];
String p = binding.getPlatform();
if (p == null) {
newList.add(binding);
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
/**
* Tests whether this binding is intended to delete another binding. The
* receiver must have a <code>null</code> command identifier.
*
* @param binding
* The binding to test; must not be <code>null</code>.
* This binding must be a <code>SYSTEM</code> binding.
* @return <code>true</code> if the receiver deletes the binding defined by
* the argument.
*/
final boolean deletes(final Binding binding) {
boolean deletes = true;
deletes &= Objects.equals(getContextId(), binding.getContextId());
deletes &= Objects.equals(getTriggerSequence(), binding
.getTriggerSequence());
if (getLocale() != null) {
deletes &= !Objects.equals(getLocale(), binding.getLocale());
}
if (getPlatform() != null) {
deletes &= !Objects.equals(getPlatform(), binding.getPlatform());
}
deletes &= (binding.getType() == SYSTEM);
deletes &= Objects.equals(getParameterizedCommand(), null);
return deletes;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
static final boolean deletes(final Binding del, final Binding binding) {
boolean deletes = true;
deletes &= Util.equals(del.getContextId(), binding.getContextId());
deletes &= Util.equals(del.getTriggerSequence(), binding
.getTriggerSequence());
if (del.getLocale() != null) {
deletes &= Util.equals(del.getLocale(), binding.getLocale());
}
if (del.getPlatform() != null) {
deletes &= Util.equals(del.getPlatform(), binding.getPlatform());
}
deletes &= (binding.getType() == Binding.SYSTEM);
deletes &= Util.equals(del.getParameterizedCommand(), null);
return deletes;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
equals &= Objects.equals(contextId, binding.getContextId());
equals &= Objects.equals(locale, binding.getLocale());
equals &= Objects.equals(platform, binding.getPlatform());
equals &= (type == binding.getType());
if (equals) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
return false;
if (!Objects.equals(getPlatform(), binding.getPlatform())) {
return false;
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
return false;
String platform = binding.getPlatform();
if (platform != null) {
if (!modelTags.contains(EBindingService.PLATFORM_ATTR_TAG + ":" + platform)) //$NON-NLS-1$
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
/**
* Tests whether this binding is intended to delete another binding. The
* receiver must have a <code>null</code> command identifier.
*
* @param binding
* The binding to test; must not be <code>null</code>.
* This binding must be a <code>SYSTEM</code> binding.
* @return <code>true</code> if the receiver deletes the binding defined by
* the argument.
*/
final boolean deletes(final Binding binding) {
boolean deletes = true;
deletes &= Util.equals(getContextId(), binding.getContextId());
deletes &= Util.equals(getTriggerSequence(), binding
.getTriggerSequence());
if (getLocale() != null) {
deletes &= !Util.equals(getLocale(), binding.getLocale());
}
if (getPlatform() != null) {
deletes &= !Util.equals(getPlatform(), binding.getPlatform());
}
deletes &= (binding.getType() == SYSTEM);
deletes &= Util.equals(getParameterizedCommand(), null);
return deletes;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
/**
* Tests whether this binding is intended to delete another binding. The
* receiver must have a <code>null</code> command identifier.
*
* @param binding
* The binding to test; must not be <code>null</code>.
* This binding must be a <code>SYSTEM</code> binding.
* @return <code>true</code> if the receiver deletes the binding defined by
* the argument.
*/
final boolean deletes(final Binding binding) {
boolean deletes = true;
deletes &= Util.equals(getContextId(), binding.getContextId());
deletes &= Util.equals(getTriggerSequence(), binding
.getTriggerSequence());
if (getLocale() != null) {
deletes &= !Util.equals(getLocale(), binding.getLocale());
}
if (getPlatform() != null) {
deletes &= !Util.equals(getPlatform(), binding.getPlatform());
}
deletes &= (binding.getType() == SYSTEM);
deletes &= Util.equals(getParameterizedCommand(), null);
return deletes;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
.toString());
element.putString(ATT_LOCALE, binding.getLocale());
element.putString(ATT_PLATFORM, binding.getPlatform());
if (parameterizedCommand != null) {
final Map parameterizations = parameterizedCommand
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
return false;
if (!Util.equals(getPlatform(), binding.getPlatform())) {
return false;
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
return false;
if (!Util.equals(getPlatform(), binding.getPlatform())) {
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;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
equals &= Util.equals(contextId, binding.getContextId());
equals &= Util.equals(locale, binding.getLocale());
equals &= Util.equals(platform, binding.getPlatform());
equals &= (type == binding.getType());
if (equals) {
内容来源于网络,如有侵权,请联系作者删除!