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;
}
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;
}
}
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;
}
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);
}
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;
}
Aggregations