本文整理汇总了Java中com.intellij.ui.tabs.TabInfo类的典型用法代码示例。如果您正苦于以下问题:Java TabInfo类的具体用法?Java TabInfo怎么用?Java TabInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TabInfo类属于com.intellij.ui.tabs包,在下文中一共展示了TabInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: scroll
import com.intellij.ui.tabs.TabInfo; //导入依赖的package包/类
@Override
public void scroll(int units) {
myScrollOffset += units;
if (myLastSingRowLayout != null) {
int offset = -myScrollOffset;
for (TabInfo info : myLastSingRowLayout.myVisibleInfos) {
final int length = getRequiredLength(info);
if (info == myTabs.getSelectedInfo()) {
if (offset < 0) {
myScrollOffset+=offset;
}
else {
final int maxLength = myLastSingRowLayout.toFitLength - getStrategy().getMoreRectAxisSize();
if (offset + length > maxLength) {
myScrollOffset+=offset + length - maxLength;
}
}
break;
}
offset += length;
}
clampScrollOffsetToBounds(myLastSingRowLayout);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:ScrollableSingleRowLayout.java
示例2: doScrollSelectionInView
import com.intellij.ui.tabs.TabInfo; //导入依赖的package包/类
private void doScrollSelectionInView(SingleRowPassInfo passInfo) {
int offset = -myScrollOffset;
for (TabInfo info : passInfo.myVisibleInfos) {
final int length = getRequiredLength(info);
if (info == myTabs.getSelectedInfo()) {
if (offset < 0) {
scroll(offset);
}
else {
final int maxLength = passInfo.toFitLength - getStrategy().getMoreRectAxisSize();
if (offset + length > maxLength) {
scroll(offset + length - maxLength);
}
}
break;
}
offset += length;
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ScrollableSingleRowLayout.java
示例3: checkLayoutLabels
import com.intellij.ui.tabs.TabInfo; //导入依赖的package包/类
protected boolean checkLayoutLabels(SingleRowPassInfo data) {
boolean layoutLabels = true;
if (!myTabs.myForcedRelayout &&
myLastSingRowLayout != null &&
myLastSingRowLayout.contentCount == myTabs.getTabCount() &&
myLastSingRowLayout.layoutSize.equals(myTabs.getSize()) &&
myLastSingRowLayout.scrollOffset == getScrollOffset()) {
for (TabInfo each : data.myVisibleInfos) {
final TabLabel eachLabel = myTabs.myInfo2Label.get(each);
if (!eachLabel.isValid()) {
layoutLabels = true;
break;
}
if (myTabs.getSelectedInfo() == each) {
if (eachLabel.getBounds().width != 0) {
layoutLabels = false;
}
}
}
}
return layoutLabels;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:SingleRowLayout.java
示例4: processDrop
import com.intellij.ui.tabs.TabInfo; //导入依赖的package包/类
private void processDrop(final SingleRowPassInfo data, final TabInfo info, boolean isFirstSide) {
data.requiredLength -= getStrategy().getLengthIncrement(myTabs.myInfo2Label.get(info).getPreferredSize());
data.toDrop.add(info);
data.toLayout.remove(info);
if (data.toDrop.size() == 1) {
data.toFitLength -= data.moreRectAxisSize;
}
if (!data.firstGhostVisible && isFirstSide) {
data.firstGhostVisible = !myTabs.isEditorTabs();
if (!myTabs.isGhostsAlwaysVisible() && !myTabs.isEditorTabs()) {
data.toFitLength -= myTabs.getGhostTabLength();
}
}
else if (!data.lastGhostVisible && !isFirstSide) {
data.lastGhostVisible = !myTabs.isEditorTabs();
if (!myTabs.isGhostsAlwaysVisible() && !myTabs.isEditorTabs()) {
data.toFitLength -= myTabs.getGhostTabLength();
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:SingleRowLayout.java
示例5: processDropOver
import com.intellij.ui.tabs.TabInfo; //导入依赖的package包/类
@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;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:DockableEditorTabbedContainer.java
示例6: initUi
import com.intellij.ui.tabs.TabInfo; //导入依赖的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
示例7: processBounce
import com.intellij.ui.tabs.TabInfo; //导入依赖的package包/类
public void processBounce(Content content, final boolean activate) {
final GridImpl grid = getGridFor(content, false);
if (grid == null) return;
final GridCellImpl cell = grid.findCell(content);
if (cell == null) return;
final TabInfo tab = myTabs.findInfo(grid);
if (tab == null) return;
if (getSelectedGrid() != grid) {
tab.setAlertIcon(content.getAlertIcon());
if (activate) {
tab.fireAlert();
}
else {
tab.stopAlerting();
}
}
else {
grid.processAlert(content, activate);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:RunnerContentUi.java
示例8: updateTabsUI
import com.intellij.ui.tabs.TabInfo; //导入依赖的package包/类
private void updateTabsUI(final boolean validateNow) {
boolean hasToolbarContent = rebuildToolbar();
Set<String> usedNames = new HashSet<String>();
List<TabInfo> tabs = myTabs.getTabs();
for (TabInfo each : tabs) {
hasToolbarContent |= updateTabUI(each, usedNames);
}
int tabsCount = tabs.size();
for (RunnerContentUi child : myChildren) {
tabsCount += child.myTabs.getTabCount();
}
myTabs.getPresentation().setHideTabs(!hasToolbarContent && tabsCount <= 1 && myOriginal == null);
myTabs.updateTabActions(validateNow);
if (validateNow) {
myTabs.sortTabs(myTabsComparator);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:RunnerContentUi.java
示例9: restoreLastUiState
import com.intellij.ui.tabs.TabInfo; //导入依赖的package包/类
private ActionCallback restoreLastUiState() {
if (isStateBeingRestored()) return ActionCallback.REJECTED;
try {
setStateIsBeingRestored(true, this);
List<TabInfo> tabs = new ArrayList<TabInfo>();
tabs.addAll(myTabs.getTabs());
final ActionCallback result = new ActionCallback(tabs.size());
for (TabInfo each : tabs) {
getGridFor(each).restoreLastUiState().notifyWhenDone(result);
}
return result;
}
finally {
setStateIsBeingRestored(false, this);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:RunnerContentUi.java
示例10: select
import com.intellij.ui.tabs.TabInfo; //导入依赖的package包/类
@Override
public ActionCallback select(final Content content, final boolean requestFocus) {
final GridImpl grid = (GridImpl)findGridFor(content);
if (grid == null) return ActionCallback.DONE;
final TabInfo info = myTabs.findInfo(grid);
if (info == null) return ActionCallback.DONE;
final ActionCallback result = new ActionCallback();
myTabs.select(info, false).doWhenDone(new Runnable() {
@Override
public void run() {
grid.select(content, requestFocus).notifyWhenDone(result);
}
});
return result;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:RunnerContentUi.java
示例11: dragOutStarted
import com.intellij.ui.tabs.TabInfo; //导入依赖的package包/类
@Override
public void dragOutStarted(MouseEvent mouseEvent, TabInfo info) {
JComponent component = info.getComponent();
Content[] data = CONTENT_KEY.getData((DataProvider)component);
assert data != null;
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,
Arrays.asList(data), 0));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:RunnerContentUi.java
示例12: dragOutStarted
import com.intellij.ui.tabs.TabInfo; //导入依赖的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
示例13: processDrop
import com.intellij.ui.tabs.TabInfo; //导入依赖的package包/类
private void processDrop(final SingleRowPassInfo data, final TabInfo info, boolean isFirstSide) {
data.requiredLength -= getStrategy().getLengthIncrement(myTabs.myInfo2Label.get(info).getPreferredSize());
data.toDrop.add(info);
data.toLayout.remove(info);
if (data.toDrop.size() == 1) {
data.toFitLength -= data.moreRectAxisSize;
}
if (!data.firstGhostVisible && isFirstSide) {
data.firstGhostVisible = !myTabs.isEditorTabs();
if (!myTabs.isGhostsAlwaysVisible() && !myTabs.isEditorTabs()) {
data.toFitLength -= JBTabsImpl.getGhostTabLength();
}
}
else if (!data.lastGhostVisible && !isFirstSide) {
data.lastGhostVisible = !myTabs.isEditorTabs();
if (!myTabs.isGhostsAlwaysVisible() && !myTabs.isEditorTabs()) {
data.toFitLength -= JBTabsImpl.getGhostTabLength();
}
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:SingleRowLayout.java
示例14: createTabInfoFor
import com.intellij.ui.tabs.TabInfo; //导入依赖的package包/类
private TabInfo createTabInfoFor(Content content) {
final JComponent c = content.getComponent();
final TabInfo tabInfo = updatePresentation(new TabInfo(new ProviderWrapper(content, myContext)), content)
.setObject(content)
.setPreferredFocusableComponent(content.getPreferredFocusableComponent())
.setActionsContextComponent(content.getActionsContextComponent());
myContents.remove(content);
myContents.put(content, tabInfo);
ActionGroup group = (ActionGroup)myContext.getActionManager().getAction(RunnerContentUi.VIEW_TOOLBAR);
tabInfo.setTabLabelActions(group, ViewContext.CELL_TOOLBAR_PLACE);
tabInfo.setDragOutDelegate(((RunnerContentUi)myContext).myDragOutDelegate);
return tabInfo;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:GridCellImpl.java
示例15: restoreLastUiState
import com.intellij.ui.tabs.TabInfo; //导入依赖的package包/类
private ActionCallback restoreLastUiState() {
if (isStateBeingRestored()) return new ActionCallback.Rejected();
try {
setStateIsBeingRestored(true, this);
List<TabInfo> tabs = new ArrayList<TabInfo>();
tabs.addAll(myTabs.getTabs());
final ActionCallback result = new ActionCallback(tabs.size());
for (TabInfo each : tabs) {
getGridFor(each).restoreLastUiState().notifyWhenDone(result);
}
return result;
}
finally {
setStateIsBeingRestored(false, this);
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:RunnerContentUi.java
示例16: select
import com.intellij.ui.tabs.TabInfo; //导入依赖的package包/类
@Override
public ActionCallback select(final Content content, final boolean requestFocus) {
final GridImpl grid = (GridImpl)findGridFor(content);
if (grid == null) return new ActionCallback.Done();
final TabInfo info = myTabs.findInfo(grid);
if (info == null) return new ActionCallback.Done();
final ActionCallback result = new ActionCallback();
myTabs.select(info, false).doWhenDone(new Runnable() {
@Override
public void run() {
grid.select(content, requestFocus).notifyWhenDone(result);
}
});
return result;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:RunnerContentUi.java
示例17: validate
import com.intellij.ui.tabs.TabInfo; //导入依赖的package包/类
@Override
public void validate(final Content content, final ActiveRunnable toRestore) {
final TabInfo current = myTabs.getSelectedInfo();
myTabs.getPresentation().setPaintBlocked(true, true);
select(content, false).doWhenDone(new Runnable() {
@Override
public void run() {
myTabs.getComponent().validate();
toRestore.run().doWhenDone(new Runnable() {
@Override
public void run() {
myTabs.select(current, true);
myTabs.getPresentation().setPaintBlocked(false, true);
}
});
}
});
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:RunnerContentUi.java
示例18: 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
示例19: scroll
import com.intellij.ui.tabs.TabInfo; //导入依赖的package包/类
@Override
public void scroll(int units) {
myScrollOffset += units;
if (myLastSingRowLayout == null) return;
int offset = -myScrollOffset;
for (TabInfo info : myLastSingRowLayout.myVisibleInfos) {
final int length = getRequiredLength(info);
if (info == myTabs.getSelectedInfo()) {
int maxLength = myLastSingRowLayout.toFitLength - getStrategy().getMoreRectAxisSize();
if (offset < 0 && length < maxLength) {
myScrollOffset += offset;
}
else if (offset + length > maxLength) {
myScrollOffset += offset + length - maxLength;
}
break;
}
offset += length;
}
clampScrollOffsetToBounds(myLastSingRowLayout);
}
开发者ID:JetBrains,项目名称:jediterm,代码行数:22,代码来源:ScrollableSingleRowLayout.java
示例20: restoreLastUiState
import com.intellij.ui.tabs.TabInfo; //导入依赖的package包/类
private ActionCallback restoreLastUiState() {
if (isStateBeingRestored()) return ActionCallback.REJECTED;
try {
setStateIsBeingRestored(true, this);
List<TabInfo> tabs = new ArrayList<>();
tabs.addAll(myTabs.getTabs());
final ActionCallback result = new ActionCallback(tabs.size());
for (TabInfo each : tabs) {
getGridFor(each).restoreLastUiState().notifyWhenDone(result);
}
return result;
}
finally {
setStateIsBeingRestored(false, this);
}
}
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:RunnerContentUi.java
注:本文中的com.intellij.ui.tabs.TabInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论