Search in sources :

Example 1 with TextFieldAction

use of com.intellij.openapi.fileChooser.ex.TextFieldAction in project intellij-community by JetBrains.

the class PackageChooserDialog method setupPathComponent.

private void setupPathComponent(final JPanel northPanel) {
    northPanel.add(new TextFieldAction() {

        @Override
        public void linkSelected(LinkLabel aSource, Object aLinkData) {
            toggleShowPathComponent(northPanel, this);
        }
    }, BorderLayout.EAST);
    myPathEditor = new EditorTextField(JavaReferenceEditorUtil.createDocument("", myProject, false), myProject, StdFileTypes.JAVA);
    myPathEditor.addDocumentListener(new DocumentAdapter() {

        @Override
        public void documentChanged(DocumentEvent e) {
            myAlarm.cancelAllRequests();
            myAlarm.addRequest(() -> updateTreeFromPath(), 300);
        }
    });
    myPathEditor.setBorder(BorderFactory.createEmptyBorder(0, 0, 2, 0));
    northPanel.add(myPathEditor, BorderLayout.SOUTH);
}
Also used : TextFieldAction(com.intellij.openapi.fileChooser.ex.TextFieldAction) EditorTextField(com.intellij.ui.EditorTextField) LinkLabel(com.intellij.ui.components.labels.LinkLabel) DocumentAdapter(com.intellij.openapi.editor.event.DocumentAdapter) DocumentEvent(com.intellij.openapi.editor.event.DocumentEvent)

Aggregations

DocumentAdapter (com.intellij.openapi.editor.event.DocumentAdapter)1 DocumentEvent (com.intellij.openapi.editor.event.DocumentEvent)1 TextFieldAction (com.intellij.openapi.fileChooser.ex.TextFieldAction)1 EditorTextField (com.intellij.ui.EditorTextField)1 LinkLabel (com.intellij.ui.components.labels.LinkLabel)1