本文整理汇总了Java中org.eclipse.jface.util.Util.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Util.equals方法的具体用法?Java Util.equals怎么用?Java Util.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.util.Util
的用法示例。
在下文中一共展示了Util.equals方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: equals
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
/**
* Compares this binding set with another object. The objects will be equal
* if they are both instance of <code>CachedBindingSet</code> and have
* equivalent values for all of their properties.
*
* @param object
* The object with which to compare; may be <code>null</code>.
* @return <code>true</code> if they are both instances of
* <code>CachedBindingSet</code> and have the same values for all
* of their properties; <code>false</code> otherwise.
*/
public final boolean equals(final Object object) {
if (!(object instanceof CachedBindingSet)) {
return false;
}
final CachedBindingSet other = (CachedBindingSet) object;
if (!Util.equals(activeContextTree, other.activeContextTree)) {
return false;
}
if (!Util.equals(locales, other.locales)) {
return false;
}
if (!Util.equals(platforms, other.platforms)) {
return false;
}
return Util.equals(schemeIds, other.schemeIds);
}
示例2: localeMatches
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
/**
* <p>
* Tests whether the locale for the binding matches one of the active
* locales.
* </p>
* <p>
* This method completes in <code>O(n)</code>, where <code>n</code> is the
* number of active locales.
* </p>
*
* @param binding
* The binding with which to test; must not be <code>null</code>.
* @return <code>true</code> if the binding's locale matches;
* <code>false</code> otherwise.
*/
private final boolean localeMatches(final Binding binding) {
boolean matches = false;
final String locale = binding.getLocale();
if (locale == null) {
return true; // shortcut a common case
}
for (int i = 0; i < locales.length; i++) {
if (Util.equals(locales[i], locale)) {
matches = true;
break;
}
}
return matches;
}
示例3: platformMatches
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
/**
* <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;
}
示例4: setActiveScheme
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
/**
* <p>
* Selects one of the schemes as the active scheme. This scheme must be
* defined.
* </p>
* <p>
* This method completes in <code>O(n)</code>, where <code>n</code> is the
* height of the context tree.
* </p>
*
* @param scheme
* The scheme to become active; must not be <code>null</code>.
* @throws NotDefinedException
* If the given scheme is currently undefined.
*/
public final void setActiveScheme(final Scheme scheme)
throws NotDefinedException {
if (scheme == null) {
throw new NullPointerException("Cannot activate a null scheme"); //$NON-NLS-1$
}
if ((scheme == null) || (!scheme.isDefined())) {
throw new NotDefinedException(
"Cannot activate an undefined scheme. " //$NON-NLS-1$
+ scheme.getId());
}
if (Util.equals(activeScheme, scheme)) {
return;
}
activeScheme = scheme;
activeSchemeIds = getSchemeIds(activeScheme.getId());
clearSolution();
fireBindingManagerChanged(new BindingManagerEvent(this, false, null,
true, null, false, false, false));
}
示例5: isActiveBindingsChangedFor
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
/**
* Computes whether the active bindings have changed for a given command
* identifier.
*
* @param parameterizedCommand
* The fully-parameterized command whose bindings might have
* changed; must not be <code>null</code>.
* @return <code>true</code> if the active bindings have changed for the
* given command identifier; <code>false</code> otherwise.
*/
public final boolean isActiveBindingsChangedFor(
final ParameterizedCommand parameterizedCommand) {
final TriggerSequence[] currentBindings = manager
.getActiveBindingsFor(parameterizedCommand);
final TriggerSequence[] previousBindings;
if (previousTriggersByParameterizedCommand != null) {
final Collection previousBindingCollection = (Collection) previousTriggersByParameterizedCommand
.get(parameterizedCommand);
if (previousBindingCollection == null) {
previousBindings = null;
} else {
previousBindings = (TriggerSequence[]) previousBindingCollection
.toArray(new TriggerSequence[previousBindingCollection
.size()]);
}
} else {
previousBindings = null;
}
return !Util.equals(currentBindings, previousBindings);
}
示例6: define
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
/**
* <p>
* Defines this scheme by giving it a name, and possibly a description and a
* parent identifier as well. The defined property for the scheme automatically
* becomes <code>true</code>.
* </p>
* <p>
* Notification is sent to all listeners that something has changed.
* </p>
*
* @param name
* The name of this scheme; must not be <code>null</code>.
* @param description
* The description for this scheme; may be <code>null</code>.
* @param parentId
* The parent identifier for this scheme; may be
* <code>null</code>.
*/
public final void define(final String name, final String description,
final String parentId) {
if (name == null) {
throw new NullPointerException(
"The name of a scheme cannot be null"); //$NON-NLS-1$
}
final boolean definedChanged = !this.defined;
this.defined = true;
final boolean nameChanged = !Util.equals(this.name, name);
this.name = name;
final boolean descriptionChanged = !Util.equals(this.description,
description);
this.description = description;
final boolean parentIdChanged = !Util.equals(this.parentId, parentId);
this.parentId = parentId;
fireSchemeChanged(new SchemeEvent(this, definedChanged, nameChanged,
descriptionChanged, parentIdChanged));
}
示例7: removeBindings
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
/**
* <p>
* Removes any binding that matches the given values -- regardless of
* command identifier.
* </p>
* <p>
* This method completes in <code>O(n)</code>, where <code>n</code> is the
* number of bindings.
* </p>
*
* @param sequence
* The sequence to match; may be <code>null</code>.
* @param schemeId
* The scheme id to match; may be <code>null</code>.
* @param contextId
* The context id to match; may be <code>null</code>.
* @param locale
* The locale to match; may be <code>null</code>.
* @param platform
* The platform to match; may be <code>null</code>.
* @param windowManager
* The window manager to match; may be <code>null</code>. TODO
* Currently ignored.
* @param type
* The type to look for.
*
*/
public final void removeBindings(final TriggerSequence sequence,
final String schemeId, final String contextId, final String locale,
final String platform, final String windowManager, final int type) {
if ((bindings == null) || (bindingCount < 1)) {
return;
}
final Binding[] newBindings = new Binding[bindings.length];
boolean bindingsChanged = false;
int index = 0;
for (int i = 0; i < bindingCount; i++) {
final Binding binding = bindings[i];
boolean equals = true;
equals &= Util.equals(sequence, binding.getTriggerSequence());
equals &= Util.equals(schemeId, binding.getSchemeId());
equals &= Util.equals(contextId, binding.getContextId());
equals &= Util.equals(locale, binding.getLocale());
equals &= Util.equals(platform, binding.getPlatform());
equals &= (type == binding.getType());
if (equals) {
bindingsChanged = true;
} else {
newBindings[index++] = binding;
}
}
if (bindingsChanged) {
this.bindings = newBindings;
bindingCount = index;
clearCache();
}
}
示例8: equals
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
public final boolean equals(final Object object) {
// Check if they're the same.
if (object == this) {
return true;
}
// Check if they're the same type.
if (!(object instanceof TriggerSequence)) {
return false;
}
final TriggerSequence triggerSequence = (TriggerSequence) object;
return Util.equals(triggers, triggerSequence.triggers);
}
示例9: equals
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
/**
* Tests whether this binding is equal to another object. Bindings are only
* equal to other bindings with equivalent values.
*
* @param object
* The object with which to compare; may be <code>null</code>.
* @return <code>true</code> if the object is a binding with equivalent
* values for all of its properties; <code>false</code> otherwise.
*/
public final boolean equals(final Object object) {
if (this == object) {
return true;
}
if (!(object instanceof Binding)) {
return false;
}
final Binding binding = (Binding) object;
if (!Util.equals(getParameterizedCommand(), binding
.getParameterizedCommand())) {
return false;
}
if (!Util.equals(getContextId(), binding.getContextId())) {
return false;
}
if (!Util.equals(getTriggerSequence(), binding.getTriggerSequence())) {
return false;
}
if (!Util.equals(getLocale(), binding.getLocale())) {
return false;
}
if (!Util.equals(getPlatform(), binding.getPlatform())) {
return false;
}
if (!Util.equals(getSchemeId(), binding.getSchemeId())) {
return false;
}
return (getType() == binding.getType());
}
示例10: equals
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
public boolean equals(final Object object) {
if (object instanceof TreeNode) {
return Util.equals(this.value, ((TreeNode) object).value);
}
return false;
}
示例11: notifyIfChanged
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
protected void notifyIfChanged(Object oldValue, Object newValue)
{
if (!Util.equals(oldValue, newValue))
{
fireValueChange(Diffs.createValueDiff(oldValue, newValue));
}
}
示例12: setLocale
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
/**
* <p>
* Changes the locale for this binding manager. The locale can be used to
* provide locale-specific bindings. If the locale is different than the
* current locale, this will force a recomputation of the bindings. The
* locale is in the same format as
* <code>Locale.getDefault().toString()</code>.
* </p>
* <p>
* This method completes in <code>O(1)</code>.
* </p>
*
* @param locale
* The new locale; must not be <code>null</code>.
* @see Locale#getDefault()
*/
public final void setLocale(final String locale) {
if (locale == null) {
throw new NullPointerException("The locale cannot be null"); //$NON-NLS-1$
}
if (!Util.equals(this.locale, locale)) {
this.locale = locale;
this.locales = expand(locale, LOCALE_SEPARATOR);
clearSolution();
fireBindingManagerChanged(new BindingManagerEvent(this, false,
null, false, null, false, true, false));
}
}
示例13: setPlatform
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
/**
* <p>
* Changes the platform for this binding manager. The platform can be used
* to provide platform-specific bindings. If the platform is different than
* the current platform, then this will force a recomputation of the
* bindings. The locale is in the same format as
* <code>SWT.getPlatform()</code>.
* </p>
* <p>
* This method completes in <code>O(1)</code>.
* </p>
*
* @param platform
* The new platform; must not be <code>null</code>.
* @see org.eclipse.swt.SWT#getPlatform()
* @see Util#getWS()
*/
public final void setPlatform(final String platform) {
if (platform == null) {
throw new NullPointerException("The platform cannot be null"); //$NON-NLS-1$
}
if (!Util.equals(this.platform, platform)) {
this.platform = platform;
this.platforms = expand(platform, Util.ZERO_LENGTH_STRING);
clearSolution();
fireBindingManagerChanged(new BindingManagerEvent(this, false,
null, false, null, false, false, true));
}
}