mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
port listeners lists to ContainerUtil.createLockFreeCopyOnWriteList() to simplify and make consistent
This commit is contained in:
@@ -45,7 +45,7 @@ public class HotSwapProgressImpl extends HotSwapProgress {
|
||||
private String myTitle = DebuggerBundle.message("progress.hot.swap.title");
|
||||
private final MergingUpdateQueue myUpdateQueue;
|
||||
private WeakReference<XDebugSession> mySessionRef = null;
|
||||
private final List<HotSwapProgressListener> myListeners = ContainerUtil.newSmartList();
|
||||
private final List<HotSwapProgressListener> myListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
|
||||
public HotSwapProgressImpl(Project project) {
|
||||
super(project);
|
||||
|
||||
+1
-2
@@ -18,7 +18,6 @@ import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -33,7 +32,7 @@ public abstract class TextEditorBasedStructureViewModel implements StructureView
|
||||
private final Editor myEditor;
|
||||
private final PsiFile myPsiFile;
|
||||
private final List<FileEditorPositionListener> myListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
private final List<ModelListener> myModelListeners = new ArrayList<>(2);
|
||||
private final List<ModelListener> myModelListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
private final CaretListener myEditorCaretListener;
|
||||
private Disposable myEditorCaretListenerDisposable;
|
||||
|
||||
|
||||
@@ -26,12 +26,12 @@ import com.intellij.openapi.util.DifferenceFilter;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CodeStyleSettingsManager implements PersistentStateComponent<Element> {
|
||||
@@ -48,7 +48,7 @@ public class CodeStyleSettingsManager implements PersistentStateComponent<Elemen
|
||||
public volatile String PREFERRED_PROJECT_CODE_STYLE;
|
||||
private volatile CodeStyleSettings myTemporarySettings;
|
||||
|
||||
private final List<CodeStyleSettingsListener> myListeners = new ArrayList<>();
|
||||
private final List<CodeStyleSettingsListener> myListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
|
||||
public static CodeStyleSettingsManager getInstance(@Nullable Project project) {
|
||||
if (project == null || project.isDefault()) //noinspection deprecation
|
||||
|
||||
@@ -90,7 +90,7 @@ public class LookupImpl extends LightweightHint implements LookupEx, Disposable,
|
||||
final LookupCellRenderer myCellRenderer;
|
||||
|
||||
private final List<LookupListener> myListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
private final List<PrefixChangeListener> myPrefixChangeListeners = ContainerUtil.newSmartList();
|
||||
private final List<PrefixChangeListener> myPrefixChangeListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
private final LookupPreview myPreview = new LookupPreview(this);
|
||||
// keeping our own copy of editor's font preferences, which can be used in non-EDT threads (to avoid race conditions)
|
||||
private final FontPreferences myFontPreferences = new FontPreferencesImpl();
|
||||
|
||||
@@ -62,7 +62,7 @@ public class LivePreview implements SearchResults.SearchResultsListener, Selecti
|
||||
|
||||
private final Set<RangeHighlighter> myHighlighters = new HashSet<>();
|
||||
private RangeHighlighter myCursorHighlighter;
|
||||
private final List<VisibleAreaListener> myVisibleAreaListenersToRemove = new ArrayList<>();
|
||||
private final List<VisibleAreaListener> myVisibleAreaListenersToRemove = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
private Delegate myDelegate;
|
||||
private final SearchResults mySearchResults;
|
||||
private Balloon myReplacementBalloon;
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.intellij.ui.components.JBList;
|
||||
import com.intellij.ui.components.JBScrollPane;
|
||||
import com.intellij.ui.components.JBTextField;
|
||||
import com.intellij.ui.components.fields.ExtendableTextField;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.util.ui.components.BorderLayoutPanel;
|
||||
@@ -25,7 +26,6 @@ import javax.swing.event.ListDataEvent;
|
||||
import javax.swing.event.ListDataListener;
|
||||
import javax.swing.text.JTextComponent;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -35,9 +35,8 @@ public abstract class BigPopupUI extends BorderLayoutPanel implements Disposable
|
||||
protected JPanel suggestionsPanel;
|
||||
protected JBList<Object> myResultsList;
|
||||
protected JBPopup myHint;
|
||||
protected Runnable searchFinishedHandler = () -> {
|
||||
};
|
||||
protected final List<ViewTypeListener> myViewTypeListeners = new ArrayList<>();
|
||||
protected Runnable searchFinishedHandler = () -> { };
|
||||
protected final List<ViewTypeListener> myViewTypeListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
protected ViewType myViewType = ViewType.SHORT;
|
||||
protected JLabel myHintLabel;
|
||||
|
||||
|
||||
+4
-5
@@ -16,7 +16,7 @@
|
||||
package com.intellij.profile.codeInspection.ui.table;
|
||||
|
||||
import com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionsConfigTreeTable;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import com.intellij.util.ui.ThreeStateCheckBox;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -29,7 +29,6 @@ import javax.swing.table.TableCellRenderer;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ItemEvent;
|
||||
import java.awt.event.ItemListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EventObject;
|
||||
import java.util.List;
|
||||
|
||||
@@ -38,7 +37,7 @@ import java.util.List;
|
||||
*/
|
||||
public class ThreeStateCheckBoxRenderer extends ThreeStateCheckBox implements TableCellRenderer, TableCellEditor {
|
||||
|
||||
private final List<CellEditorListener> myListeners = new SmartList<>();
|
||||
private final List<CellEditorListener> myListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
|
||||
public ThreeStateCheckBoxRenderer() {
|
||||
setThirdStateEnabled(false);
|
||||
@@ -102,7 +101,7 @@ public class ThreeStateCheckBoxRenderer extends ThreeStateCheckBox implements Ta
|
||||
@Override
|
||||
public boolean stopCellEditing() {
|
||||
final ChangeEvent e = new ChangeEvent(this);
|
||||
for (final CellEditorListener listener : new ArrayList<>(myListeners)) {
|
||||
for (final CellEditorListener listener : myListeners) {
|
||||
listener.editingStopped(e);
|
||||
}
|
||||
return true;
|
||||
@@ -111,7 +110,7 @@ public class ThreeStateCheckBoxRenderer extends ThreeStateCheckBox implements Ta
|
||||
@Override
|
||||
public void cancelCellEditing() {
|
||||
final ChangeEvent e = new ChangeEvent(this);
|
||||
for (final CellEditorListener listener : new ArrayList<>(myListeners)) {
|
||||
for (final CellEditorListener listener : myListeners) {
|
||||
listener.editingCanceled(e);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -42,10 +42,10 @@ public class RefactoringTransactionImpl implements RefactoringTransaction {
|
||||
/**
|
||||
* Actions to be performed at commit.
|
||||
*/
|
||||
private final ArrayList<Runnable> myRunnables = new ArrayList<>();
|
||||
private final List<Runnable> myRunnables = new ArrayList<>();
|
||||
private final List<? extends RefactoringElementListenerProvider> myListenerProviders;
|
||||
private final Project myProject;
|
||||
private final Map<PsiElement,ArrayList<RefactoringElementListener>> myOldElementToListenerListMap = new HashMap<>();
|
||||
private final Map<PsiElement,List<RefactoringElementListener>> myOldElementToListenerListMap = new HashMap<>();
|
||||
private final Map<PsiElement,RefactoringElementListener> myOldElementToTransactionListenerMap = new HashMap<>();
|
||||
|
||||
public RefactoringTransactionImpl(Project project,
|
||||
@@ -56,7 +56,7 @@ public class RefactoringTransactionImpl implements RefactoringTransaction {
|
||||
|
||||
private void addAffectedElement(PsiElement oldElement) {
|
||||
if(myOldElementToListenerListMap.get(oldElement) != null) return;
|
||||
ArrayList<RefactoringElementListener> listenerList = new ArrayList<>();
|
||||
List<RefactoringElementListener> listenerList = new ArrayList<>();
|
||||
for (RefactoringElementListenerProvider provider : myListenerProviders) {
|
||||
try {
|
||||
final RefactoringElementListener listener = provider.getListener(oldElement);
|
||||
@@ -84,7 +84,7 @@ public class RefactoringTransactionImpl implements RefactoringTransaction {
|
||||
}
|
||||
|
||||
private class MyRefactoringElementListener implements RefactoringElementListener, UndoRefactoringElementListener {
|
||||
private final ArrayList<RefactoringElementListener> myListenerList;
|
||||
private final List<RefactoringElementListener> myListenerList;
|
||||
private MyRefactoringElementListener(PsiElement oldElement) {
|
||||
addAffectedElement(oldElement);
|
||||
myListenerList = myOldElementToListenerListMap.get(oldElement);
|
||||
|
||||
@@ -22,13 +22,13 @@ import com.intellij.ui.SimpleTextAttributes;
|
||||
import com.intellij.ui.UIBundle;
|
||||
import com.intellij.ui.components.JBViewport;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class StatusText {
|
||||
@@ -47,8 +47,8 @@ public abstract class StatusText {
|
||||
private String myText = "";
|
||||
@NotNull protected final SimpleColoredComponent myComponent = new SimpleColoredComponent();
|
||||
@NotNull private final SimpleColoredComponent mySecondaryComponent = new SimpleColoredComponent();
|
||||
private final List<ActionListener> myClickListeners = new ArrayList<>();
|
||||
private final List<ActionListener> mySecondaryListeners = new ArrayList<>();
|
||||
private final List<ActionListener> myClickListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
private final List<ActionListener> mySecondaryListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
private boolean myHasActiveClickListeners; // calculated field for performance optimization
|
||||
private boolean myShowAboveCenter = true;
|
||||
private boolean myVerticalFlow = true;
|
||||
|
||||
@@ -309,30 +309,26 @@ public class PluginInstaller {
|
||||
throw new IOException("Corrupted archive (no file entries): " + zip);
|
||||
}
|
||||
|
||||
private static List<PluginStateListener> myStateListeners;
|
||||
private static final List<PluginStateListener> myStateListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
|
||||
public static void addStateListener(@NotNull PluginStateListener listener) {
|
||||
(myStateListeners != null ? myStateListeners : (myStateListeners = new ArrayList<>())).add(listener);
|
||||
myStateListeners.add(listener);
|
||||
}
|
||||
|
||||
public static void removeStateListener(@NotNull PluginStateListener listener) {
|
||||
if (myStateListeners != null) {
|
||||
myStateListeners.remove(listener);
|
||||
}
|
||||
myStateListeners.remove(listener);
|
||||
}
|
||||
|
||||
private static void fireState(@NotNull IdeaPluginDescriptor descriptor, boolean install) {
|
||||
if (myStateListeners != null) {
|
||||
UIUtil.invokeLaterIfNeeded(() -> {
|
||||
for (PluginStateListener listener : myStateListeners) {
|
||||
if (install) {
|
||||
listener.install(descriptor);
|
||||
}
|
||||
else {
|
||||
listener.uninstall(descriptor);
|
||||
}
|
||||
UIUtil.invokeLaterIfNeeded(() -> {
|
||||
for (PluginStateListener listener : myStateListeners) {
|
||||
if (install) {
|
||||
listener.install(descriptor);
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
listener.uninstall(descriptor);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -12,16 +12,17 @@ import com.intellij.openapi.editor.ScrollingModel;
|
||||
import com.intellij.openapi.editor.event.VisibleAreaEvent;
|
||||
import com.intellij.openapi.editor.event.VisibleAreaListener;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SyncScrollSupport implements Disposable {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.diff.impl.util.SyncScrollSupport");
|
||||
private boolean myDuringVerticalScroll = false;
|
||||
@NotNull private final ArrayList<ScrollListener> myScrollers = new ArrayList<>();
|
||||
@NotNull private final List<ScrollListener> myScrollers = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
private boolean myEnabled = true;
|
||||
|
||||
public void install(EditingSides[] sideContainers) {
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.intellij.openapi.editor.impl.softwrap.mapping.SoftWrapAwareDocumentPa
|
||||
import com.intellij.openapi.util.Segment;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.util.DocumentUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
@@ -48,7 +49,7 @@ public class SoftWrapModelImpl extends InlayModel.SimpleAdapter
|
||||
|
||||
private static final Logger LOG = Logger.getInstance(SoftWrapModelImpl.class);
|
||||
|
||||
private final List<SoftWrapChangeListener> mySoftWrapListeners = new ArrayList<>();
|
||||
private final List<SoftWrapChangeListener> mySoftWrapListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
|
||||
/**
|
||||
* There is a possible case that particular activity performs batch fold regions operations (addition, removal etc).
|
||||
|
||||
+2
-2
@@ -23,6 +23,7 @@ import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.ui.EditorNotifications;
|
||||
import com.intellij.util.DocumentUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.intellij.lang.annotations.JdkConstants;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -30,7 +31,6 @@ import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -67,7 +67,7 @@ public class SoftWrapApplianceManager implements Dumpable {
|
||||
CUSTOM
|
||||
}
|
||||
|
||||
private final List<SoftWrapAwareDocumentParsingListener> myListeners = new ArrayList<>();
|
||||
private final List<SoftWrapAwareDocumentParsingListener> myListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
private final ProcessingContext myContext = new ProcessingContext();
|
||||
private final FontTypesStorage myOffset2fontType = new FontTypesStorage();
|
||||
private final WidthsStorage myOffset2widthInPixels = new WidthsStorage();
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.openapi.wm.IdeGlassPane;
|
||||
import com.intellij.openapi.wm.IdeGlassPaneUtil;
|
||||
import com.intellij.ui.BalloonImpl;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.FactoryMap;
|
||||
import com.intellij.util.ui.EmptyClipboardOwner;
|
||||
import com.intellij.util.ui.MouseEventAdapter;
|
||||
@@ -42,7 +43,7 @@ public class IdeGlassPaneImpl extends JPanel implements IdeGlassPaneEx, IdeEvent
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.wm.impl.IdeGlassPaneImpl");
|
||||
private static final String PREPROCESSED_CURSOR_KEY = "SuperCursor";
|
||||
|
||||
private final List<EventListener> myMouseListeners = new ArrayList<>();
|
||||
private final List<EventListener> myMouseListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
private final Set<EventListener> mySortedMouseListeners = new TreeSet<>((o1, o2) -> {
|
||||
double weight1 = 0;
|
||||
double weight2 = 0;
|
||||
|
||||
@@ -44,10 +44,8 @@ import java.awt.geom.RoundRectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.ImageFilter;
|
||||
import java.awt.image.RGBImageFilter;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
import static com.intellij.util.ui.UIUtil.useSafely;
|
||||
@@ -216,7 +214,7 @@ public class BalloonImpl implements Balloon, IdeTooltip.Ui {
|
||||
private int myShadowSize = Registry.intValue("ide.balloon.shadow.size");
|
||||
private ShadowBorderProvider myShadowBorderProvider;
|
||||
|
||||
private final CopyOnWriteArraySet<JBPopupListener> myListeners = new CopyOnWriteArraySet<>();
|
||||
private final Collection<JBPopupListener> myListeners = new CopyOnWriteArraySet<>();
|
||||
private boolean myVisible;
|
||||
private PositionTracker<Balloon> myTracker;
|
||||
private final int myAnimationCycle;
|
||||
|
||||
+3
-6
@@ -119,10 +119,8 @@ public abstract class TestConsoleProperties extends StoringPropertyContainer imp
|
||||
}
|
||||
|
||||
public <T> void addListener(@NotNull AbstractProperty<T> property, @NotNull TestFrameworkPropertyListener<T> listener) {
|
||||
List<TestFrameworkPropertyListener> listeners = myListeners.get(property);
|
||||
if (listeners == null) {
|
||||
myListeners.put(property, (listeners = ContainerUtil.newArrayList()));
|
||||
}
|
||||
List<TestFrameworkPropertyListener> listeners =
|
||||
myListeners.computeIfAbsent(property, __ -> ContainerUtil.createLockFreeCopyOnWriteList());
|
||||
listeners.add(listener);
|
||||
}
|
||||
|
||||
@@ -155,8 +153,7 @@ public abstract class TestConsoleProperties extends StoringPropertyContainer imp
|
||||
protected <T> void onPropertyChanged(@NotNull AbstractProperty<T> property, T value) {
|
||||
List<TestFrameworkPropertyListener> listeners = myListeners.get(property);
|
||||
if (listeners != null) {
|
||||
for (Object o : listeners.toArray()) {
|
||||
@SuppressWarnings("unchecked") TestFrameworkPropertyListener<T> listener = (TestFrameworkPropertyListener<T>)o;
|
||||
for (TestFrameworkPropertyListener<T> listener : listeners) {
|
||||
listener.onChanged(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
public abstract class AbstractVcsLogUi implements VcsLogUi, Disposable {
|
||||
@@ -64,7 +63,7 @@ public abstract class AbstractVcsLogUi implements VcsLogUi, Disposable {
|
||||
@NotNull protected final VcsLog myLog;
|
||||
@NotNull protected final VisiblePackRefresher myRefresher;
|
||||
|
||||
@NotNull protected final Collection<VcsLogListener> myLogListeners = ContainerUtil.newArrayList();
|
||||
@NotNull protected final Collection<VcsLogListener> myLogListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
@NotNull protected final VisiblePackChangeListener myVisiblePackChangeListener;
|
||||
|
||||
@NotNull protected VisiblePack myVisiblePack;
|
||||
@@ -262,9 +261,8 @@ public abstract class AbstractVcsLogUi implements VcsLogUi, Disposable {
|
||||
|
||||
protected void fireFilterChangeEvent(@NotNull VisiblePack visiblePack, boolean refresh) {
|
||||
ApplicationManager.getApplication().assertIsDispatchThread();
|
||||
Collection<VcsLogListener> logListeners = new ArrayList<>(myLogListeners);
|
||||
|
||||
for (VcsLogListener listener : logListeners) {
|
||||
for (VcsLogListener listener : myLogListeners) {
|
||||
listener.onChange(visiblePack, refresh);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public abstract class PythonProjectGenerator<T extends PyNewProjectSettings> ext
|
||||
public static final PyNewProjectSettings NO_SETTINGS = new PyNewProjectSettings();
|
||||
private static final Logger LOGGER = Logger.getInstance(PythonProjectGenerator.class);
|
||||
|
||||
private final List<SettingsListener> myListeners = ContainerUtil.newArrayList();
|
||||
private final List<SettingsListener> myListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
private final boolean myAllowRemoteProjectCreation;
|
||||
@Nullable private MouseListener myErrorLabelMouseListener;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
package com.jetbrains.python.refactoring.changeSignature;
|
||||
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.event.DocumentListener;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
@@ -30,8 +29,6 @@ import javax.swing.table.TableCellRenderer;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* User : ktisha
|
||||
@@ -134,7 +131,6 @@ public class PyParameterTableModel extends ParameterTableModelBase<PyParameterIn
|
||||
private final Project myProject;
|
||||
private final FileType myFileType;
|
||||
protected EditorTextField myEditorTextField;
|
||||
private final Set<DocumentListener> myListeners = new HashSet<>();
|
||||
|
||||
MyCodeFragmentTableCellEditor(Project project) {
|
||||
myProject = project;
|
||||
@@ -149,9 +145,6 @@ public class PyParameterTableModel extends ParameterTableModelBase<PyParameterIn
|
||||
JPanel panel = new JPanel();
|
||||
myEditorTextField = createEditorField(myDocument);
|
||||
if (myEditorTextField != null) {
|
||||
for (DocumentListener listener : myListeners) {
|
||||
myEditorTextField.addDocumentListener(listener);
|
||||
}
|
||||
myEditorTextField.setDocument(myDocument);
|
||||
myEditorTextField.setBorder(new LineBorder(table.getSelectionBackground()));
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.intellij.ui.UserActivityProviderComponent;
|
||||
import com.intellij.ui.components.JBCheckBox;
|
||||
import com.intellij.ui.components.JBComboBoxLabel;
|
||||
import com.intellij.ui.components.JBLabel;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import com.jetbrains.PySymbolFieldWithBrowseButton;
|
||||
import com.jetbrains.PySymbolFieldWithBrowseButtonKt;
|
||||
@@ -294,7 +295,7 @@ public class PythonRunConfigurationForm implements PythonRunConfigurationParams,
|
||||
}
|
||||
|
||||
private class MyComboBox extends JBComboBoxLabel implements UserActivityProviderComponent {
|
||||
private final List<ChangeListener> myListeners = Lists.newArrayList();
|
||||
private final List<ChangeListener> myListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
|
||||
MyComboBox() {
|
||||
this.addMouseListener(new MouseAdapter() {
|
||||
|
||||
Reference in New Issue
Block a user