/*
 * Copyright 2000-2017 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.intellij.testGuiFramework.fixtures;

import com.intellij.openapi.ui.ComponentWithBrowseButton;
import com.intellij.openapi.ui.FixedSizeButton;
import org.fest.swing.core.Robot;
import org.jetbrains.annotations.NotNull;


public class ComponentWithBrowseButtonFixture extends JComponentFixture<ComponentWithBrowseButtonFixture, ComponentWithBrowseButton> {

  public ComponentWithBrowseButtonFixture(ComponentWithBrowseButton componentWithBrowseButton, @NotNull Robot robot) {
    super(ComponentWithBrowseButtonFixture.class, robot, componentWithBrowseButton);
  }

  public void clickButton() {
    FixedSizeButton button = target().getButton();
    robot().click(button);
  }
}

@@ -643,16 +643,87 @@
 tures;%0A%0A
+import com.intellij.ide.ui.laf.darcula.ui.TextFieldWithPopupHandlerUI;%0A
 import c
@@ -831,77 +831,400 @@
 ort 
-org.fest.swing.core.Robot;%0Aimport org.jetbrains.annotations.NotNull;%0A
+com.intellij.ui.components.fields.ExtendableTextComponent;%0Aimport com.intellij.ui.components.fields.ExtendableTextField;%0Aimport org.fest.swing.core.Robot;%0Aimport org.fest.swing.exception.ComponentLookupException;%0Aimport org.jetbrains.annotations.NotNull;%0A%0Aimport javax.swing.*;%0Aimport javax.swing.plaf.TextUI;%0Aimport java.awt.*;%0Aimport java.util.Optional;%0Aimport java.util.function.Predicate;
 %0A%0Apu
@@ -1677,11 +1677,1298 @@
 on);%0A  %7D
+%0A%0A  public void clickAnyExtensionButton() %7B%0A    clickExtensionButton(extension -%3E true);%0A  %7D%0A%0A  public void clickExtensionButton(@NotNull final Predicate%3CExtendableTextComponent.Extension%3E extensionFilter) %7B%0A    robot().click(target(), getExtensionIconLocation(extensionFilter));%0A  %7D%0A%0A  public Point getExtensionIconLocation(@NotNull final Predicate%3CExtendableTextComponent.Extension%3E extensionFilter) %7B%0A    final JComponent component = target().getChildComponent();%0A    if (!(component instanceof ExtendableTextField)) %7B%0A      throw new ComponentLookupException(%22Child component is not an instance of ExtendableTextField%22);%0A    %7D%0A    final ExtendableTextField extendableTextField = (ExtendableTextField) component;%0A%0A    final Optional%3CExtendableTextComponent.Extension%3E extension =%0A      extendableTextField.getExtensions().stream().filter(extensionFilter).findFirst();%0A    if (!extension.isPresent()) %7B%0A      throw new ComponentLookupException(%22Unable to find extension%22);%0A    %7D%0A%0A    final TextUI textUI = extendableTextField.getUI();%0A    if (!(textUI instanceof TextFieldWithPopupHandlerUI)) %7B%0A      throw new ComponentLookupException(%22Unable to find extension button%22);%0A    %7D%0A    return ((TextFieldWithPopupHandlerUI) textUI).getExtensionIconLocation(extension.get().toString());%0A  %7D
 %0A%7D%0A

add extension icon click methods