Search in sources :

Example 96 with JBLabel

use of com.intellij.ui.components.JBLabel in project android by JetBrains.

the class NlPropertyInspectorFixture method findPropertyComponent.

@Nullable
private Component findPropertyComponent(@NotNull String name, @Nullable Icon icon) {
    try {
        JBLabel label = waitUntilFound(robot(), myPanel, new GenericTypeMatcher<JBLabel>(JBLabel.class) {

            @Override
            protected boolean isMatching(@NotNull JBLabel label) {
                return name.equals(label.getText()) && label.getIcon() == icon;
            }
        });
        Container parent = label.getParent();
        Component[] components = parent.getComponents();
        for (int i = 0; i < components.length; i++) {
            if (label == components[i]) {
                return components[i + 1];
            }
        }
        return null;
    } catch (WaitTimedOutError ex) {
        return null;
    }
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) WaitTimedOutError(org.fest.swing.exception.WaitTimedOutError) Nullable(com.android.annotations.Nullable)

Example 97 with JBLabel

use of com.intellij.ui.components.JBLabel in project android by JetBrains.

the class AbstractWizardStepFixture method getValidationText.

public String getValidationText() {
    JBLabel validationLabel = robot().finder().findByName(target(), "ValidationLabel", JBLabel.class);
    Wait.seconds(1).expecting("validation text to appear").until(() -> validationLabel.getText().matches(".*\\S.*"));
    return validationLabel.getText();
}
Also used : JBLabel(com.intellij.ui.components.JBLabel)

Example 98 with JBLabel

use of com.intellij.ui.components.JBLabel in project android by JetBrains.

the class ConfigureActivityStep method onEntering.

@Override
protected void onEntering() {
    // Verified by shouldSkip
    assert getModel().getTargetTemplate() != null;
    myRootPanel.removeAll();
    int row = 0;
    for (String param : getModel().getTargetTemplate().getParameters()) {
        myRootPanel.add(new JBLabel(param + ": "), new TabularLayout.Constraint(row, 0));
        JBTextField valueTextField = new JBTextField("Value" + (row + 1));
        valueTextField.putClientProperty("param", param);
        myRootPanel.add(valueTextField, new TabularLayout.Constraint(row, 1));
        if (row == 0) {
            myPreferredFocus = valueTextField;
        }
        row++;
    }
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) TabularLayout(com.android.tools.adtui.TabularLayout) JBTextField(com.intellij.ui.components.JBTextField)

Aggregations

JBLabel (com.intellij.ui.components.JBLabel)98 Nullable (org.jetbrains.annotations.Nullable)23 NotNull (org.jetbrains.annotations.NotNull)11 JBCheckBox (com.intellij.ui.components.JBCheckBox)10 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)9 VirtualFile (com.intellij.openapi.vfs.VirtualFile)8 ComboBox (com.intellij.openapi.ui.ComboBox)7 VerticalFlowLayout (com.intellij.openapi.ui.VerticalFlowLayout)7 GridBag (com.intellij.util.ui.GridBag)7 List (java.util.List)7 JBList (com.intellij.ui.components.JBList)6 JBTable (com.intellij.ui.table.JBTable)6 JBTextField (com.intellij.ui.components.JBTextField)5 DocumentEvent (javax.swing.event.DocumentEvent)5 DumbAwareAction (com.intellij.openapi.project.DumbAwareAction)4 Project (com.intellij.openapi.project.Project)4 TextFieldWithBrowseButton (com.intellij.openapi.ui.TextFieldWithBrowseButton)4 StringUtil (com.intellij.openapi.util.text.StringUtil)4 java.awt (java.awt)4 ArrayList (java.util.ArrayList)4