Search in sources :

Example 6 with MergingUpdateQueue

use of com.intellij.util.ui.update.MergingUpdateQueue in project android by JetBrains.

the class PsDaemon method reset.

public void reset() {
    MergingUpdateQueue mainQueue = getMainQueue();
    reset(mainQueue, getResultsUpdaterQueue());
    mainQueue.queue(new Update("reset") {

        @Override
        public void run() {
            myStopped.set(false);
        }
    });
}
Also used : MergingUpdateQueue(com.intellij.util.ui.update.MergingUpdateQueue) Update(com.intellij.util.ui.update.Update)

Example 7 with MergingUpdateQueue

use of com.intellij.util.ui.update.MergingUpdateQueue in project android by JetBrains.

the class PsDaemon method stop.

private static void stop(@NotNull MergingUpdateQueue... queues) {
    for (MergingUpdateQueue queue : queues) {
        queue.cancelAllUpdates();
        queue.deactivate();
    }
}
Also used : MergingUpdateQueue(com.intellij.util.ui.update.MergingUpdateQueue)

Example 8 with MergingUpdateQueue

use of com.intellij.util.ui.update.MergingUpdateQueue in project android by JetBrains.

the class NlPropertiesManager method componentSelectionChanged.

// ---- Implements DesignSurfaceListener ----
@Override
public void componentSelectionChanged(@NotNull DesignSurface surface, @NotNull final List<NlComponent> newSelection) {
    if (surface != mySurface) {
        return;
    }
    MergingUpdateQueue queue = getUpdateQueue();
    if (queue == null) {
        return;
    }
    if (!newSelection.isEmpty() && myFirstLoad) {
        myFirstLoad = false;
        myLoadingPanel.startLoading();
    }
    myLoading = true;
    queue.queue(new Update("updateProperties") {

        @Override
        public void run() {
            setSelectedComponents(newSelection, myLoadingPanel::stopLoading);
        }

        @Override
        public boolean canEat(Update update) {
            return true;
        }
    });
}
Also used : MergingUpdateQueue(com.intellij.util.ui.update.MergingUpdateQueue) Update(com.intellij.util.ui.update.Update)

Example 9 with MergingUpdateQueue

use of com.intellij.util.ui.update.MergingUpdateQueue in project intellij-community by JetBrains.

the class SelectLocationStep method createComponent.

protected JComponent createComponent() {
    final JPanel panel = new MyPanel();
    final JPanel toolbarPanel = new JPanel(new GridBagLayout());
    final GridBagConstraints constraints = new GridBagConstraints();
    constraints.gridx = 0;
    constraints.gridy = 0;
    toolbarPanel.add(myFileSystemToolBar.getComponent(), constraints);
    constraints.gridx = 1;
    constraints.weightx = 1.0;
    constraints.anchor = GridBagConstraints.EAST;
    toolbarPanel.add(myTextFieldAction, constraints);
    myNorthPanel.add(toolbarPanel, BorderLayout.NORTH);
    panel.add(myNorthPanel, BorderLayout.NORTH);
    panel.add(ScrollPaneFactory.createScrollPane(myFileSystemTree.getTree()), BorderLayout.CENTER);
    JLabel dndLabel = new JLabel(FileChooserDialogImpl.DRAG_N_DROP_HINT, SwingConstants.CENTER);
    dndLabel.setFont(JBUI.Fonts.miniFont());
    dndLabel.setForeground(UIUtil.getLabelDisabledForeground());
    panel.add(dndLabel, BorderLayout.SOUTH);
    myUiUpdater = new MergingUpdateQueue("FileChooserUpdater", 200, false, panel);
    Disposer.register(myFileSystemTree, myUiUpdater);
    new UiNotifyConnector(panel, myUiUpdater);
    updateTextFieldShowing();
    return panel;
}
Also used : MergingUpdateQueue(com.intellij.util.ui.update.MergingUpdateQueue) UiNotifyConnector(com.intellij.util.ui.update.UiNotifyConnector)

Example 10 with MergingUpdateQueue

use of com.intellij.util.ui.update.MergingUpdateQueue in project intellij-community by JetBrains.

the class FileChooserDialogImpl method createCenterPanel.

