Search in sources :

Example 1 with UserActivityListener

use of com.intellij.ui.UserActivityListener in project intellij-community by JetBrains.

the class DomUIFactoryImpl method setupErrorOutdatingUserActivityWatcher.

@Override
public void setupErrorOutdatingUserActivityWatcher(final CommittablePanel panel, final DomElement... elements) {
    final UserActivityWatcher userActivityWatcher = createEditorAwareUserActivityWatcher();
    userActivityWatcher.addUserActivityListener(new UserActivityListener() {

        private boolean isProcessingChange;

        @Override
        public void stateChanged() {
            if (isProcessingChange)
                return;
            isProcessingChange = true;
            try {
                for (final DomElement element : elements) {
                    DomElementAnnotationsManagerImpl.outdateProblemHolder(element);
                }
                CommittableUtil.updateHighlighting(panel);
            } finally {
                isProcessingChange = false;
            }
        }
    }, panel);
    userActivityWatcher.register(panel.getComponent());
}
Also used : DomElement(com.intellij.util.xml.DomElement) UserActivityWatcher(com.intellij.ui.UserActivityWatcher) UserActivityListener(com.intellij.ui.UserActivityListener)

Example 2 with UserActivityListener

use of com.intellij.ui.UserActivityListener in project intellij-community by JetBrains.

the class SettingsEditor method installWatcher.

protected void installWatcher(JComponent c) {
    myWatcher = new UserActivityWatcher();
    myWatcher.register(c);
    UserActivityListener userActivityListener = new UserActivityListener() {

        @Override
        public void stateChanged() {
            fireEditorStateChanged();
        }
    };
    myWatcher.addUserActivityListener(userActivityListener, this);
}
Also used : UserActivityWatcher(com.intellij.ui.UserActivityWatcher) UserActivityListener(com.intellij.ui.UserActivityListener)

Example 3 with UserActivityListener

use of com.intellij.ui.UserActivityListener in project intellij-leiningen-plugin by derkork.

the class LeiningenSettings method createComponent.

public JComponent createComponent() {
    JPanel outerPanel = new JPanel(new BorderLayout());
    JPanel leinPanel = new JPanel(new FormLayout("80dlu, fill:80dlu:grow, 20dlu, 80dlu", "p,p,p"));
    CellConstraints c = new CellConstraints();
    int row = 1;
    leinPanel.add(new JBLabel("Leiningen executable:"), c.xy(1, row));
    this.leinBinSelectorField = new TextFieldWithBrowseButton();
    leinBinSelectorField.addBrowseFolderListener("Select the Leiningen executable", "'lein' on Linux/MacOS, 'lein.bat' on Windows. ", null, new FileChooserDescriptor(true, false, false, false, false, false));
    leinPanel.add(leinBinSelectorField, c.xy(2, row));
    row++;
    leinPanel.add(new JBLabel("Leiningen Home:"), c.xy(1, row));
    this.leinHomeSelectorField = new TextFieldWithBrowseButton();
    leinHomeSelectorField.addBrowseFolderListener("Select the Leiningen home directory", "usually at $USER_HOME/.lein", null, new FileChooserDescriptor(false, true, false, false, false, false));
    leinPanel.add(leinHomeSelectorField, c.xy(2, row));
    this.overrideLeinHome = new JBCheckBox();
    leinPanel.add(overrideLeinHome, c.xy(3, row));
    leinPanel.add(new JBLabel("Override"), c.xy(4, row));
    row++;
    leinPanel.add(new JBLabel("Leiningen Jar:"), c.xy(1, row));
    this.leinJarSelectorField = new TextFieldWithBrowseButton();
    leinJarSelectorField.addBrowseFolderListener("Select the Leiningen Jar", "usually at $USER_HOME/.lein/self-installs/leinigen-VERSION-standalone.jar", null, new FileChooserDescriptor(true, false, true, true, false, false));
    leinPanel.add(leinJarSelectorField, c.xy(2, row));
    this.overrideLeinJar = new JBCheckBox();
    leinPanel.add(overrideLeinJar, c.xy(3, row));
    leinPanel.add(new JBLabel("Override"), c.xy(4, row));
    outerPanel.add(leinPanel, BorderLayout.NORTH);
    myWatcher = new UserActivityWatcher();
    myWatcher.register(outerPanel);
    myWatcher.addUserActivityListener(new UserActivityListener() {

        public void stateChanged() {
            changed = true;
            leinJarSelectorField.setEnabled(overrideLeinJar.isSelected());
            leinHomeSelectorField.setEnabled(overrideLeinHome.isSelected());
        }
    });
    return outerPanel;
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) TextFieldWithBrowseButton(com.intellij.openapi.ui.TextFieldWithBrowseButton) JBLabel(com.intellij.ui.components.JBLabel) FileChooserDescriptor(com.intellij.openapi.fileChooser.FileChooserDescriptor) UserActivityWatcher(com.intellij.ui.UserActivityWatcher) UserActivityListener(com.intellij.ui.UserActivityListener) CellConstraints(com.jgoodies.forms.layout.CellConstraints) JBCheckBox(com.intellij.ui.components.JBCheckBox)

Aggregations

UserActivityListener (com.intellij.ui.UserActivityListener)3 UserActivityWatcher (com.intellij.ui.UserActivityWatcher)3 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)1 TextFieldWithBrowseButton (com.intellij.openapi.ui.TextFieldWithBrowseButton)1 JBCheckBox (com.intellij.ui.components.JBCheckBox)1 JBLabel (com.intellij.ui.components.JBLabel)1 DomElement (com.intellij.util.xml.DomElement)1 CellConstraints (com.jgoodies.forms.layout.CellConstraints)1 FormLayout (com.jgoodies.forms.layout.FormLayout)1