use of com.intellij.ui.DocumentAdapter in project scss-lint-plugin by idok.
the class ScssLintSettingsPage method addListeners.
private void addListeners() {
useSpecificConfigRadioButton.addItemListener(e -> scssLintConfigFile.setEnabled(e.getStateChange() == ItemEvent.SELECTED));
pluginEnabledCheckbox.addItemListener(e -> {
boolean enabled = e.getStateChange() == ItemEvent.SELECTED;
setEnabledState(enabled);
});
DocumentAdapter docAdp = new DocumentAdapter() {
protected void textChanged(@NotNull DocumentEvent e) {
updateLaterInEDT();
}
};
scssLintExeField.getChildComponent().getTextEditor().getDocument().addDocumentListener(docAdp);
scssLintConfigFile.getChildComponent().getTextEditor().getDocument().addDocumentListener(docAdp);
}
use of com.intellij.ui.DocumentAdapter in project android by JetBrains.
the class TraceViewPanel method createSearchField.
private SearchTextField createSearchField() {
SearchTextField stf = new SearchTextField(true);
stf.setOpaque(false);
stf.setEnabled(true);
Utils.setSmallerFont(stf);
stf.addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
searchTextChanged(getText(e));
}
private String getText(DocumentEvent e) {
try {
return e.getDocument().getText(0, e.getDocument().getLength());
} catch (BadLocationException e1) {
return "";
}
}
});
JTextField editorTextField = stf.getTextEditor();
editorTextField.setMinimumSize(new Dimension(JBUI.scale(200), -1));
editorTextField.registerKeyboardAction(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
closeSearchComponent();
}
}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
return stf;
}
use of com.intellij.ui.DocumentAdapter in project android by JetBrains.
the class ImportSourceLocationStep method setupSourceLocationControls.
private void setupSourceLocationControls() {
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor();
descriptor.setTitle("Select Source Location");
descriptor.setDescription("Select existing ADT or Gradle project to import as a new subproject");
mySourceLocation.addBrowseFolderListener(new TextBrowseFolderListener(descriptor));
mySourceLocation.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
invalidate();
}
});
applyBackgroundOperationResult(checkPath(mySourceLocation.getText()));
myErrorWarning.setIcon(null);
myErrorWarning.setText(null);
}
use of com.intellij.ui.DocumentAdapter in project intellij-plugins by JetBrains.
the class SelectDirWithFlashBuilderProjectsStep method setupInitialPathComponent.
private void setupInitialPathComponent() {
myInitialPathComponent.getComponent().getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
protected void textChanged(final DocumentEvent e) {
onInitialPathChanged();
}
});
final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, true, true, true, false, false) {
public boolean isFileVisible(final VirtualFile file, final boolean showHiddenFiles) {
return (super.isFileVisible(file, showHiddenFiles) && (file.isDirectory() || FlashBuilderProjectFinder.isFlashBuilderProject(file)) || FlashBuilderProjectFinder.hasArchiveExtension(file.getPath()));
}
public Icon getIcon(final VirtualFile file) {
// do not use Flash Builder specific icon for zip
return !file.isDirectory() && (FlashBuilderProjectFinder.hasFxpExtension(file.getPath()) || FlashBuilderProjectFinder.isFlashBuilderProject(file)) ? dressIcon(file, getBuilder().getIcon()) : super.getIcon(file);
}
};
myInitialPathComponent.getComponent().addBrowseFolderListener(FlexBundle.message("select.flash.builder.workspace.or.project"), null, getWizardContext().getProject(), descriptor);
}
use of com.intellij.ui.DocumentAdapter 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());
}
Aggregations