use of com.intellij.ui.tabs.JBTabs in project intellij-community by JetBrains.
the class RunnerContentUi method processDropOver.
@Override
public Image processDropOver(@NotNull DockableContent dockable, RelativePoint dropTarget) {
JBTabs current = getTabsAt(dockable, dropTarget);
if (myCurrentOver != null && myCurrentOver != current) {
resetDropOver(dockable);
}
if (myCurrentOver == null && current != null) {
myCurrentOver = current;
Presentation presentation = dockable.getPresentation();
myCurrentOverInfo = new TabInfo(new JLabel("")).setText(presentation.getText()).setIcon(presentation.getIcon());
myCurrentOverImg = myCurrentOver.startDropOver(myCurrentOverInfo, dropTarget);
}
if (myCurrentOver != null) {
myCurrentOver.processDropOver(myCurrentOverInfo, dropTarget);
}
if (myCurrentPainter == null) {
myCurrentPainter = new MyDropAreaPainter();
IdeGlassPaneUtil.find(myComponent).addPainter(myComponent, myCurrentPainter, this);
}
myCurrentPainter.processDropOver(this, dockable, dropTarget);
return myCurrentOverImg;
}
use of com.intellij.ui.tabs.JBTabs in project intellij-community by JetBrains.
the class EditorsSplitters method getOrderedWindows.
@NotNull
EditorWindow[] getOrderedWindows() {
final List<EditorWindow> res = new ArrayList<>();
// Collector for windows in tree ordering:
class Inner {
private void collect(final JPanel panel) {
final Component comp = panel.getComponent(0);
if (comp instanceof Splitter) {
final Splitter splitter = (Splitter) comp;
collect((JPanel) splitter.getFirstComponent());
collect((JPanel) splitter.getSecondComponent());
} else if (comp instanceof JPanel || comp instanceof JBTabs) {
final EditorWindow window = findWindowWith(comp);
if (window != null) {
res.add(window);
}
}
}
}
// get root component and traverse splitters tree:
if (getComponentCount() != 0) {
final Component comp = getComponent(0);
LOG.assertTrue(comp instanceof JPanel);
final JPanel panel = (JPanel) comp;
if (panel.getComponentCount() != 0) {
new Inner().collect(panel);
}
}
LOG.assertTrue(res.size() == myWindows.size());
return res.toArray(new EditorWindow[res.size()]);
}
Aggregations