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


Java SwitchTarget类代码示例

本文整理汇总了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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:JBTabsImpl.java

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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