本文整理汇总了Java中com.intellij.ui.switcher.SwitchTarget类的典型用法代码示例。如果您正苦于以下问题:Java SwitchTarget类的具体用法?Java SwitchTarget怎么用?Java SwitchTarget使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SwitchTarget类属于com.intellij.ui.switcher包,在下文中一共展示了SwitchTarget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTargets
import com.intellij.ui.switcher.SwitchTarget; //导入依赖的package包/类
@Override
public List<SwitchTarget> getTargets(boolean onlyVisible, boolean originalProvider) {
ArrayList<SwitchTarget> result = new ArrayList<SwitchTarget>();
for (TabInfo each : myVisibleInfos) {
result.add(new TabTarget(each));
}
if (originalProvider && mySwitchDelegate != null) {
List<SwitchTarget> additional = mySwitchDelegate.getTargets(onlyVisible, false);
if (additional != null) {
result.addAll(additional);
}
}
return result;
}
示例2: getTargets
import com.intellij.ui.switcher.SwitchTarget; //导入依赖的package包/类
@Override
public List<SwitchTarget> getTargets(final boolean onlyVisible, boolean originalProvider) {
final ArrayList<SwitchTarget> result = new ArrayList<SwitchTarget>();
TabInfo selected = myTabs.getSelectedInfo();
new AwtVisitor(selected.getComponent()) {
@Override
public boolean visit(Component component) {
if (component instanceof JBTabs) {
JBTabs tabs = (JBTabs)component;
if (tabs != myTabs) {
result.addAll(tabs.getTargets(onlyVisible, false));
return true;
}
}
return false;
}
};
return result;
}
示例3: getCurrentTarget
import com.intellij.ui.switcher.SwitchTarget; //导入依赖的package包/类
@Override
public SwitchTarget getCurrentTarget() {
TabInfo selected = myTabs.getSelectedInfo();
final Ref<SwitchTarget> targetRef = new Ref<SwitchTarget>();
new AwtVisitor(selected.getComponent()) {
@Override
public boolean visit(Component component) {
if (component instanceof JBTabs) {
JBTabs tabs = (JBTabs)component;
if (tabs != myTabs) {
targetRef.set(tabs.getCurrentTarget());
return true;
}
}
return false;
}
};
return targetRef.get();
}
示例4: getCurrentTarget
import com.intellij.ui.switcher.SwitchTarget; //导入依赖的package包/类
@Override
public SwitchTarget getCurrentTarget() {
Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
if (owner == null) return myTabs.getCurrentTarget();
GridImpl grid = getSelectedGrid();
if (grid != null && grid.getContents().size() <= 1) return myTabs.getCurrentTarget();
if (grid != null) {
SwitchTarget cell = grid.getCellFor(owner);
return cell != null ? cell : myTabs.getCurrentTarget();
}
else {
return myTabs.getCurrentTarget();
}
}
示例5: getTargets
import com.intellij.ui.switcher.SwitchTarget; //导入依赖的package包/类
@Override
public List<SwitchTarget> getTargets(boolean onlyVisible, boolean originalProvider) {
List<SwitchTarget> result = new ArrayList<SwitchTarget>();
result.addAll(myTabs.getTargets(true, false));
GridImpl grid = getSelectedGrid();
if (grid != null) {
result.addAll(grid.getTargets(onlyVisible));
}
for (Wrapper wrapper : myMinimizedButtonsPlaceholder.values()) {
if (!wrapper.isShowing()) continue;
JComponent target = wrapper.getTargetComponent();
if (target instanceof ActionToolbar) {
ActionToolbar tb = (ActionToolbar)target;
result.addAll(tb.getTargets(onlyVisible, false));
}
}
return result;
}
示例6: getTargets
import com.intellij.ui.switcher.SwitchTarget; //导入依赖的package包/类
public List<SwitchTarget> getTargets(final boolean onlyVisible, boolean originalProvider) {
final ArrayList<SwitchTarget> result = new ArrayList<SwitchTarget>();
TabInfo selected = myTabs.getSelectedInfo();
new AwtVisitor(selected.getComponent()) {
@Override
public boolean visit(Component component) {
if (component instanceof JBTabs) {
JBTabs tabs = (JBTabs)component;
if (tabs != myTabs) {
result.addAll(tabs.getTargets(onlyVisible, false));
return true;
}
}
return false;
}
};
return result;
}
示例7: getCurrentTarget
import com.intellij.ui.switcher.SwitchTarget; //导入依赖的package包/类
public SwitchTarget getCurrentTarget() {
TabInfo selected = myTabs.getSelectedInfo();
final Ref<SwitchTarget> targetRef = new Ref<SwitchTarget>();
new AwtVisitor(selected.getComponent()) {
@Override
public boolean visit(Component component) {
if (component instanceof JBTabs) {
JBTabs tabs = (JBTabs)component;
if (tabs != myTabs) {
targetRef.set(tabs.getCurrentTarget());
return true;
}
}
return false;
}
};
return targetRef.get();
}
示例8: getTargets
import com.intellij.ui.switcher.SwitchTarget; //导入依赖的package包/类
@Override
public List<SwitchTarget> getTargets(boolean onlyVisible, boolean originalProvider) {
ArrayList<SwitchTarget> result = new ArrayList<>();
for (TabInfo each : myVisibleInfos) {
result.add(new TabTarget(each));
}
if (originalProvider && mySwitchDelegate != null) {
List<SwitchTarget> additional = mySwitchDelegate.getTargets(onlyVisible, false);
if (additional != null) {
result.addAll(additional);
}
}
return result;
}
示例9: getTargets
import com.intellij.ui.switcher.SwitchTarget; //导入依赖的package包/类
@Override
public List<SwitchTarget> getTargets(boolean onlyVisible, boolean originalProvider) {
List<SwitchTarget> result = new ArrayList<>();
result.addAll(myTabs.getTargets(true, false));
GridImpl grid = getSelectedGrid();
if (grid != null) {
result.addAll(grid.getTargets(onlyVisible));
}
for (Wrapper wrapper : myMinimizedButtonsPlaceholder.values()) {
if (!wrapper.isShowing()) continue;
JComponent target = wrapper.getTargetComponent();
if (target instanceof ActionToolbar) {
ActionToolbar tb = (ActionToolbar)target;
result.addAll(tb.getTargets(onlyVisible, false));
}
}
return result;
}
示例10: getCurrentTarget
import com.intellij.ui.switcher.SwitchTarget; //导入依赖的package包/类
@Override
public SwitchTarget getCurrentTarget() {
if (mySwitchDelegate != null) {
SwitchTarget selection = mySwitchDelegate.getCurrentTarget();
if (selection != null) return selection;
}
return new TabTarget(getSelectedInfo());
}
示例11: getTargets
import com.intellij.ui.switcher.SwitchTarget; //导入依赖的package包/类
public List<SwitchTarget> getTargets(boolean onlyVisible, boolean originalProvider) {
List<SwitchTarget> result = new ArrayList<SwitchTarget>();
if (myType == ToolWindowContentUiType.TABBED) {
for (int i = 0; i < myManager.getContentCount(); i++) {
result.add(new ContentSwitchTarget(myManager.getContent(i)));
}
}
return result;
}
示例12: getTargets
import com.intellij.ui.switcher.SwitchTarget; //导入依赖的package包/类
@Override
public List<SwitchTarget> getTargets(boolean onlyVisible, boolean originalProvider) {
ArrayList<SwitchTarget> result = new ArrayList<SwitchTarget>();
if (getBounds().width * getBounds().height <= 0) return result;
for (int i = 0; i < getComponentCount(); i++) {
Component each = getComponent(i);
if (each instanceof ActionButton) {
result.add(new ActionTarget((ActionButton)each));
}
}
return result;
}
示例13: getTargets
import com.intellij.ui.switcher.SwitchTarget; //导入依赖的package包/类
@Override
public List<SwitchTarget> getTargets(boolean onlyVisible, boolean originalProvider) {
if (myUI instanceof SwitchProvider) {
return ((SwitchProvider)myUI).getTargets(onlyVisible, false);
}
return new SmartList<SwitchTarget>();
}
示例14: getCellFor
import com.intellij.ui.switcher.SwitchTarget; //导入依赖的package包/类
@Nullable
public SwitchTarget getCellFor(Component c) {
Component eachParent = c;
while (eachParent != null) {
for (GridCellImpl eachCell : myContent2Cell.values()) {
if (eachCell.contains(eachParent)) {
return eachCell.getTargetForSelection();
}
}
eachParent = eachParent.getParent();
}
return null;
}
示例15: getTargets
import com.intellij.ui.switcher.SwitchTarget; //导入依赖的package包/类
public List<SwitchTarget> getTargets(boolean onlyVisible) {
Collection<GridCellImpl> cells = myPlaceInGrid2Cell.values();
ArrayList<SwitchTarget> result = new ArrayList<SwitchTarget>();
for (GridCellImpl each : cells) {
result.addAll(each.getTargets(onlyVisible));
}
return result;
}