Vassiliy.Kudryashov
2016-06-06 15:33:13 +03:00
parent c1e9f34a41
commit 1566ddaadb
5 changed files with 30 additions and 2 deletions
@@ -794,6 +794,10 @@ public class JBTabsImpl extends JComponent
return addTab(info, -1);
}
public TabLabel getTabLabel(TabInfo info) {
return myInfo2Label.get(info);
}
@Nullable
public ActionGroup getPopupGroup() {
return myPopupGroup != null ? myPopupGroup.get() : null;
@@ -26,7 +26,6 @@ import com.intellij.openapi.options.ex.GlassPanel;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.popup.JBPopup;
import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.*;
import com.intellij.ui.components.JBList;
@@ -261,6 +260,16 @@ public class SearchUtil {
}
}
}
else if (rootComponent instanceof TabbedPaneWrapper.TabbedPaneHolder) {
final TabbedPaneWrapper tabbedPaneWrapper = ((TabbedPaneWrapper.TabbedPaneHolder)rootComponent).getTabbedPaneWrapper();
final String path = SearchableOptionsRegistrar.getInstance().getInnerPath(configurable, option);
if (path != null) {
final int index = getSelection(path, tabbedPaneWrapper);
if (index > -1 && index < tabbedPaneWrapper.getTabCount()) {
glassPanel.addSpotlight((JComponent)tabbedPaneWrapper.getTabComponentAt(index));
}
}
}
final Component[] components = rootComponent.getComponents();
@@ -144,6 +144,12 @@ public class JBTabsPaneImpl implements TabbedPane, SwingConstants {
myTabs.select(getTabAt(index), false);
}
@Override
public Component getTabComponentAt(int index) {
final TabInfo tabInfo = myTabs.getTabAt(index);
return myTabs.getTabLabel(tabInfo);
}
public void removeTabAt(int index) {
myTabs.removeTab(getTabAt(index));
}
@@ -53,6 +53,8 @@ public interface TabbedPane {
Component getComponentAt(int i);
Component getTabComponentAt(int index);
void setTitleAt(int index, String title);
void setToolTipTextAt(int index, String toolTipText);
@@ -228,6 +228,9 @@ public class TabbedPaneWrapper {
myTabbedPane.setForegroundAt(index,color);
}
public final Component getTabComponentAt(final int index) {
return myTabbedPane.getTabComponentAt(index);
}
/**
* @see javax.swing.JTabbedPane#setComponentAt(int, java.awt.Component)
*/
@@ -413,7 +416,7 @@ public class TabbedPaneWrapper {
}
}
protected static class TabbedPaneHolder extends JPanel {
public static class TabbedPaneHolder extends JPanel {
private final TabbedPaneWrapper myWrapper;
@@ -448,6 +451,10 @@ public class TabbedPaneWrapper {
myWrapper.myTabbedPane.updateUI();
}
}
public TabbedPaneWrapper getTabbedPaneWrapper() {
return myWrapper;
}
}
public static TabbedPaneWrapper get(JTabbedPane tabs) {