// Path: src/net/bitpot/railways/models/RequestMethods.java
// public class RequestMethods {
//     public static final RequestMethod GET = new GetRequestMethod();
//     public static final RequestMethod POST = new PostRequestMethod();
//     public static final RequestMethod PUT = new PutRequestMethod();
//     public static final RequestMethod PATCH = new PatchRequestMethod();
//     public static final RequestMethod DELETE = new DeleteRequestMethod();
//     public static final RequestMethod ANY = new AnyRequestMethod();
// 
// 
//     private static final List<RequestMethod> requestMethods = createRequestMethods();
// 
// 
//     private static List<RequestMethod> createRequestMethods() {
//         Vector<RequestMethod> methods = new Vector<>();
//         methods.add(GET);
//         methods.add(POST);
//         methods.add(PUT);
//         methods.add(PATCH);
//         methods.add(DELETE);
//         methods.add(ANY);
// 
//         return methods;
//     }
// 
// 
//     /**
//      * Finds request method by name. If no request method is found, AnyRequestMethod is
//      * returned.
//      *
//      * @param name Name of request method.
//      * @return RequestMethod object.
//      */
//     @NotNull
//     public static RequestMethod get(String name) {
//         for(RequestMethod method: requestMethods)
//             if (method.getName().equals(name))
//                 return method;
// 
//         return ANY;
//     }
// 
// 
//     public static Collection<RequestMethod> getAllRequestMethods() {
//         return requestMethods;
//     }
// }
// 
// Path: src/net/bitpot/railways/models/requestMethods/RequestMethod.java
// public interface RequestMethod {
// 
//     /**
//      * Returns the icon used for showing routes of the type.
//      *
//      * @return The icon instance, or null if no icon should be shown.
//      */
//     Icon getIcon();
// 
//     /**
//      * Returns the name of the route type. The name must be unique among all route types.
//      *
//      * @return The route type name.
//      */
//     @NotNull
//     @NonNls
//     String getName();
// 
// }


import com.intellij.ide.util.gotoByName.ChooseByNameFilter;
import com.intellij.ide.util.gotoByName.ChooseByNameFilterConfiguration;
import com.intellij.ide.util.gotoByName.ChooseByNamePopup;
import com.intellij.ide.util.gotoByName.FilteringGotoByModel;
import com.intellij.openapi.project.Project;
import net.bitpot.railways.models.RequestMethods;
import net.bitpot.railways.models.requestMethods.RequestMethod;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.util.Collection;
package net.bitpot.railways.navigation;



/**
 *
 */
public class ChooseByRouteNameFilter extends ChooseByNameFilter<RequestMethod> {
    /**
     * A constructor
     *
     * @param popup               a parent popup
     * @param model               a model for popup
     * @param filterConfiguration storage for selected filter values
     * @param project             a context project
     */
    public ChooseByRouteNameFilter(@NotNull ChooseByNamePopup popup,
                                   @NotNull FilteringGotoByModel<RequestMethod> model,
                                   @NotNull ChooseByNameFilterConfiguration<RequestMethod> filterConfiguration,
                                   @NotNull Project project) {
        super(popup, model, filterConfiguration, project);
    }


    @Override
    protected String textForFilterValue(@NotNull RequestMethod value) {
        return value.getName();
    }


    @Nullable
    @Override
    protected Icon iconForFilterValue(@NotNull RequestMethod value) {
        return value.getIcon();
    }


    @NotNull
    @Override
    protected Collection<RequestMethod> getAllFilterValues() {
// Path: src/net/bitpot/railways/models/RequestMethods.java
// public class RequestMethods {
//     public static final RequestMethod GET = new GetRequestMethod();
//     public static final RequestMethod POST = new PostRequestMethod();
//     public static final RequestMethod PUT = new PutRequestMethod();
//     public static final RequestMethod PATCH = new PatchRequestMethod();
//     public static final RequestMethod DELETE = new DeleteRequestMethod();
//     public static final RequestMethod ANY = new AnyRequestMethod();
// 
// 
//     private static final List<RequestMethod> requestMethods = createRequestMethods();
// 
// 
//     private static List<RequestMethod> createRequestMethods() {
//         Vector<RequestMethod> methods = new Vector<>();
//         methods.add(GET);
//         methods.add(POST);
//         methods.add(PUT);
//         methods.add(PATCH);
//         methods.add(DELETE);
//         methods.add(ANY);
// 
//         return methods;
//     }
// 
// 
//     /**
//      * Finds request method by name. If no request method is found, AnyRequestMethod is
//      * returned.
//      *
//      * @param name Name of request method.
//      * @return RequestMethod object.
//      */
//     @NotNull
//     public static RequestMethod get(String name) {
//         for(RequestMethod method: requestMethods)
//             if (method.getName().equals(name))
//                 return method;
// 
//         return ANY;
//     }
// 
// 
//     public static Collection<RequestMethod> getAllRequestMethods() {
//         return requestMethods;
//     }
// }
// 
// Path: src/net/bitpot/railways/models/requestMethods/RequestMethod.java
// public interface RequestMethod {
// 
//     /**
//      * Returns the icon used for showing routes of the type.
//      *
//      * @return The icon instance, or null if no icon should be shown.
//      */
//     Icon getIcon();
// 
//     /**
//      * Returns the name of the route type. The name must be unique among all route types.
//      *
//      * @return The route type name.
//      */
//     @NotNull
//     @NonNls
//     String getName();
// 
// }


// Path: src/net/bitpot/railways/navigation/ChooseByRouteNameFilter.java
import com.intellij.ide.util.gotoByName.ChooseByNameFilter;
import com.intellij.ide.util.gotoByName.ChooseByNameFilterConfiguration;
import com.intellij.ide.util.gotoByName.ChooseByNamePopup;
import com.intellij.ide.util.gotoByName.FilteringGotoByModel;
import com.intellij.openapi.project.Project;
import net.bitpot.railways.models.RequestMethods;
import net.bitpot.railways.models.requestMethods.RequestMethod;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.util.Collection;

package net.bitpot.railways.navigation;



/**
 *
 */
public class ChooseByRouteNameFilter extends ChooseByNameFilter<RequestMethod> {
    /**
     * A constructor
     *
     * @param popup               a parent popup
     * @param model               a model for popup
     * @param filterConfiguration storage for selected filter values
     * @param project             a context project
     */
    public ChooseByRouteNameFilter(@NotNull ChooseByNamePopup popup,
                                   @NotNull FilteringGotoByModel<RequestMethod> model,
                                   @NotNull ChooseByNameFilterConfiguration<RequestMethod> filterConfiguration,
                                   @NotNull Project project) {
        super(popup, model, filterConfiguration, project);
    }


    @Override
    protected String textForFilterValue(@NotNull RequestMethod value) {
        return value.getName();
    }


    @Nullable
    @Override
    protected Icon iconForFilterValue(@NotNull RequestMethod value) {
        return value.getIcon();
    }


    @NotNull
    @Override
    protected Collection<RequestMethod> getAllFilterValues() {
        return RequestMethods.getAllRequestMethods();