use of javax.swing.text.JTextComponent in project android by JetBrains.
the class ConfigureAvdOptionsStepFixture method setAvdName.
@NotNull
public ConfigureAvdOptionsStepFixture setAvdName(@NotNull String name) {
JTextComponent textFieldWithLabel = findTextFieldWithLabel("AVD Name");
replaceText(textFieldWithLabel, name);
return this;
}
use of javax.swing.text.JTextComponent in project android by JetBrains.
the class ConfigureAndroidProjectStepFixture method enterCompanyDomain.
@NotNull
public ConfigureAndroidProjectStepFixture enterCompanyDomain(@NotNull String text) {
JTextComponent textField = findTextFieldWithLabel("Company domain:");
replaceText(textField, text);
return this;
}
use of javax.swing.text.JTextComponent in project android by JetBrains.
the class ConfigureBasicActivityStepFixture method enterTextFieldValue.
@NotNull
public ConfigureBasicActivityStepFixture enterTextFieldValue(@NotNull ActivityTextField activityField, @NotNull String text) {
JTextComponent textField = findTextFieldWithLabel(activityField.getLabelText());
replaceText(textField, text);
return this;
}
use of javax.swing.text.JTextComponent in project intellij-plugins by JetBrains.
the class DartGeneratorPeer method enableIntellijLiveValidation.
private void enableIntellijLiveValidation() {
final JTextComponent editorComponent = (JTextComponent) mySdkPathComboWithBrowse.getComboBox().getEditor().getEditorComponent();
editorComponent.getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(final DocumentEvent e) {
validateInIntelliJ();
}
});
myCreateSampleProjectCheckBox.addActionListener(e -> validateInIntelliJ());
myTemplatesList.addListSelectionListener(e -> validateInIntelliJ());
}
use of javax.swing.text.JTextComponent in project intellij-plugins by JetBrains.
the class DartConfigurable method initDartSdkAndDartiumControls.
private void initDartSdkAndDartiumControls() {
final Computable<ChromeSettings> currentDartiumSettingsRetriever = () -> myDartiumSettingsCurrent;
final Computable<Boolean> isResettingControlsComputable = () -> myInReset;
DartSdkUtil.initDartSdkAndDartiumControls(myProject, mySdkPathComboWithBrowse, myVersionLabel, myDartiumPathComboWithBrowse, currentDartiumSettingsRetriever, myDartiumSettingsButton, isResettingControlsComputable);
final JTextComponent sdkEditor = (JTextComponent) mySdkPathComboWithBrowse.getComboBox().getEditor().getEditorComponent();
sdkEditor.getDocument().addDocumentListener(new DocumentAdapter() {
protected void textChanged(final DocumentEvent e) {
final String sdkHomePath = getTextFromCombo(mySdkPathComboWithBrowse);
if (!sdkHomePath.isEmpty()) {
final String version = DartSdkUtil.getSdkVersion(sdkHomePath);
if (version != null && (version.contains("-dev.") || version.contains("-edge."))) {
mySdkUpdateChannelCombo.setSelectedItem(DartSdkUpdateOption.StableAndDev);
}
}
updateControlsEnabledState();
updateErrorLabel();
}
});
final JTextComponent dartiumEditor = (JTextComponent) myDartiumPathComboWithBrowse.getComboBox().getEditor().getEditorComponent();
dartiumEditor.getDocument().addDocumentListener(new DocumentAdapter() {
protected void textChanged(final DocumentEvent e) {
updateErrorLabel();
}
});
myCheckSdkUpdateCheckBox.addActionListener(e -> {
final boolean enabled = myCheckSdkUpdateCheckBox.isSelected() && myCheckSdkUpdateCheckBox.isEnabled();
mySdkUpdateChannelCombo.setEnabled(enabled);
myCheckSdkUpdateButton.setEnabled(enabled);
if (enabled) {
IdeFocusManager.getInstance(myProject).requestFocus(mySdkUpdateChannelCombo, true);
}
});
mySdkUpdateChannelCombo.setModel(new DefaultComboBoxModel(DartSdkUpdateOption.OPTIONS_TO_SHOW_IN_COMBO));
mySdkUpdateChannelCombo.setRenderer(new ListCellRendererWrapper<DartSdkUpdateOption>() {
@Override
public void customize(JList list, DartSdkUpdateOption value, int index, boolean selected, boolean hasFocus) {
setText(value.getPresentableName());
}
});
myCheckSdkUpdateButton.addActionListener(e -> {
final Runnable runnable = this::checkSdkUpdate;
ApplicationManagerEx.getApplicationEx().runProcessWithProgressSynchronously(runnable, DartBundle.message("checking.dart.sdk.update"), true, myProject, myMainPanel);
});
}
Aggregations