Java 类com.intellij.ui.treeStructure.CachingSimpleNode 实例源码

项目:intellij-ce-playground    文件:SettingsTreeView.java   
private MyNode(CachingSimpleNode parent, Configurable configurable, int level) {
  super(parent);
  myComposite = configurable instanceof Configurable.Composite ? (Configurable.Composite)configurable : null;
  myConfigurable = configurable;
  String name = configurable.getDisplayName();
  myDisplayName = name != null ? name.replace("\n", " ") : "{ " + configurable.getClass().getSimpleName() + " }";
  myLevel = level;
}
项目:intellij-ce-playground    文件:IdeSettingsDialogFixture.java   
private List<String> getSettingsNames(@NotNull Class<? extends ConfigurableGroup> groupType) {
  List<String> names = Lists.newArrayList();
  JPanel optionsEditor = field("myEditor").ofType(JPanel.class).in(getDialogWrapper()).get();
  assertNotNull(optionsEditor);

  List<JComponent> trees = findComponentsOfType(optionsEditor, "com.intellij.openapi.options.newEditor.SettingsTreeView");
  assertThat(trees).hasSize(1);
  JComponent tree = trees.get(0);

  CachingSimpleNode root = field("myRoot").ofType(CachingSimpleNode.class).in(tree).get();
  assertNotNull(root);

  ConfigurableGroup[] groups = field("myGroups").ofType(ConfigurableGroup[].class).in(root).get();
  assertNotNull(groups);
  ConfigurableGroup group = null;
  for (ConfigurableGroup current : groups) {
    if (groupType.isInstance(current)) {
      group = current;
      break;
    }
  }
  assertNotNull(group);
  for (Configurable configurable : group.getConfigurables()) {
    names.add(configurable.getDisplayName());
  }
  return names;
}