use of com.intellij.psi.search.scope.NonProjectFilesScope in project intellij-community by JetBrains.
the class ScopesOrderDialog method fillList.
private void fillList() {
DefaultListModel model = new DefaultListModel();
model.removeAllElements();
final List<String> scopes = new ArrayList<>();
for (final NamedScopesHolder holder : NamedScopesHolder.getAllNamedScopeHolders(myProject)) {
for (final NamedScope scope : holder.getScopes()) {
if (!(scope instanceof NonProjectFilesScope)) {
scopes.add(scope.getName());
}
}
}
scopes.remove(CustomScopesProviderEx.getAllScope().getName());
Collections.sort(scopes, new ScopeOrderComparator(myInspectionProfile));
for (String scopeName : scopes) {
model.addElement(scopeName);
}
myOptionsList.setModel(model);
myOptionsList.setSelectedIndex(0);
}
use of com.intellij.psi.search.scope.NonProjectFilesScope in project intellij-community by JetBrains.
the class ScopesChooser method createPopupActionGroup.
@NotNull
@Override
public DefaultActionGroup createPopupActionGroup(final JComponent component) {
final DefaultActionGroup group = new DefaultActionGroup();
final List<NamedScope> predefinedScopes = new ArrayList<>();
final List<NamedScope> customScopes = new ArrayList<>();
for (final NamedScopesHolder holder : NamedScopesHolder.getAllNamedScopeHolders(myProject)) {
Collections.addAll(customScopes, holder.getEditableScopes());
predefinedScopes.addAll(holder.getPredefinedScopes());
}
predefinedScopes.remove(CustomScopesProviderEx.getAllScope());
for (NamedScope predefinedScope : predefinedScopes) {
if (predefinedScope instanceof NonProjectFilesScope) {
predefinedScopes.remove(predefinedScope);
break;
}
}
fillActionGroup(group, predefinedScopes, myDefaultDescriptors, myInspectionProfile, myExcludedScopeNames);
group.addSeparator();
fillActionGroup(group, customScopes, myDefaultDescriptors, myInspectionProfile, myExcludedScopeNames);
group.addSeparator();
group.add(new DumbAwareAction("Edit Scopes Order...") {
@Override
public void actionPerformed(final AnActionEvent e) {
final ScopesOrderDialog dlg = new ScopesOrderDialog(component, myInspectionProfile, myProject);
if (dlg.showAndGet()) {
onScopesOrderChanged();
}
}
});
return group;
}
Aggregations