Search in sources :

Example 1 with JBTabs

use of com.intellij.ui.tabs.JBTabs in project intellij-community by JetBrains.

the class DockableEditorTabbedContainer method processDropOver.

@Override
public Image processDropOver(@NotNull DockableContent content, RelativePoint point) {
    JBTabs current = getTabsAt(content, point);
    if (myCurrentOver != null && myCurrentOver != current) {
        resetDropOver(content);
    }
    if (myCurrentOver == null && current != null) {
        myCurrentOver = current;
        Presentation presentation = content.getPresentation();
        myCurrentOverInfo = new TabInfo(new JLabel("")).setText(presentation.getText()).setIcon(presentation.getIcon());
        myCurrentOverImg = myCurrentOver.startDropOver(myCurrentOverInfo, point);
    }
    if (myCurrentOver != null) {
        myCurrentOver.processDropOver(myCurrentOverInfo, point);
    }
    return myCurrentOverImg;
}
Also used : JBTabs(com.intellij.ui.tabs.JBTabs) TabInfo(com.intellij.ui.tabs.TabInfo) Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 2 with JBTabs

use of com.intellij.ui.tabs.JBTabs in project intellij-community by JetBrains.

the class EditorsSplitters method writePanel.

@SuppressWarnings("HardCodedStringLiteral")
private Element writePanel(@NotNull Component comp) {
    if (comp instanceof Splitter) {
        final Splitter splitter = (Splitter) comp;
        final Element res = new Element("splitter");
        res.setAttribute("split-orientation", splitter.getOrientation() ? "vertical" : "horizontal");
        res.setAttribute("split-proportion", Float.toString(splitter.getProportion()));
        final Element first = new Element("split-first");
        first.addContent(writePanel(splitter.getFirstComponent().getComponent(0)));
        final Element second = new Element("split-second");
        second.addContent(writePanel(splitter.getSecondComponent().getComponent(0)));
        res.addContent(first);
        res.addContent(second);
        return res;
    } else if (comp instanceof JBTabs) {
        final Element res = new Element("leaf");
        Integer limit = UIUtil.getClientProperty(((JBTabs) comp).getComponent(), JBTabsImpl.SIDE_TABS_SIZE_LIMIT_KEY);
        if (limit != null) {
            res.setAttribute(JBTabsImpl.SIDE_TABS_SIZE_LIMIT_KEY.toString(), String.valueOf(limit));
        }
        writeWindow(res, findWindowWith(comp));
        return res;
    } else if (comp instanceof EditorWindow.TCompForTablessMode) {
        EditorWithProviderComposite composite = ((EditorWindow.TCompForTablessMode) comp).myEditor;
        Element res = new Element("leaf");
        res.addContent(writeComposite(composite.getFile(), composite, false, composite));
        return res;
    } else {
        LOG.error(comp.getClass().getName());
        return null;
    }
}
Also used : Splitter(com.intellij.openapi.ui.Splitter) OnePixelSplitter(com.intellij.ui.OnePixelSplitter) JBTabs(com.intellij.ui.tabs.JBTabs) Element(org.jdom.Element)

Example 3 with JBTabs

use of com.intellij.ui.tabs.JBTabs in project intellij-community by JetBrains.

the class EditorsSplitters method getTabsAt.

@Nullable
JBTabs getTabsAt(RelativePoint point) {
    Point thisPoint = point.getPoint(this);
    Component c = SwingUtilities.getDeepestComponentAt(this, thisPoint.x, thisPoint.y);
    while (c != null) {
        if (c instanceof JBTabs) {
            return (JBTabs) c;
        }
        c = c.getParent();
    }
    return null;
}
Also used : JBTabs(com.intellij.ui.tabs.JBTabs) RelativePoint(com.intellij.ui.awt.RelativePoint) Nullable(org.jetbrains.annotations.Nullable)

Example 4 with JBTabs

use of com.intellij.ui.tabs.JBTabs in project buck by facebook.

the class BuckToolWindowFactory method createToolWindowContent.

@Override
public void createToolWindowContent(final Project project, ToolWindow toolWindow) {
    toolWindow.setAvailable(true, null);
    toolWindow.setToHideOnEmptyContent(true);
    toolWindow.setIcon(BuckIcons.BUCK_TOOL_WINDOW_ICON);
    RunnerLayoutUi runnerLayoutUi = BuckUIManager.getInstance(project).getLayoutUi(project);
    BuckSettingsProvider.State state = BuckSettingsProvider.getInstance().getState();
    JBTabs myTabs = new JBTabsImpl(project);
    // Debug Console
    if (state.showDebug) {
        Content consoleContent = createConsoleContent(runnerLayoutUi, project);
        myTabs.addTab(new TabInfo(consoleContent.getComponent())).setText("Debug");
    }
    // Build Tree Events
    Content treeViewContent = runnerLayoutUi.createContent(BUILD_OUTPUT_PANEL, createBuildInfoPanel(project), "Build Output", null, null);
    myTabs.addTab(new TabInfo(treeViewContent.getComponent()).setText("Build"));
    Content tabsContent = runnerLayoutUi.createContent(TABS_CONTENT_ID, myTabs.getComponent(), "Buck Tool Tabs", null, null);
    runnerLayoutUi.addContent(tabsContent, 0, PlaceInGrid.center, false);
    runnerLayoutUi.getOptions().setLeftToolbar(getLeftToolbarActions(project), ActionPlaces.UNKNOWN);
    runnerLayoutUi.updateActionsNow();
    final ContentManager contentManager = toolWindow.getContentManager();
    Content content = contentManager.getFactory().createContent(runnerLayoutUi.getComponent(), "", true);
    contentManager.addContent(content);
    updateBuckToolWindowTitle(project);
}
Also used : RunnerLayoutUi(com.intellij.execution.ui.RunnerLayoutUi) JBTabs(com.intellij.ui.tabs.JBTabs) JBTabsImpl(com.intellij.ui.tabs.impl.JBTabsImpl) Content(com.intellij.ui.content.Content) ContentManager(com.intellij.ui.content.ContentManager) BuckSettingsProvider(com.facebook.buck.intellij.ideabuck.config.BuckSettingsProvider) TabInfo(com.intellij.ui.tabs.TabInfo)

Example 5 with JBTabs

use of com.intellij.ui.tabs.JBTabs in project intellij-community by JetBrains.

the class RunnerContentUi method getTabsAt.

@Nullable
private JBTabs getTabsAt(DockableContent content, RelativePoint point) {
    if (content instanceof DockableGrid) {
        final Point p = point.getPoint(getComponent());
        Component c = SwingUtilities.getDeepestComponentAt(getComponent(), p.x, p.y);
        while (c != null) {
            if (c instanceof JBRunnerTabs) {
                return (JBTabs) c;
            }
            c = c.getParent();
        }
    }
    return null;
}
Also used : JBTabs(com.intellij.ui.tabs.JBTabs) RelativePoint(com.intellij.ui.awt.RelativePoint) Nullable(org.jetbrains.annotations.Nullable)

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