protected JComponent createCenterPanel() {
    JPanel panel = new MyPanel();
    myUiUpdater = new MergingUpdateQueue("FileChooserUpdater", 200, false, panel);
    Disposer.register(myDisposable, myUiUpdater);
    new UiNotifyConnector(panel, myUiUpdater);
    panel.setBorder(JBUI.Borders.empty());
    createTree();
    final DefaultActionGroup group = createActionGroup();
    ActionToolbar toolBar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, true);
    toolBar.setTargetComponent(panel);
    final JPanel toolbarPanel = new JPanel(new BorderLayout());
    toolbarPanel.add(toolBar.getComponent(), BorderLayout.CENTER);
    myTextFieldAction = new TextFieldAction() {

        public void linkSelected(final LinkLabel aSource, final Object aLinkData) {
            toggleShowTextField();
        }
    };
    toolbarPanel.add(myTextFieldAction, BorderLayout.EAST);
    JPanel extraToolbarPanel = createExtraToolbarPanel();
    if (extraToolbarPanel != null) {
        toolbarPanel.add(extraToolbarPanel, BorderLayout.SOUTH);
    }
    myPathTextFieldWrapper = new JPanel(new BorderLayout());
    myPathTextFieldWrapper.setBorder(JBUI.Borders.emptyBottom(2));
    myPathTextField = new FileTextFieldImpl.Vfs(FileChooserFactoryImpl.getMacroMap(), getDisposable(), new LocalFsFinder.FileChooserFilter(myChooserDescriptor, myFileSystemTree)) {

        protected void onTextChanged(final String newValue) {
            myUiUpdater.cancelAllUpdates();
            updateTreeFromPath(newValue);
        }
    };
    Disposer.register(myDisposable, myPathTextField);
    myPathTextFieldWrapper.add(myPathTextField.getField(), BorderLayout.CENTER);
    if (getRecentFiles().length > 0) {
        myPathTextFieldWrapper.add(createHistoryButton(), BorderLayout.EAST);
    }
    myNorthPanel = new JPanel(new BorderLayout());
    myNorthPanel.add(toolbarPanel, BorderLayout.NORTH);
    updateTextFieldShowing();
    panel.add(myNorthPanel, BorderLayout.NORTH);
    registerMouseListener(group);
    JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myFileSystemTree.getTree());
    //scrollPane.setBorder(BorderFactory.createLineBorder(new Color(148, 154, 156)));
    panel.add(scrollPane, BorderLayout.CENTER);
    panel.setPreferredSize(JBUI.size(400));
    JLabel dndLabel = new JLabel(DRAG_N_DROP_HINT, SwingConstants.CENTER);
    dndLabel.setFont(JBUI.Fonts.miniFont());
    dndLabel.setForeground(UIUtil.getLabelDisabledForeground());
    panel.add(dndLabel, BorderLayout.SOUTH);
    ApplicationManager.getApplication().getMessageBus().connect(getDisposable()).subscribe(ApplicationActivationListener.TOPIC, new ApplicationActivationListener.Adapter() {

        @Override
        public void applicationActivated(IdeFrame ideFrame) {
            ((SaveAndSyncHandlerImpl) SaveAndSyncHandler.getInstance()).maybeRefresh(ModalityState.current());
        }
    });
    return panel;
}
Also used : MergingUpdateQueue(com.intellij.util.ui.update.MergingUpdateQueue) UiNotifyConnector(com.intellij.util.ui.update.UiNotifyConnector) IdeFrame(com.intellij.openapi.wm.IdeFrame) LinkLabel(com.intellij.ui.components.labels.LinkLabel) ApplicationActivationListener(com.intellij.openapi.application.ApplicationActivationListener)

Aggregations

MergingUpdateQueue (com.intellij.util.ui.update.MergingUpdateQueue)10 Update (com.intellij.util.ui.update.Update)3 UiNotifyConnector (com.intellij.util.ui.update.UiNotifyConnector)2 NotNull (org.jetbrains.annotations.NotNull)2 FileHyperlinkInfo (com.intellij.execution.filters.FileHyperlinkInfo)1 HyperlinkInfo (com.intellij.execution.filters.HyperlinkInfo)1 EditorHyperlinkSupport (com.intellij.execution.impl.EditorHyperlinkSupport)1 LocalHistoryFacade (com.intellij.history.core.LocalHistoryFacade)1 AllIcons (com.intellij.icons.AllIcons)1 AnAction (com.intellij.openapi.actionSystem.AnAction)1 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1 ApplicationActivationListener (com.intellij.openapi.application.ApplicationActivationListener)1 ApplicationManager (com.intellij.openapi.application.ApplicationManager)1 Logger (com.intellij.openapi.diagnostic.Logger)1 Editor (com.intellij.openapi.editor.Editor)1 ColorKey (com.intellij.openapi.editor.colors.ColorKey)1 EditorFontType (com.intellij.openapi.editor.colors.EditorFontType)1 EditorGutterComponentEx (com.intellij.openapi.editor.ex.EditorGutterComponentEx)1 RangeHighlighter (com.intellij.openapi.editor.markup.RangeHighlighter)1 OpenFileDescriptor (com.intellij.openapi.fileEditor.OpenFileDescriptor)1