本文整理汇总了Java中com.intellij.ui.tabs.TabInfo.getComponent方法的典型用法代码示例。如果您正苦于以下问题:Java TabInfo.getComponent方法的具体用法?Java TabInfo.getComponent怎么用?Java TabInfo.getComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.tabs.TabInfo
的用法示例。
在下文中一共展示了TabInfo.getComponent方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dragOutStarted
import com.intellij.ui.tabs.TabInfo; //导入方法依赖的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));
}
示例2: setSideTabsLimit
import com.intellij.ui.tabs.TabInfo; //导入方法依赖的package包/类
void setSideTabsLimit(int sideTabsLimit) {
if (mySideTabsLimit != sideTabsLimit) {
mySideTabsLimit = sideTabsLimit;
UIUtil.putClientProperty(myTabs, JBTabsImpl.SIDE_TABS_SIZE_LIMIT_KEY, mySideTabsLimit);
myTabs.resetLayout(true);
myTabs.doLayout();
myTabs.repaint();
TabInfo info = myTabs.getSelectedInfo();
JComponent page = info != null ? info.getComponent() : null;
if (page != null) {
page.revalidate();
page.repaint();
}
}
}
示例3: setSideTabsLimit
import com.intellij.ui.tabs.TabInfo; //导入方法依赖的package包/类
void setSideTabsLimit(int sideTabsLimit) {
if (mySideTabsLimit != sideTabsLimit) {
mySideTabsLimit = sideTabsLimit;
// UIUtil.putClientProperty(myTabs, JBTabsImpl.SIDE_TABS_SIZE_LIMIT_KEY, mySideTabsLimit);
myTabs.resetLayout(true);
myTabs.doLayout();
myTabs.repaint();
TabInfo info = myTabs.getSelectedInfo();
JComponent page = info != null ? info.getComponent() : null;
if (page != null) {
page.revalidate();
page.repaint();
}
}
}
示例4: computeSize
import com.intellij.ui.tabs.TabInfo; //导入方法依赖的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;
}
示例5: layoutSingleRow
import com.intellij.ui.tabs.TabInfo; //导入方法依赖的package包/类
public LayoutPassInfo layoutSingleRow(List<TabInfo> visibleInfos) {
SingleRowPassInfo data = new SingleRowPassInfo(this, visibleInfos);
final boolean layoutLabels = checkLayoutLabels(data);
if (!layoutLabels) {
data = myLastSingRowLayout;
}
final TabInfo selected = myTabs.getSelectedInfo();
prepareLayoutPassInfo(data, selected);
myTabs.resetLayout(layoutLabels || myTabs.isHideTabs());
if (layoutLabels && !myTabs.isHideTabs()) {
data.position = getStrategy().getStartPosition(data) - getScrollOffset();
recomputeToLayout(data);
layoutLabelsAndGhosts(data);
layoutMoreButton(data);
}
if (selected != null) {
data.comp = selected.getComponent();
getStrategy().layoutComp(data);
}
updateMoreIconVisibility(data);
data.tabRectangle = new Rectangle();
if (data.toLayout.size() > 0) {
final TabLabel firstLabel = myTabs.myInfo2Label.get(data.toLayout.get(0));
final TabLabel lastLabel = findLastVisibleLabel(data);
if (firstLabel != null && lastLabel != null) {
data.tabRectangle.x = firstLabel.getBounds().x;
data.tabRectangle.y = firstLabel.getBounds().y;
data.tabRectangle.width = (int)lastLabel.getBounds().getMaxX() - data.tabRectangle.x;
data.tabRectangle.height = (int)lastLabel.getBounds().getMaxY() - data.tabRectangle.y;
}
}
myLastSingRowLayout = data;
return data;
}
示例6: getGridFor
import com.intellij.ui.tabs.TabInfo; //导入方法依赖的package包/类
private static GridImpl getGridFor(TabInfo tab) {
return (GridImpl)tab.getComponent();
}
示例7: layoutSingleRow
import com.intellij.ui.tabs.TabInfo; //导入方法依赖的package包/类
public LayoutPassInfo layoutSingleRow(List<TabInfo> visibleInfos) {
if (JBEditorTabs.isAlphabeticalMode()) {
Collections.sort(visibleInfos, new Comparator<TabInfo>() {
@Override
public int compare(TabInfo o1, TabInfo o2) {
return StringUtil.naturalCompare(o1.getText(), o2.getText());
}
});
}
SingleRowPassInfo data = new SingleRowPassInfo(this, visibleInfos);
final boolean layoutLabels = checkLayoutLabels(data);
if (!layoutLabels) {
data = myLastSingRowLayout;
}
final TabInfo selected = myTabs.getSelectedInfo();
prepareLayoutPassInfo(data, selected);
myTabs.resetLayout(layoutLabels || myTabs.isHideTabs());
if (layoutLabels && !myTabs.isHideTabs()) {
data.position = getStrategy().getStartPosition(data) - getScrollOffset();
recomputeToLayout(data);
layoutLabelsAndGhosts(data);
layoutMoreButton(data);
}
if (selected != null) {
data.comp = selected.getComponent();
getStrategy().layoutComp(data);
}
updateMoreIconVisibility(data);
data.tabRectangle = new Rectangle();
if (data.toLayout.size() > 0) {
final TabLabel firstLabel = myTabs.myInfo2Label.get(data.toLayout.get(0));
final TabLabel lastLabel = findLastVisibleLabel(data);
if (firstLabel != null && lastLabel != null) {
data.tabRectangle.x = firstLabel.getBounds().x;
data.tabRectangle.y = firstLabel.getBounds().y;
data.tabRectangle.width = (int)lastLabel.getBounds().getMaxX() - data.tabRectangle.x;
data.tabRectangle.height = (int)lastLabel.getBounds().getMaxY() - data.tabRectangle.y;
}
}
myLastSingRowLayout = data;
return data;
}