mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ui: remove SwitchManager API - QuickAccessProvider
* QuickAccessProvider - used in 'Cursive' plugin
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.intellij.openapi.actionSystem;
|
||||
|
||||
import com.intellij.ui.switcher.QuickAccessProvider;
|
||||
import com.intellij.ui.switcher.QuickActionProvider;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -28,7 +27,7 @@ import java.awt.*;
|
||||
*
|
||||
* @see ActionManager#createActionToolbar(String, ActionGroup, boolean)
|
||||
*/
|
||||
public interface ActionToolbar extends QuickAccessProvider, QuickActionProvider {
|
||||
public interface ActionToolbar extends QuickActionProvider {
|
||||
String ACTION_TOOLBAR_PROPERTY_KEY = "ACTION_TOOLBAR";
|
||||
|
||||
/**
|
||||
@@ -55,7 +54,6 @@ public interface ActionToolbar extends QuickAccessProvider, QuickActionProvider
|
||||
/**
|
||||
* @return component which represents the tool bar on UI
|
||||
*/
|
||||
@Override
|
||||
JComponent getComponent();
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,6 +17,7 @@ package com.intellij.ui.switcher;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@Deprecated
|
||||
public interface QuickAccessProvider {
|
||||
|
||||
JComponent getComponent();
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.intellij.openapi.actionSystem.DataKey;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface QuickActionProvider extends QuickAccessProvider {
|
||||
public interface QuickActionProvider {
|
||||
|
||||
DataKey<QuickActionProvider> KEY = DataKey.create("QuickActionProvider");
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ import com.intellij.ui.docking.DockManager;
|
||||
import com.intellij.ui.docking.DockableContent;
|
||||
import com.intellij.ui.docking.DragSession;
|
||||
import com.intellij.ui.docking.impl.DockManagerImpl;
|
||||
import com.intellij.ui.switcher.QuickAccessProvider;
|
||||
import com.intellij.ui.switcher.QuickActionProvider;
|
||||
import com.intellij.ui.tabs.JBTabs;
|
||||
import com.intellij.ui.tabs.TabInfo;
|
||||
@@ -78,7 +77,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class RunnerContentUi implements ContentUI, Disposable, CellTransform.Facade, ViewContextEx, PropertyChangeListener,
|
||||
QuickAccessProvider, QuickActionProvider, DockContainer.Dialog {
|
||||
QuickActionProvider, DockContainer.Dialog {
|
||||
public static final DataKey<RunnerContentUi> KEY = DataKey.create("DebuggerContentUI");
|
||||
public static final Key<Boolean> LIGHTWEIGHT_CONTENT_MARKER = Key.create("LightweightContent");
|
||||
|
||||
@@ -621,11 +620,6 @@ public class RunnerContentUi implements ContentUI, Disposable, CellTransform.Fac
|
||||
return myOriginal != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCycleRoot() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setManager(@NotNull final ContentManager manager) {
|
||||
assert myManager == null;
|
||||
@@ -1406,16 +1400,6 @@ public class RunnerContentUi implements ContentUI, Disposable, CellTransform.Fac
|
||||
return RunnerContentUi.this.getActions(originalProvider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getComponent() {
|
||||
return RunnerContentUi.this.getComponent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCycleRoot() {
|
||||
return RunnerContentUi.this.isCycleRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addNotify() {
|
||||
super.addNotify();
|
||||
|
||||
@@ -338,11 +338,6 @@ public class ProjectViewImpl extends ProjectView implements PersistentStateCompo
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCycleRoot() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void addProjectPane(@NotNull final AbstractProjectViewPane pane) {
|
||||
myUninitializedPanes.add(pane);
|
||||
@@ -771,7 +766,6 @@ public class ProjectViewImpl extends ProjectView implements PersistentStateCompo
|
||||
myConnection.disconnect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getComponent() {
|
||||
return myDataProvider;
|
||||
}
|
||||
|
||||
@@ -116,10 +116,6 @@ public class SimpleToolWindowPanel extends JPanel implements QuickActionProvider
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isCycleRoot() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setContent(JComponent c) {
|
||||
myContent = c;
|
||||
add(c, BorderLayout.CENTER);
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.intellij.openapi.actionSystem.DataProvider;
|
||||
import com.intellij.openapi.util.ActionCallback;
|
||||
import com.intellij.openapi.util.ActiveRunnable;
|
||||
import com.intellij.ui.awt.RelativePoint;
|
||||
import com.intellij.ui.switcher.QuickAccessProvider;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -29,7 +28,7 @@ import java.awt.*;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
|
||||
public interface JBTabs extends QuickAccessProvider {
|
||||
public interface JBTabs {
|
||||
|
||||
@NotNull
|
||||
TabInfo addTab(TabInfo info, int index);
|
||||
@@ -72,7 +71,6 @@ public interface JBTabs extends QuickAccessProvider {
|
||||
|
||||
JBTabs setSelectionChangeHandler(SelectionChangeHandler handler);
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
JComponent getComponent();
|
||||
|
||||
|
||||
@@ -2688,11 +2688,6 @@ public class JBTabsImpl extends JComponent
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCycleRoot() {
|
||||
return false;
|
||||
}
|
||||
|
||||
private void addListeners() {
|
||||
for (TabInfo eachInfo : myVisibleInfos) {
|
||||
final TabLabel label = myInfo2Label.get(eachInfo);
|
||||
|
||||
-5
@@ -1227,11 +1227,6 @@ public class ActionToolbarImpl extends JPanel implements ActionToolbar {
|
||||
mySecondaryActions.getTemplatePresentation().setDescription(secondaryActionsTooltip);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCycleRoot() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AnAction> getActions(boolean originalProvider) {
|
||||
ArrayList<AnAction> result = new ArrayList<>();
|
||||
|
||||
+1
-6
@@ -36,7 +36,6 @@ import com.intellij.ui.PopupHandler;
|
||||
import com.intellij.ui.content.*;
|
||||
import com.intellij.ui.content.tabs.PinToolwindowTabAction;
|
||||
import com.intellij.ui.content.tabs.TabbedContentAction;
|
||||
import com.intellij.ui.switcher.QuickAccessProvider;
|
||||
import com.intellij.util.Alarm;
|
||||
import com.intellij.util.ContentUtilEx;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -56,7 +55,7 @@ import java.beans.PropertyChangeListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ToolWindowContentUi extends JPanel implements ContentUI, PropertyChangeListener, DataProvider, QuickAccessProvider {
|
||||
public class ToolWindowContentUi extends JPanel implements ContentUI, PropertyChangeListener, DataProvider {
|
||||
public static final String POPUP_PLACE = "ToolwindowPopup";
|
||||
// when client property is put in toolwindow component, hides toolwindow label
|
||||
public static final String HIDE_ID_LABEL = "HideIdLabel";
|
||||
@@ -113,10 +112,6 @@ public class ToolWindowContentUi extends JPanel implements ContentUI, PropertyCh
|
||||
return myContent;
|
||||
}
|
||||
|
||||
public boolean isCycleRoot() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public JComponent getTabComponent() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy;
|
||||
import com.intellij.ui.components.panels.NonOpaquePanel;
|
||||
import com.intellij.ui.content.*;
|
||||
import com.intellij.ui.switcher.QuickAccessProvider;
|
||||
import com.intellij.util.EventDispatcher;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
@@ -95,7 +94,7 @@ public class ContentManagerImpl implements ContentManager, PropertyChangeListene
|
||||
if (myComponent == null) {
|
||||
myComponent = new MyNonOpaquePanel();
|
||||
|
||||
MyContentComponent contentComponent = new MyContentComponent();
|
||||
NonOpaquePanel contentComponent = new NonOpaquePanel();
|
||||
contentComponent.setContent(myUI.getComponent());
|
||||
contentComponent.setFocusCycleRoot(true);
|
||||
|
||||
@@ -141,18 +140,6 @@ public class ContentManagerImpl implements ContentManager, PropertyChangeListene
|
||||
}
|
||||
}
|
||||
|
||||
private class MyContentComponent extends NonOpaquePanel implements QuickAccessProvider {
|
||||
@Override
|
||||
public JComponent getComponent() {
|
||||
return myUI instanceof QuickAccessProvider ? myUI.getComponent() : this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCycleRoot() {
|
||||
return myUI instanceof QuickAccessProvider && ((QuickAccessProvider)myUI).isCycleRoot();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addContent(@NotNull Content content, final int order) {
|
||||
doAddContent(content, order);
|
||||
|
||||
Reference in New Issue
Block a user