本文整理汇总了Java中com.intellij.ui.tabs.impl.JBTabsImpl类的典型用法代码示例。如果您正苦于以下问题:Java JBTabsImpl类的具体用法?Java JBTabsImpl怎么用?Java JBTabsImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JBTabsImpl类属于com.intellij.ui.tabs.impl包,在下文中一共展示了JBTabsImpl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initUi
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
private void initUi() {
myComponent = new JPanel();
myTreeTabs = new JBTabsImpl(null, null, this);
final Splitter splitter = new Splitter(true);
final JBTabsImpl bottom = new JBTabsImpl(null, null, this);
final AllocationPanel allocations = new AllocationPanel(myTreeTabs);
bottom.addTab(new TabInfo(allocations).setText("Allocation")).setActions(allocations.getActions(), ActionPlaces.UNKNOWN);
splitter.setFirstComponent(myTreeTabs);
splitter.setSecondComponent(bottom);
myComponent.setLayout(new BorderLayout());
myComponent.add(splitter, BorderLayout.CENTER);
JLabel countLabel = new JLabel("Total disposable count: " + Disposer.getTree().size());
myComponent.add(countLabel, BorderLayout.SOUTH);
addTree(new DisposerTree(this), "All", false);
addTree(new DisposerTree(this), "Watch", true);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:DisposerDebugger.java
示例2: dragOutStarted
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
@Override
public void dragOutStarted(MouseEvent mouseEvent, TabInfo info) {
final TabInfo previousSelection = info.getPreviousSelection();
final Image img = JBTabsImpl.getComponentImage(info);
info.setHidden(true);
if (previousSelection != null) {
myTabs.select(previousSelection, true);
}
myFile = (TerminalSessionVirtualFileImpl)info.getObject();
Presentation presentation = new Presentation(info.getText());
presentation.setIcon(info.getIcon());
mySession = getDockManager()
.createDragSession(mouseEvent, new EditorTabbedContainer.DockableEditor(myProject, img, myFile, presentation,
info.getComponent().getPreferredSize(), false));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:JBTabbedTerminalWidget.java
示例3: dragOutStarted
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
@Override
public void dragOutStarted(MouseEvent mouseEvent, TabInfo info) {
final JComponent component = info.getComponent();
final Content[] data = CONTENT_KEY.getData((DataProvider)component);
final List<Content> contents = Arrays.asList(data);
storeDefaultIndices(data);
final Dimension size = info.getComponent().getSize();
final Image image = JBTabsImpl.getComponentImage(info);
if (component instanceof Grid) {
info.setHidden(true);
}
Presentation presentation = new Presentation(info.getText());
presentation.setIcon(info.getIcon());
mySession = getDockManager().createDragSession(mouseEvent, new DockableGrid(image, presentation,
size,
contents, 0));
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:RunnerContentUi.java
示例4: dragOutStarted
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
@Override
public void dragOutStarted(MouseEvent mouseEvent, TabInfo info)
{
final TabInfo previousSelection = info.getPreviousSelection();
final Image img = JBTabsImpl.getComponentImage(info);
info.setHidden(true);
if(previousSelection != null)
{
myTabs.select(previousSelection, true);
}
myFile = (TerminalSessionVirtualFileImpl) info.getObject();
Presentation presentation = new Presentation(info.getText());
presentation.setIcon(info.getIcon());
mySession = getDockManager().createDragSession(mouseEvent, new EditorTabbedContainer.DockableEditor
(myProject, img, myFile, presentation, info.getComponent().getPreferredSize(), false));
}
开发者ID:consulo,项目名称:consulo-terminal,代码行数:18,代码来源:JBTabbedTerminalWidget.java
示例5: addHeaderSize
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
protected void addHeaderSize(JBTabsImpl tabs, Dimension size, final int tabsCount) {
Dimension header = computeHeaderPreferredSize(tabs, tabsCount);
final boolean horizontal = tabs.getTabsPosition() == JBTabsPosition.top || tabs.getTabsPosition() == JBTabsPosition.bottom;
if (horizontal) {
size.height += header.height;
size.width = Math.max(size.width, header.width);
}
else {
size.height += Math.max(size.height, header.height);
size.width += header.width;
}
final Insets insets = tabs.getLayoutInsets();
size.width += insets.left + insets.right + 1;
size.height += insets.top + insets.bottom + 1;
}
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:IntelliJEditorTabsUI.java
示例6: initUi
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
private void initUi() {
myComponent = new JPanel();
myTreeTabs = new JBEditorTabs(null, ActionManager.getInstance(), null, this);
final Splitter splitter = new Splitter(true);
final JBTabsImpl bottom = new JBEditorTabs(null, ActionManager.getInstance(), null, this);
final AllocationPanel allocations = new AllocationPanel(myTreeTabs);
bottom.addTab(new TabInfo(allocations).setText("Allocation")).setActions(allocations.getActions(), ActionPlaces.UNKNOWN);
splitter.setFirstComponent(myTreeTabs);
splitter.setSecondComponent(bottom);
myComponent.setLayout(new BorderLayout());
myComponent.add(splitter, BorderLayout.CENTER);
JLabel countLabel = new JLabel("Total disposable count: " + Disposer.getTree().size());
myComponent.add(countLabel, BorderLayout.SOUTH);
addTree(new DisposerTree(this), "All", false);
addTree(new DisposerTree(this), "Watch", true);
}
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:DisposerDebugger.java
示例7: getMoreRect
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
public Rectangle getMoreRect(final SingleRowPassInfo data) {
int x;
if (myTabs.isEditorTabs()) {
x = data.layoutSize.width - data.moreRectAxisSize - 1;
}
else {
x = data.position + (data.lastGhostVisible ? data.lastGhost.width : 0);
}
return new Rectangle(x, data.insets.top + JBTabsImpl.getSelectionTabVShift(),
data.moreRectAxisSize - 1, myTabs.myHeaderFitSize.height - 1);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:SingleRowLayoutStrategy.java
示例8: SingleRowPassInfo
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
public SingleRowPassInfo(SingleRowLayout layout, List<TabInfo> visibleInfos) {
super(visibleInfos);
JBTabsImpl tabs = layout.myTabs;
layoutSize = tabs.getSize();
contentCount = tabs.getTabCount();
toLayout = new ArrayList<TabInfo>();
toDrop = new ArrayList<TabInfo>();
moreRectAxisSize = layout.getStrategy().getMoreRectAxisSize();
scrollOffset = layout.getScrollOffset();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:SingleRowPassInfo.java
示例9: dragOutStarted
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
@Override
public void dragOutStarted(MouseEvent mouseEvent, TabInfo info) {
final TabInfo previousSelection = info.getPreviousSelection();
final Image img = JBTabsImpl.getComponentImage(info);
info.setHidden(true);
if (previousSelection != null) {
myTabs.select(previousSelection, true);
}
myFile = (VirtualFile)info.getObject();
Presentation presentation = new Presentation(info.getText());
presentation.setIcon(info.getIcon());
mySession = getDockManager().createDragSession(mouseEvent, createDockableEditor(myProject, img, myFile, presentation, myWindow));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:EditorTabbedContainer.java
示例10: paintBorder
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
@Override
public void paintBorder(@NotNull Component c, @NotNull Graphics g, int x, int y, int width, int height) {
if (UIUtil.isUnderAquaLookAndFeel()) {
g.setColor(JBTabsImpl.MAC_AQUA_BG_COLOR);
final Insets insets = getBorderInsets(c);
if (insets.top > 0) {
g.fillRect(x, y, width, height + insets.top);
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:FileEditorManagerImpl.java
示例11: add
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
@Override
public void add(@NotNull DockableContent content, RelativePoint dropTarget) {
EditorWindow window = null;
if (myCurrentOver != null) {
final DataProvider provider = myCurrentOver.getDataProvider();
if (provider != null) {
window = EditorWindow.DATA_KEY.getData(provider);
}
}
final EditorTabbedContainer.DockableEditor dockableEditor = (EditorTabbedContainer.DockableEditor)content;
VirtualFile file = dockableEditor.getFile();
if (window == null || window.isDisposed()) {
window = mySplitters.getOrCreateCurrentWindow(file);
}
if (myCurrentOver != null) {
int index = ((JBTabsImpl)myCurrentOver).getDropInfoIndex();
file.putUserData(EditorWindow.INITIAL_INDEX_KEY, index);
}
((FileEditorManagerImpl)FileEditorManagerEx.getInstanceEx(myProject)).openFileImpl2(window, file, true);
window.setFilePinned(file, dockableEditor.isPinned());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:DockableEditorTabbedContainer.java
示例12: actionPerformed
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
JBTabsImpl tabs = e.getData(JBTabsImpl.NAVIGATION_ACTIONS_KEY);
if (tabs != null) {
tabs.showMorePopup(null);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:TabListAction.java
示例13: isTabListAvailable
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
private static boolean isTabListAvailable(AnActionEvent e) {
JBTabsImpl tabs = e.getData(JBTabsImpl.NAVIGATION_ACTIONS_KEY);
if (tabs == null || !tabs.isEditorTabs()) {
return false;
}
return tabs.canShowMorePopup();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:TabListAction.java
示例14: paintBorder
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
if (UIUtil.isUnderAquaLookAndFeel()) {
g.setColor(JBTabsImpl.MAC_AQUA_BG_COLOR);
final Insets insets = getBorderInsets(c);
if (insets.top > 0) {
g.fillRect(x, y, width, height + insets.top);
}
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:FileEditorManagerImpl.java
示例15: JBTabsPaneImpl
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
public JBTabsPaneImpl(@Nullable Project project, int tabPlacement, @NotNull Disposable parent) {
myTabs = new JBTabsImpl(project, ActionManager.getInstance(), project == null ? null : IdeFocusManager.getInstance(project), parent);
myTabs.addListener(new TabsListener.Adapter() {
@Override
public void selectionChanged(TabInfo oldSelection, TabInfo newSelection) {
fireChanged(new ChangeEvent(myTabs));
}
}).getPresentation().setPaintBorder(1, 1, 1, 1).setTabSidePaintBorder(2).setPaintFocus(false).setGhostsAlwaysVisible(true);
setTabPlacement(tabPlacement);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:12,代码来源:JBTabsPaneImpl.java
示例16: SingleRowPassInfo
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
public SingleRowPassInfo(SingleRowLayout layout, List<TabInfo> visibleInfos) {
super(visibleInfos);
JBTabsImpl tabs = layout.myTabs;
layoutSize = tabs.getSize();
contentCount = tabs.getTabCount();
toLayout = new ArrayList<>();
toDrop = new ArrayList<>();
moreRectAxisSize = layout.getStrategy().getMoreRectAxisSize();
scrollOffset = layout.getScrollOffset();
}
开发者ID:JetBrains,项目名称:jediterm,代码行数:11,代码来源:SingleRowPassInfo.java
示例17: installUI
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
@Override
public void installUI(JComponent c) {
super.installUI(c);
JBTabsImpl tabs = (JBTabsImpl)c;
tabs.setBackground(getBackground());
tabs.setForeground(getForeground());
}
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:IntelliJEditorTabsUI.java
示例18: computeSize
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
protected Dimension computeSize(JBTabsImpl tabs, Function<JComponent, Dimension> transform, int tabCount) {
Dimension size = new Dimension();
for (TabInfo each : tabs.getVisibleInfos()) {
final JComponent c = each.getComponent();
if (c != null) {
final Dimension eachSize = transform.fun(c);
size.width = Math.max(eachSize.width, size.width);
size.height = Math.max(eachSize.height, size.height);
}
}
addHeaderSize(tabs, size, tabCount);
return size;
}
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:IntelliJEditorTabsUI.java
示例19: computeHeaderPreferredSize
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
protected Dimension computeHeaderPreferredSize(JBTabsImpl tabs, int tabsCount) {
final Iterator<TabInfo> infos = tabs.myInfo2Label.keySet().iterator();
Dimension size = new Dimension();
int currentTab = 0;
final boolean horizontal = tabs.getTabsPosition() == JBTabsPosition.top || tabs.getTabsPosition() == JBTabsPosition.bottom;
while (infos.hasNext()) {
final boolean canGrow = currentTab < tabsCount;
TabInfo eachInfo = infos.next();
final TabLabel eachLabel = tabs.myInfo2Label.get(eachInfo);
final Dimension eachPrefSize = eachLabel.getPreferredSize();
if (horizontal) {
if (canGrow) {
size.width += eachPrefSize.width;
}
size.height = Math.max(size.height, eachPrefSize.height);
}
else {
size.width = Math.max(size.width, eachPrefSize.width);
if (canGrow) {
size.height += eachPrefSize.height;
}
}
currentTab++;
}
if (horizontal) {
size.height += tabs.getTabsBorder().getTabBorderSize();
}
else {
size.width += tabs.getTabsBorder().getTabBorderSize();
}
return size;
}
开发者ID:consulo,项目名称:consulo,代码行数:40,代码来源:IntelliJEditorTabsUI.java
示例20: doPaintInactive
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入依赖的package包/类
protected void doPaintInactive(JBTabsImpl t,
Graphics2D g2d,
boolean leftGhostExists,
TabLabel label,
Rectangle effectiveBounds,
boolean rightGhostExists,
int row,
int column) {
Insets insets = t.getTabsBorder().getEffectiveBorder();
int _x = effectiveBounds.x + insets.left;
int _y = effectiveBounds.y + insets.top;
int _width = effectiveBounds.width - insets.left - insets.right + (t.getTabsPosition() == JBTabsPosition.right ? 1 : 0);
int _height = effectiveBounds.height - insets.top - insets.bottom;
if ((!t.isSingleRow() /* for multiline */) || (t.isSingleRow() && t.isHorizontalTabs())) {
if (t.isSingleRow() && t.getPosition() == JBTabsPosition.bottom) {
_y += t.getActiveTabUnderlineHeight();
}
else {
if (t.isSingleRow()) {
_height -= t.getActiveTabUnderlineHeight();
}
else {
TabInfo info = label.getInfo();
if (((TableLayout)t.getEffectiveLayout()).isLastRow(info)) {
_height -= t.getActiveTabUnderlineHeight();
}
}
}
}
final boolean vertical = t.getTabsPosition() == JBTabsPosition.left || t.getTabsPosition() == JBTabsPosition.right;
final Color tabColor = label.getInfo().getTabColor();
doPaintInactive(g2d, effectiveBounds, _x, _y, _width, _height, tabColor, row, column, vertical);
}
开发者ID:consulo,项目名称:consulo,代码行数:38,代码来源:IntelliJEditorTabsUI.java
注:本文中的com.intellij.ui.tabs.impl.JBTabsImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论