Example usage for com.intellij.openapi.ui LabeledComponent getComponent

List of usage examples for com.intellij.openapi.ui LabeledComponent getComponent

Introduction

In this page you can find the example usage for com.intellij.openapi.ui LabeledComponent getComponent.

Prototype

public Comp getComponent() 

Source Link

Usage

From source file:com.android.tools.idea.run.editor.TestRunParameters.java

License:Apache License

private static void bind(final LabeledComponent<? extends ComponentWithBrowseButton<?>> labeledComponent,
        BrowseModuleValueActionListener browser) {
    browser.setField(labeledComponent.getComponent());
}

From source file:com.intellij.execution.junit2.configuration.JUnitConfigurable.java

License:Apache License

private void installDocuments() {
    for (int i = 0; i < myTestLocations.length; i++) {
        final LabeledComponent testLocation = getTestLocation(i);
        final JComponent component = testLocation.getComponent();
        final ComponentWithBrowseButton field;
        final Object document;
        if (component instanceof TextFieldWithBrowseButton) {
            field = (TextFieldWithBrowseButton) component;
            document = new PlainDocument();
            ((TextFieldWithBrowseButton) field).getTextField().setDocument((Document) document);
            myModel.setJUnitDocument(i, document);
        } else if (component instanceof EditorTextFieldWithBrowseButton) {
            field = (ComponentWithBrowseButton) component;
            document = ((EditorTextField) field.getChildComponent()).getDocument();
            myModel.setJUnitDocument(i, document);
        } else {//from  w w  w .  j av  a2 s . c  o m
            field = myPatternTextField;
            document = new PlainDocument();
            ((TextFieldWithBrowseButton) field).getTextField().setDocument((Document) document);
            myModel.setJUnitDocument(i, document);
        }
        myBrowsers[i].setField(field);
    }
}

From source file:com.intellij.execution.ui.CommonProgramParametersPanel.java

License:Apache License

protected void copyDialogCaption(final LabeledComponent<RawCommandLineEditor> component) {
    final RawCommandLineEditor rawCommandLineEditor = component.getComponent();
    rawCommandLineEditor.setDialogCaption(component.getRawText());
    component.getLabel().setLabelFor(rawCommandLineEditor.getTextField());
}

From source file:com.perl5.lang.perl.idea.configuration.settings.PerlSettingsConfigurable.java

License:Apache License

protected LabeledComponent<RawCommandLineEditor> copyDialogCaption(
        final LabeledComponent<RawCommandLineEditor> component, String text) {
    final RawCommandLineEditor rawCommandLineEditor = component.getComponent();
    rawCommandLineEditor.setDialogCaption(text);
    component.getLabel().setLabelFor(rawCommandLineEditor.getTextField());
    return component;
}

From source file:com.perl5.lang.perl.idea.configuration.settings.sdk.Perl5ProjectConfigurable.java

License:Apache License

private static LabeledComponent<RawCommandLineEditor> copyDialogCaption(
        final LabeledComponent<RawCommandLineEditor> component, String text) {
    final RawCommandLineEditor rawCommandLineEditor = component.getComponent();
    rawCommandLineEditor.setDialogCaption(text);
    component.getLabel().setLabelFor(rawCommandLineEditor.getTextField());
    return component;
}

From source file:org.codinjutsu.tools.jenkins.view.validator.FileValidator.java

License:Apache License

public void validate(LabeledComponent<TextFieldWithBrowseButton> component) throws ConfigurationException {
    String filepath = component.getComponent().getText();
    if (StringUtils.isEmpty(filepath)) {
        return;//  w ww .j av  a2  s.  c om
    }
    File file = new File(filepath);
    if (!file.exists() || !file.isFile()) {
        throw new ConfigurationException(String.format("'%s' is not a file", filepath));
    }

}

From source file:org.codinjutsu.tools.mongo.view.MongoConfigurable.java

License:Apache License

private LabeledComponent<TextFieldWithBrowseButton> createShellPathField() {
    LabeledComponent<TextFieldWithBrowseButton> shellPathField = new LabeledComponent<TextFieldWithBrowseButton>();
    TextFieldWithBrowseButton component = new TextFieldWithBrowseButton();
    component.getChildComponent().setName("shellPathField");
    shellPathField.setComponent(component);
    shellPathField.getComponent().addBrowseFolderListener("Mongo shell configuration", "", null,
            new FileChooserDescriptor(true, false, false, false, false, false));

    shellPathField.getComponent().setText(configuration.getShellPath());

    return shellPathField;
}

From source file:org.intellij.xquery.settings.UIUtils.java

License:Apache License

static <T> LabeledComponent<JComboBox<T>> comboBox(String text, String name, ComboBoxModel<T> model) {
    LabeledComponent<JComboBox<T>> comboBox = new LabeledComponent<>();
    comboBox.setText(text);/*w  w w . jav a2s. c o  m*/
    comboBox.setLabelLocation("West");
    comboBox.setComponent(new JComboBox<>());
    comboBox.getComponent().setName(name);
    comboBox.getComponent().setModel(model);
    return comboBox;
}

From source file:org.jetbrains.jet.plugin.run.JetRunConfigurationEditor.java

License:Apache License

public JetRunConfigurationEditor(final Project project) {
    LabeledComponent<JComboBox> moduleChooser = LabeledComponent.create(new JComboBox(),
            "Use classpath and JDK of module:");
    myModuleChooserHolder.add(moduleChooser, BorderLayout.CENTER);
    myModuleSelector = new ConfigurationModuleSelector(project, moduleChooser.getComponent());
    myCommonProgramParameters.setModuleContext(myModuleSelector.getModule());
    moduleChooser.getComponent().addActionListener(new ActionListener() {
        @Override//  w  w w  .j a  v a  2  s. co m
        public void actionPerformed(ActionEvent e) {
            myCommonProgramParameters.setModuleContext(myModuleSelector.getModule());
        }
    });
}

From source file:org.moe.idea.runconfig.configuration.ArgumentsPanel.java

License:Apache License

protected void copyDialogCaption(LabeledComponent<RawCommandLineEditor> component) {
    RawCommandLineEditor rawCommandLineEditor = (RawCommandLineEditor) component.getComponent();
    rawCommandLineEditor.setDialogCaption(component.getRawText());
    component.getLabel().setLabelFor(rawCommandLineEditor.getTextField());
}