// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ListCollector.java
// public class ListCollector<T> implements ICollector<T> {
//   private final List<T> list = Lists.newArrayList();
// 
//   public static <T> ListCollector<T> create() {
//     return new ListCollector<T>();
//   }
// 
//   public void collect(T element) {
//     list.add(element);
//   }
// 
//   public List<T> get() {
//     return list;
//   }
// }
// 
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ResourceTaskScanner.java
// public abstract class ResourceTaskScanner implements TaskScanner {
// 
//   private final Supplier<List<IResourceTaskProvider>> supplier;
// 
//   public ResourceTaskScanner() {
//     this(ResourceTaskProvidersExtensionPoint.getInstance());
//   }
// 
//   @VisibleForTesting
//   ResourceTaskScanner(Supplier<List<IResourceTaskProvider>> supplier) {
//     this.supplier = supplier;
//   }
// 
//   public void scan(TaskCollector collector) {
//     Preconditions.checkNotNull(collector, "'collector' cannot be null.");
// 
//     for (IResourceTaskProvider source : supplier.get()) {
//       scan(source, collector);
//     }
//   }
// 
//   /**
//    * Scan the source for tasks.
//    *
//    * @param source the source to scan. The source should already be considered valid.
//    * @param collector the collector of tasks. Guaranteed to be not null.
//    */
//   protected abstract void scan(IResourceTaskProvider source, TaskCollector collector);
// }
// 
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IResourceTaskProvider.java
// public interface IResourceTaskProvider {
//   /**
//    * Collect task references provided by this provider.
//    *
//    * <p>In theory this is similar to calling
//    * {@code collectTaskReferences(".", extFilter, collector)}, but
//    * that's in theory only.
//    *
//    * @param extFilter the filename extension to filter.
//    * @param collector the collector to receive all task references.
//    *
//    * TODO(konigsberg): Remove the filter parameter.
//    */
//   void collectTaskReferences(
//       String extFilter,
//       ICollector<IResourceTaskReference> collector);
// 
//   /**
//    * Collect task references provided by this provider, relative to the
//    * provider's root.
//    *
//    * <p>This is only used for finding Class-based tasks, and is not even
//    * implemented in the UriTaskProvider.
//    *
//    * @param localPath the relative path to the resources
//    * @param extFilter the filename extension to filter.
//    * @param collector the collector to receive all task references.
//    *
//    * TODO(konigsberg): Remove the filter parameter.
//    */
//   void collectTaskReferences(
//       String localPath,
//       String extFilter,
//       ICollector<IResourceTaskReference> collector);
// }
// 
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IResourceTaskReference.java
// public interface IResourceTaskReference {
//   /** Return the name of the task reference. This is typically a local name. */
//   String getName();
// 
//   /** Return the task reference as an input stream. */
//   InputStream newInputStream() throws IOException;
// 
//   /**
//    * Return the time this resource was last modified, in milliseconds since the epoch.
//    */
//   long getLastModified() throws IOException;
// 
//   /** 
//    * Return the task reference path. Provide enough metadata to give it some distinction,
//    * separate from other providers.
//    */
//   String getPath();
// 
//   /**
//    * Return the File representation of this resource. Is {@code null} it's not a File.
//    */
//   File asFile();
// 
//   /**
//    * Return the MD5 hash of this task
//    */
//   long computeMD5() throws IOException;
// }
// 
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/TaskCollector.java
// public interface TaskCollector extends ICollector<Task> {
// }


import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.logging.Logger;
import com.google.eclipse.mechanic.ListCollector;
import com.google.eclipse.mechanic.ResourceTaskScanner;
import com.google.eclipse.mechanic.IResourceTaskProvider;
import com.google.eclipse.mechanic.IResourceTaskReference;
import com.google.eclipse.mechanic.TaskCollector;
/*******************************************************************************
 * Copyright (C) 2010, 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;



/**
 * Scanner for keyboard bindings.
 *
 * @author zorzella@google.com (Luiz-Otavio Zorzella)
 */
public class KeyboardBindingsScanner extends ResourceTaskScanner {

  private static final Logger LOG = Logger.getLogger(
      KeyboardBindingsScanner.class.getName());

