本文整理汇总了Java中com.intellij.ui.tabs.impl.JBTabsImpl类的典型用法代码示例。如果您正苦于以下问题:Java JBTabsImpl类的具体用法?Java JBTabsImpl怎么用?Java JBTabsImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JBTabsImpl类属于com.intellij.ui.tabs.impl包,在下文中一共展示了JBTabsImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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));
}
示例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));
}
示例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));
}
示例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;
}
示例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);
}
示例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);
}
示例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();
}
示例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));
}
示例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);
}
}
}
示例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());
}
示例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);
}
}
示例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();
}
示例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);
}
}
}
示例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);
}