当前位置: 首页>>代码示例>>Java>>正文


Java TabInfo.getComponent方法代码示例

本文整理汇总了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));
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:RunnerContentUi.java

示例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();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:TabsSideSplitter.java

示例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();
      }
    }
  }
 
开发者ID:JetBrains,项目名称:jediterm,代码行数:16,代码来源:TabsSideSplitter.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:IntelliJEditorTabsUI.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:47,代码来源:SingleRowLayout.java

示例6: getGridFor

import com.intellij.ui.tabs.TabInfo; //导入方法依赖的package包/类
private static GridImpl getGridFor(TabInfo tab) {
  return (GridImpl)tab.getComponent();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:RunnerContentUi.java

示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:56,代码来源:SingleRowLayout.java


注:本文中的com.intellij.ui.tabs.TabInfo.getComponent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。