Search in sources :

Example 6 with JBTabs

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;
}
Also used : JBTabs(com.intellij.ui.tabs.JBTabs) TabInfo(com.intellij.ui.tabs.TabInfo)

Example 7 with JBTabs

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()]);
}
Also used : Splitter(com.intellij.openapi.ui.Splitter) OnePixelSplitter(com.intellij.ui.OnePixelSplitter) JBTabs(com.intellij.ui.tabs.JBTabs) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

JBTabs (com.intellij.ui.tabs.JBTabs)7 TabInfo (com.intellij.ui.tabs.TabInfo)3 Splitter (com.intellij.openapi.ui.Splitter)2 OnePixelSplitter (com.intellij.ui.OnePixelSplitter)2 RelativePoint (com.intellij.ui.awt.RelativePoint)2 Nullable (org.jetbrains.annotations.Nullable)2 BuckSettingsProvider (com.facebook.buck.intellij.ideabuck.config.BuckSettingsProvider)1 RunnerLayoutUi (com.intellij.execution.ui.RunnerLayoutUi)1 Presentation (com.intellij.openapi.actionSystem.Presentation)1 Content (com.intellij.ui.content.Content)1 ContentManager (com.intellij.ui.content.ContentManager)1 JBTabsImpl (com.intellij.ui.tabs.impl.JBTabsImpl)1 Element (org.jdom.Element)1 NotNull (org.jetbrains.annotations.NotNull)1