Example usage for org.eclipse.jface.bindings.keys KeyBinding getPlatform

List of usage examples for org.eclipse.jface.bindings.keys KeyBinding getPlatform

Introduction

In this page you can find the example usage for org.eclipse.jface.bindings.keys KeyBinding getPlatform.

Prototype

public final String getPlatform() 

Source Link

Document

Returns the platform on which this binding applies.

Usage

From source file:org.eclipse.oomph.setup.workbench.impl.KeyBindingTaskImpl.java

License:Open Source License

private boolean isEqual(KeyBindingContext keyBindingContext, KeyBinding keyBinding) throws Exception {
    if (!ObjectUtil.equals(keyBinding.getSchemeId(), getScheme())) {
        return false;
    }//from   w ww .  ja  va2s . c  om

    if (!ObjectUtil.equals(keyBinding.getContextId(), keyBindingContext.getID())) {
        return false;
    }

    if (!ObjectUtil.equals(keyBinding.getPlatform(), getPlatform())) {
        return false;
    }

    if (!ObjectUtil.equals(keyBinding.getLocale(), getLocale())) {
        return false;
    }

    KeySequence keySequence = KeySequence.getInstance(getKeys());
    if (!ObjectUtil.equals(keyBinding.getKeySequence(), keySequence)) {
        return false;
    }

    ParameterizedCommand parameterizedCommand = keyBinding.getParameterizedCommand();
    if (parameterizedCommand == null || !ObjectUtil.equals(parameterizedCommand.getId(), getCommand())) {
        return false;
    }

    if (!ObjectUtil.equals(parameterizedCommand.getParameterMap(), getCommandParameterMap())) {
        return false;
    }

    return true;
}