Java 类com.intellij.ui.switcher.SwitchTarget 实例源码

项目:intellij-ce-playground    文件:JBTabsImpl.java   
@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;
}
项目:intellij-ce-playground    文件:EditorTabbedContainer.java   
@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;
}
项目:intellij-ce-playground    文件:EditorTabbedContainer.java   
@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();
}
项目:intellij-ce-playground    文件:RunnerContentUi.java   
@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();
  }
}
项目:intellij-ce-playground    文件:RunnerContentUi.java   
@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;
}
项目:tools-idea    文件:JBTabsImpl.java   
@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;
}
项目:tools-idea    文件:EditorTabbedContainer.java   
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;
}
项目:tools-idea    文件:EditorTabbedContainer.java   
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();
}
项目:tools-idea    文件:RunnerContentUi.java   
@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();
  }
}
项目:tools-idea    文件:RunnerContentUi.java   
@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;
}
项目:consulo    文件:JBTabsImpl.java   
@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;
}
项目:consulo    文件:RunnerContentUi.java   
@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();
  }
}
项目:consulo    文件:RunnerContentUi.java   
@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;
}
项目:intellij-ce-playground    文件:JBTabsImpl.java   
@Override
public SwitchTarget getCurrentTarget() {
  if (mySwitchDelegate != null) {
    SwitchTarget selection = mySwitchDelegate.getCurrentTarget();
    if (selection != null) return selection;
  }

  return new TabTarget(getSelectedInfo());
}
项目:intellij-ce-playground    文件:ToolWindowContentUi.java   
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;
}
项目:intellij-ce-playground    文件:ActionToolbarImpl.java   
@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;
}
项目:intellij-ce-playground    文件:ContentManagerImpl.java   
@Override
public List<SwitchTarget> getTargets(boolean onlyVisible, boolean originalProvider) {
  if (myUI instanceof SwitchProvider) {
    return ((SwitchProvider)myUI).getTargets(onlyVisible, false);
  }
  return new SmartList<SwitchTarget>();
}
项目:intellij-ce-playground    文件:GridImpl.java   
@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;
}
项目:intellij-ce-playground    文件:GridImpl.java   
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;
}
项目:tools-idea    文件:JBTabsImpl.java   
@Override
public SwitchTarget getCurrentTarget() {
  if (mySwitchDelegate != null) {
    SwitchTarget selection = mySwitchDelegate.getCurrentTarget();
    if (selection != null) return selection;
  }

  return new TabTarget(getSelectedInfo());
}
项目:tools-idea    文件:ToolWindowContentUi.java   
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;
}
项目:tools-idea    文件:ActionToolbarImpl.java   
@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;
}
项目:tools-idea    文件:ContentManagerImpl.java   
@Override
public List<SwitchTarget> getTargets(boolean onlyVisible, boolean originalProvider) {
  if (myUI instanceof SwitchProvider) {
    return ((SwitchProvider)myUI).getTargets(onlyVisible, false);
  }
  return new ArrayList<SwitchTarget>();
}
项目:tools-idea    文件:ContentManagerImpl.java   
@Override
public SwitchTarget getCurrentTarget() {
  if (myUI instanceof SwitchProvider) {
    return ((SwitchProvider)myUI).getCurrentTarget();
  }

  return null;
}
项目:tools-idea    文件:GridImpl.java   
@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;
}
项目:tools-idea    文件:GridImpl.java   
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;
}
项目:consulo    文件:JBTabsImpl.java   
@Override
public SwitchTarget getCurrentTarget() {
  if (mySwitchDelegate != null) {
    SwitchTarget selection = mySwitchDelegate.getCurrentTarget();
    if (selection != null) return selection;
  }

  return new TabTarget(getSelectedInfo());
}
项目:consulo    文件:UnifiedToolWindowContentUI.java   
@Override
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;
}
项目:consulo    文件:ActionToolbarImpl.java   
@Override
public List<SwitchTarget> getTargets(boolean onlyVisible, boolean originalProvider) {
  ArrayList<SwitchTarget> result = new ArrayList<>();

  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;
}
项目:consulo    文件:GridImpl.java   
@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;
}
项目:consulo    文件:GridImpl.java   
public List<SwitchTarget> getTargets(boolean onlyVisible) {
  Collection<GridCellImpl> cells = myPlaceInGrid2Cell.values();
  ArrayList<SwitchTarget> result = new ArrayList<>();
  for (GridCellImpl each : cells) {
    result.addAll(each.getTargets(onlyVisible));
  }
  return result;
}
项目:consulo    文件:DesktopToolWindowContentUi.java   
@Override
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;
}
项目:intellij-ce-playground    文件:ToolWindowContentUi.java   
public SwitchTarget getCurrentTarget() {
  return new ContentSwitchTarget(myManager.getSelectedContent());
}
项目:intellij-ce-playground    文件:ActionToolbarImpl.java   
@Override
public SwitchTarget getCurrentTarget() {
  return null;
}
项目:intellij-ce-playground    文件:ContentManagerImpl.java   
@Override
public SwitchTarget getCurrentTarget() {
  return myUI instanceof SwitchProvider ? ((SwitchProvider)myUI).getCurrentTarget() : null;
}
项目:intellij-ce-playground    文件:GridCellImpl.java   
public List<SwitchTarget> getTargets(boolean onlyVisible) {
  if (myTabs.getPresentation().isHideTabs()) return new ArrayList<SwitchTarget>();

  return myTabs.getTargets(onlyVisible, false);
}
项目:intellij-ce-playground    文件:GridCellImpl.java   
public SwitchTarget getTargetForSelection() {
  return myTabs.getCurrentTarget();
}
项目:tools-idea    文件:ToolWindowContentUi.java   
public SwitchTarget getCurrentTarget() {
  return new ContentSwitchTarget(myManager.getSelectedContent());
}
项目:tools-idea    文件:ActionToolbarImpl.java   
@Override
public SwitchTarget getCurrentTarget() {
  return null;
}
项目:tools-idea    文件:GridCellImpl.java   
public List<SwitchTarget> getTargets(boolean onlyVisible) {
  if (myTabs.getPresentation().isHideTabs()) return new ArrayList<SwitchTarget>();

  return myTabs.getTargets(onlyVisible, false);
}