本文整理汇总了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());
}
}
}
示例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;
}
示例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();
}
}
示例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());
}
}
}
}
示例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);
}
}
}
示例6: isAlwaysLeaf
import com.intellij.openapi.options.Configurable; //导入方法依赖的package包/类
@Override
public boolean isAlwaysLeaf() {
return !(myConfigurable instanceof Configurable.Composite);
}