  @Override
  public void scan(IResourceTaskProvider source, TaskCollector collector) {
    /**
     * Scan our source. Add a new Task for each KBD found.
     */
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ListCollector.java
// public class ListCollector<T> implements ICollector<T> {
//   private final List<T> list = Lists.newArrayList();
// 
//   public static <T> ListCollector<T> create() {
//     return new ListCollector<T>();
//   }
// 
//   public void collect(T element) {
//     list.add(element);
//   }
// 
//   public List<T> get() {
//     return list;
//   }
// }
// 
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ResourceTaskScanner.java
// public abstract class ResourceTaskScanner implements TaskScanner {
// 
//   private final Supplier<List<IResourceTaskProvider>> supplier;
// 
//   public ResourceTaskScanner() {
//     this(ResourceTaskProvidersExtensionPoint.getInstance());
//   }
// 
//   @VisibleForTesting
//   ResourceTaskScanner(Supplier<List<IResourceTaskProvider>> supplier) {
//     this.supplier = supplier;
//   }
// 
//   public void scan(TaskCollector collector) {
//     Preconditions.checkNotNull(collector, "'collector' cannot be null.");
// 
//     for (IResourceTaskProvider source : supplier.get()) {
//       scan(source, collector);
//     }
//   }
// 
//   /**
//    * Scan the source for tasks.
//    *
//    * @param source the source to scan. The source should already be considered valid.
//    * @param collector the collector of tasks. Guaranteed to be not null.
//    */
//   protected abstract void scan(IResourceTaskProvider source, TaskCollector collector);
// }
// 
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IResourceTaskProvider.java
// public interface IResourceTaskProvider {
//   /**
//    * Collect task references provided by this provider.
//    *
//    * <p>In theory this is similar to calling
//    * {@code collectTaskReferences(".", extFilter, collector)}, but
//    * that's in theory only.
//    *
//    * @param extFilter the filename extension to filter.
//    * @param collector the collector to receive all task references.
//    *
//    * TODO(konigsberg): Remove the filter parameter.
//    */
//   void collectTaskReferences(
//       String extFilter,
//       ICollector<IResourceTaskReference> collector);
// 
//   /**
//    * Collect task references provided by this provider, relative to the
//    * provider's root.
//    *
//    * <p>This is only used for finding Class-based tasks, and is not even
//    * implemented in the UriTaskProvider.
//    *
//    * @param localPath the relative path to the resources
//    * @param extFilter the filename extension to filter.
//    * @param collector the collector to receive all task references.
//    *
//    * TODO(konigsberg): Remove the filter parameter.
//    */
//   void collectTaskReferences(
//       String localPath,
//       String extFilter,
//       ICollector<IResourceTaskReference> collector);
// }
// 
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IResourceTaskReference.java
// public interface IResourceTaskReference {
//   /** Return the name of the task reference. This is typically a local name. */
//   String getName();
// 
//   /** Return the task reference as an input stream. */
//   InputStream newInputStream() throws IOException;
// 
//   /**
//    * Return the time this resource was last modified, in milliseconds since the epoch.
//    */
//   long getLastModified() throws IOException;
// 
//   /** 
//    * Return the task reference path. Provide enough metadata to give it some distinction,
//    * separate from other providers.
//    */
//   String getPath();
// 
//   /**
//    * Return the File representation of this resource. Is {@code null} it's not a File.
//    */
//   File asFile();
// 
//   /**
//    * Return the MD5 hash of this task
//    */
//   long computeMD5() throws IOException;
// }
// 
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/TaskCollector.java
// public interface TaskCollector extends ICollector<Task> {
// }


// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KeyboardBindingsScanner.java
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.logging.Logger;
import com.google.eclipse.mechanic.ListCollector;
import com.google.eclipse.mechanic.ResourceTaskScanner;
import com.google.eclipse.mechanic.IResourceTaskProvider;
import com.google.eclipse.mechanic.IResourceTaskReference;
import com.google.eclipse.mechanic.TaskCollector;

/*******************************************************************************
 * Copyright (C) 2010, 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;



/**
 * Scanner for keyboard bindings.
 *
 * @author zorzella@google.com (Luiz-Otavio Zorzella)
 */
public class KeyboardBindingsScanner extends ResourceTaskScanner {

  private static final Logger LOG = Logger.getLogger(
      KeyboardBindingsScanner.class.getName());

  @Override
  public void scan(IResourceTaskProvider source, TaskCollector collector) {
    /**
     * Scan our source. Add a new Task for each KBD found.
     */
    ListCollector<IResourceTaskReference> taskCollector = ListCollector.create();