// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java
// enum Action {
//   ADD("add"),
//   REMOVE("remove"),
//   ;
// 
//   /**
//    * Label as it appears in the .kbd JSON file
//    */
//   private final String label;
// 
//   Action(String label) {
//     this.label = label;
//   }
// 
//   public static Action fromLabel(String someLabel) {
//     for (Action a : values()) {
//       if (a.label.equals(someLabel))
//         return a;
//     }
//     throw new IllegalArgumentException(String.format(
//         "'%s' is not a valid action",
//         someLabel));
//   }
// 
//   static Action forLabel(String label) {
//     for (Action action : values()) {
//       if (action.label.equals(label)) {
//         return action;
//       }
//     }
//     throw new IllegalArgumentException(label);
//   }
//     
//   @Override
//   public String toString() {
//     return label;
//   }
// }


import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.eclipse.mechanic.core.keybinding.KbaChangeSet.Action;
/*******************************************************************************
 * Copyright (C) 2011, Google Inc.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/

package com.google.eclipse.mechanic.core.keybinding;


/**
 * Qualifies a binding by scheme/platform/context/action
 * 
 * <p>If platform is {@code null}, this applies to all platforms.
 */
// TODO: leverage this class in KbaChangeSet
final class KbaChangeSetQualifier {
  final String scheme;
  final String platform;
  final String context;
  final String action;

  public KbaChangeSetQualifier(
      final String scheme,
      final String platform,
      final String context,
      final String actionLabel) {
    this(scheme,
        platform,
        context,
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java
// enum Action {
//   ADD("add"),
//   REMOVE("remove"),
//   ;
// 
//   /**
//    * Label as it appears in the .kbd JSON file
//    */
//   private final String label;
// 
//   Action(String label) {
//     this.label = label;
//   }
// 
//   public static Action fromLabel(String someLabel) {
//     for (Action a : values()) {
//       if (a.label.equals(someLabel))
//         return a;
//     }
//     throw new IllegalArgumentException(String.format(
//         "'%s' is not a valid action",
//         someLabel));
//   }
// 
//   static Action forLabel(String label) {
//     for (Action action : values()) {
//       if (action.label.equals(label)) {
//         return action;
//       }
//     }
//     throw new IllegalArgumentException(label);
//   }
//     
//   @Override
//   public String toString() {
//     return label;
//   }
// }


// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSetQualifier.java
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.eclipse.mechanic.core.keybinding.KbaChangeSet.Action;

/*******************************************************************************
 * Copyright (C) 2011, Google Inc.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/

package com.google.eclipse.mechanic.core.keybinding;


/**
 * Qualifies a binding by scheme/platform/context/action
 * 
 * <p>If platform is {@code null}, this applies to all platforms.
 */
// TODO: leverage this class in KbaChangeSet
final class KbaChangeSetQualifier {
  final String scheme;
  final String platform;
  final String context;
  final String action;

  public KbaChangeSetQualifier(
      final String scheme,
      final String platform,
      final String context,
      final String actionLabel) {
    this(scheme,
        platform,
        context,
        Action.fromLabel(actionLabel));