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


Java SearchableConfigurable类代码示例

本文整理汇总了Java中com.intellij.openapi.options.SearchableConfigurable的典型用法代码示例。如果您正苦于以下问题:Java SearchableConfigurable类的具体用法?Java SearchableConfigurable怎么用?Java SearchableConfigurable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: isComponentHighlighted

import com.intellij.openapi.options.SearchableConfigurable; //导入依赖的package包/类
public static boolean isComponentHighlighted(String text, String option, final boolean force, final SearchableConfigurable configurable) {
  if (text == null || option == null || option.length() == 0) return false;
  final SearchableOptionsRegistrar searchableOptionsRegistrar = SearchableOptionsRegistrar.getInstance();
  final Set<String> words = searchableOptionsRegistrar.getProcessedWords(option);
  final Set<String> options =
    configurable != null ? searchableOptionsRegistrar.replaceSynonyms(words, configurable) : words;
  if (options == null || options.isEmpty()) {
    return text.toLowerCase().indexOf(option.toLowerCase()) != -1;
  }
  final Set<String> tokens = searchableOptionsRegistrar.getProcessedWords(text);
  if (!force) {
    options.retainAll(tokens);
    final boolean highlight = !options.isEmpty();
    return highlight || text.toLowerCase().indexOf(option.toLowerCase()) != -1;
  }
  else {
    options.removeAll(tokens);
    return options.isEmpty();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:SearchUtil.java

示例2: expandGroup

import com.intellij.openapi.options.SearchableConfigurable; //导入依赖的package包/类
public static List<Configurable> expandGroup(final ConfigurableGroup group) {
  final Configurable[] configurables = group.getConfigurables();
  List<Configurable> result = new ArrayList<Configurable>();
  ContainerUtil.addAll(result, configurables);
  for (Configurable each : configurables) {
    addChildren(each, result);
  }
  
  result = ContainerUtil.filter(result, new Condition<Configurable>() {
    @Override
    public boolean value(Configurable configurable) {
      return !(configurable instanceof SearchableConfigurable.Parent) || ((SearchableConfigurable.Parent)configurable).isVisible();
    }
  });
 
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:SearchUtil.java

示例3: buildConfigurables

import com.intellij.openapi.options.SearchableConfigurable; //导入依赖的package包/类
@NotNull
@Override
public Configurable[] buildConfigurables() {
  myDisposeCompleted = false;
  initAll();

  List<ColorAndFontPanelFactory> panelFactories = createPanelFactories();

  List<Configurable> result = new ArrayList<Configurable>();
  mySubPanelFactories = new LinkedHashMap<ColorAndFontPanelFactory, InnerSearchableConfigurable>(panelFactories.size());
  for (ColorAndFontPanelFactory panelFactory : panelFactories) {
    mySubPanelFactories.put(panelFactory, new InnerSearchableConfigurable(panelFactory));
  }

  result.addAll(new ArrayList<SearchableConfigurable>(mySubPanelFactories.values()));
  return result.toArray(new Configurable[result.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ColorAndFontOptions.java

示例4: createComponent

import com.intellij.openapi.options.SearchableConfigurable; //导入依赖的package包/类
@Nullable
@Override
public JComponent createComponent() {
  final JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
  panel.add(myCheckbox);
  panel.add(myComboBox);
  panel.add(Box.createHorizontalStrut(UIUtil.DEFAULT_HGAP));
  panel.add(new LinkLabel("Edit scopes", null, new LinkListener() {
    @Override
    public void linkSelected(LinkLabel aSource, Object aLinkData) {
      final OptionsEditor optionsEditor = OptionsEditor.KEY.getData(DataManager.getInstance().getDataContext(panel));
      if (optionsEditor != null) {
        SearchableConfigurable configurable = optionsEditor.findConfigurableById(new ScopeChooserConfigurable(myProject).getId());
        if (configurable != null) {
          optionsEditor.select(configurable);
        }
      }
    }
  }));
  return panel;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:VcsUpdateInfoScopeFilterConfigurable.java

示例5: buildConfigurables

import com.intellij.openapi.options.SearchableConfigurable; //导入依赖的package包/类
@Override
public Configurable[] buildConfigurables() {
  myDisposeCompleted = false;
  initAll();

  List<ColorAndFontPanelFactory> panelFactories = createPanelFactories();

  List<Configurable> result = new ArrayList<Configurable>();
  mySubPanelFactories = new LinkedHashMap<ColorAndFontPanelFactory, InnerSearchableConfigurable>(panelFactories.size());
  for (ColorAndFontPanelFactory panelFactory : panelFactories) {
    mySubPanelFactories.put(panelFactory, new InnerSearchableConfigurable(panelFactory));
  }

  result.addAll(new ArrayList<SearchableConfigurable>(mySubPanelFactories.values()));
  return result.toArray(new Configurable[result.size()]);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:ColorAndFontOptions.java

示例6: expandGroup

import com.intellij.openapi.options.SearchableConfigurable; //导入依赖的package包/类
public static List<Configurable> expandGroup(final Configurable[] configurables) {
  List<Configurable> result = new ArrayList<Configurable>();
  ContainerUtil.addAll(result, configurables);
  for (Configurable each : configurables) {
    addChildren(each, result);
  }
  
  result = ContainerUtil.filter(result, new Condition<Configurable>() {
    @Override
    public boolean value(Configurable configurable) {
      return !(configurable instanceof SearchableConfigurable.Parent) || ((SearchableConfigurable.Parent)configurable).isVisible();
    }
  });
 
  return result;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:SearchUtil.java

示例7: createComponent

import com.intellij.openapi.options.SearchableConfigurable; //导入依赖的package包/类
@Nullable
@Override
public JComponent createComponent() {
  final JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
  panel.add(myCheckbox);
  panel.add(myComboBox);
  panel.add(Box.createHorizontalStrut(UIUtil.DEFAULT_HGAP));
  panel.add(new LinkLabel("Edit scopes", null, new LinkListener() {
    @Override
    public void linkSelected(LinkLabel aSource, Object aLinkData) {
      final OptionsEditor optionsEditor = DataManager.getInstance().getDataContext(panel).getData(OptionsEditor.KEY);
      if (optionsEditor != null) {
        SearchableConfigurable configurable = optionsEditor.findConfigurableById(new ScopeChooserConfigurable(myProject).getId());
        if (configurable != null) {
          optionsEditor.select(configurable);
        }
      }
    }
  }));
  return panel;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:VcsUpdateInfoScopeFilterConfigurable.java

示例8: saveCurrentConfigurable

import com.intellij.openapi.options.SearchableConfigurable; //导入依赖的package包/类
private void saveCurrentConfigurable() {
  final Configurable current = myEditor.getContext().getCurrentConfigurable();
  if (current == null) return;

  final PropertiesComponent props = PropertiesComponent.getInstance(myProject);

  if (current instanceof SearchableConfigurable) {
    props.setValue(LAST_SELECTED_CONFIGURABLE, ((SearchableConfigurable)current).getId());
  }
  else {
    props.setValue(LAST_SELECTED_CONFIGURABLE, current.getClass().getName());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:IdeSettingsDialog.java

示例9: saveCurrentConfigurable

import com.intellij.openapi.options.SearchableConfigurable; //导入依赖的package包/类
private void saveCurrentConfigurable() {
  final Configurable current = myEditor.getContext().getCurrentConfigurable();
  if (current == null) return;

  final PropertiesComponent props = PropertiesComponent.getInstance(myProject);

  if (current instanceof SearchableConfigurable) {
    props.setValue(LAST_SELECTED_CONFIGURABLE, ((SearchableConfigurable)current).getId());
  } else {
    props.setValue(LAST_SELECTED_CONFIGURABLE, current.getClass().getName());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:OptionsEditorDialog.java

示例10: update

import com.intellij.openapi.options.SearchableConfigurable; //导入依赖的package包/类
void update(SettingsFilter filter, Configurable configurable, JComponent component) {
  if (configurable == null) {
    myGlassPanel.clear();
    myVisible = false;
  }
  else if (component != null) {
    myGlassPanel.clear();
    String text = filter.getFilterText();
    myVisible = !text.isEmpty();
    try {
      SearchableConfigurable searchable = new SearchableConfigurable.Delegate(configurable);
      SearchUtil.lightOptions(searchable, component, text, myGlassPanel).run();
      Runnable search = searchable.enableSearch(text); // execute for empty string too
      if (search != null && !filter.contains(configurable) && !text.equals(myConfigurableOption.get(configurable))) {
        search.run();
      }
    }
    finally {
      myConfigurableOption.put(configurable, text);
    }
  }
  else if (!ApplicationManager.getApplication().isUnitTestMode()) {
    updateLater();
    return;
  }
  fireNeedsRepaint(myGlassPanel);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:SpotlightPainter.java

示例11: findConfigurableById

import com.intellij.openapi.options.SearchableConfigurable; //导入依赖的package包/类
@Nullable
public SearchableConfigurable findConfigurableById(@NotNull String configurableId) {
  for (Configurable configurable : myConfigurable2Node.keySet()) {
    if (configurable instanceof SearchableConfigurable) {
      SearchableConfigurable searchableConfigurable = (SearchableConfigurable) configurable;
      if (configurableId.equals(searchableConfigurable.getId())) {
        return searchableConfigurable;
      }
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:OptionsTree.java

示例12: replaceSynonyms

import com.intellij.openapi.options.SearchableConfigurable; //导入依赖的package包/类
@Override
public Set<String> replaceSynonyms(Set<String> options, SearchableConfigurable configurable) {
  final Set<String> result = new HashSet<String>(options);
  for (String option : options) {
    final Set<String> synonyms = getSynonym(option, configurable);
    if (synonyms != null) {
      result.addAll(synonyms);
    }
    else {
      result.add(option);
    }
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:SearchableOptionsRegistrarImpl.java

示例13: processConfigurables

import com.intellij.openapi.options.SearchableConfigurable; //导入依赖的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

示例14: lightOptions

import com.intellij.openapi.options.SearchableConfigurable; //导入依赖的package包/类
public static Runnable lightOptions(final SearchableConfigurable configurable,
                                    final JComponent component,
                                    final String option,
                                    final GlassPanel glassPanel) {
  return new Runnable() {
    public void run() {
      if (!traverseComponentsTree(configurable, glassPanel, component, option, true)) {
        traverseComponentsTree(configurable, glassPanel, component, option, false);
      }
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:SearchUtil.java

示例15: getConfigurables

import com.intellij.openapi.options.SearchableConfigurable; //导入依赖的package包/类
@Override
public Configurable[] getConfigurables() {
  compute();

  if (myChildren.length == 0 && myRootConfigurable instanceof SearchableConfigurable.Parent) {
    return ((Parent)myRootConfigurable).getConfigurables();
  }
  else {
    return myChildren;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:DebuggerConfigurable.java


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