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


Java Configurable.Composite方法代码示例

本文整理汇总了Java中com.intellij.openapi.options.Configurable.Composite方法的典型用法代码示例。如果您正苦于以下问题:Java Configurable.Composite方法的具体用法?Java Configurable.Composite怎么用?Java Configurable.Composite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.options.Configurable的用法示例。


在下文中一共展示了Configurable.Composite方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: add

import com.intellij.openapi.options.Configurable; //导入方法依赖的package包/类
private void add(List<Configurable> list, Configurable... configurables) {
  for (Configurable configurable : configurables) {
    if (accept(configurable)) {
      list.add(configurable);
    }
    if (configurable instanceof Configurable.Composite) {
      Configurable.Composite composite = (Configurable.Composite)configurable;
      add(list, composite.getConfigurables());
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ConfigurableVisitor.java

示例2: createDefaultContent

import com.intellij.openapi.options.Configurable; //导入方法依赖的package包/类
private JComponent createDefaultContent(Configurable configurable) {
  JComponent content = new JPanel(new BorderLayout());
  content.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
  String key = configurable == null ? null : ConfigurableVisitor.ByID.getID(configurable) + ".settings.description";
  String description = key == null ? null : getString(configurable, key);
  if (description == null) {
    description = "Select configuration element in the tree to edit its settings";
    content.add(BorderLayout.CENTER, new JLabel(description, SwingConstants.CENTER));
    content.setPreferredSize(JBUI.size(800, 600));
  }
  else {
    content.add(BorderLayout.NORTH, new JLabel(description));
    if (configurable instanceof Configurable.Composite) {
      Configurable.Composite composite = (Configurable.Composite)configurable;

      JPanel panel = new JPanel();
      panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
      content.add(BorderLayout.CENTER, panel);
      panel.add(Box.createVerticalStrut(10));
      for (final Configurable current : composite.getConfigurables()) {
        LinkLabel label = new LinkLabel(current.getDisplayName(), null) {
          @Override
          public void doClick() {
            openLink(current);
          }
        };
        label.setBorder(BorderFactory.createEmptyBorder(1, 17, 3, 1));
        panel.add(label);
      }
    }
  }
  return content;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:34,代码来源:ConfigurableEditor.java

示例3: buildChildren

import com.intellij.openapi.options.Configurable; //导入方法依赖的package包/类
private List<EditorNode> buildChildren(final Configurable configurable, SimpleNode parent, final ConfigurableGroup group) {
  if (configurable instanceof Configurable.Composite) {
    final Configurable[] kids = ((Configurable.Composite)configurable).getConfigurables();
    final List<EditorNode> result = new ArrayList<EditorNode>(kids.length);
    for (Configurable child : kids) {
      result.add(new EditorNode(parent, child, group));
      myFilter.myContext.registerKid(configurable, child);
    }
    return result; // TODO: DECIDE IF INNERS SHOULD BE SORTED: sort(result);
  }
  else {
    return Collections.emptyList();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:OptionsTree.java

示例4: processConfigurables

import com.intellij.openapi.options.Configurable; //导入方法依赖的package包/类
private static void processConfigurables(final Configurable[] configurables,
                                         final HashMap<SearchableConfigurable, TreeSet<OptionDescription>> options) {
  for (Configurable configurable : configurables) {
    if (configurable instanceof SearchableConfigurable) {
      TreeSet<OptionDescription> configurableOptions = new TreeSet<OptionDescription>();

      if (configurable instanceof Configurable.Composite) {
        final Configurable[] children = ((Configurable.Composite)configurable).getConfigurables();
        processConfigurables(children, options);
      }

      //ignore invisible root nodes
      if (configurable instanceof SearchableConfigurable.Parent && !((SearchableConfigurable.Parent)configurable).isVisible()) {
        continue;
      }

      options.put((SearchableConfigurable)configurable, configurableOptions);

      if (configurable instanceof MasterDetails) {
        final MasterDetails md = (MasterDetails)configurable;
        md.initUi();
        _processComponent(configurable, configurableOptions, md.getMaster());
        _processComponent(configurable, configurableOptions, md.getDetails().getComponent());
      }
      else {
        _processComponent(configurable, configurableOptions, configurable.createComponent());
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:SearchUtil.java

示例5: addChildren

import com.intellij.openapi.options.Configurable; //导入方法依赖的package包/类
private static void addChildren(Configurable configurable, List<Configurable> list) {
  if (configurable instanceof Configurable.Composite) {
    final Configurable[] kids = ((Configurable.Composite)configurable).getConfigurables();
    for (Configurable eachKid : kids) {
      list.add(eachKid);
      addChildren(eachKid, list);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:SearchUtil.java

示例6: isAlwaysLeaf

import com.intellij.openapi.options.Configurable; //导入方法依赖的package包/类
@Override
public boolean isAlwaysLeaf() {
  return !(myConfigurable instanceof Configurable.Composite);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:OptionsTree.java


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