mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
console filters: provide update message
This commit is contained in:
+5
@@ -98,5 +98,10 @@ public class ExceptionExFilterFactory implements ExceptionFilterFactory {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUpdateMessage() {
|
||||
return "Checking try/finally blocks";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -164,6 +164,11 @@ public class VcsContentAnnotationExceptionFilter implements Filter, FilterMixin
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUpdateMessage() {
|
||||
return "Checking recent changes...";
|
||||
}
|
||||
|
||||
private static class LocalChangesCorrector {
|
||||
private final Map<VirtualFile, UpToDateLineNumberProvider> myRecentlyChanged;
|
||||
private final Project myProject;
|
||||
|
||||
@@ -77,6 +77,24 @@ public class CompositeFilter implements Filter, FilterMixin {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUpdateMessage() {
|
||||
final boolean dumb = myDumbService.isDumb();
|
||||
List<Filter> filters = myFilters;
|
||||
final List<String> updateMessage = new ArrayList<String>();
|
||||
int count = filters.size();
|
||||
//noinspection ForLoopReplaceableByForEach
|
||||
for (int i = 0; i < count; i++) {
|
||||
Filter filter = filters.get(i);
|
||||
|
||||
if (!(filter instanceof FilterMixin) || !((FilterMixin)filter).shouldRunHeavy()) continue;
|
||||
if (!dumb || DumbService.isDumbAware(filter)) {
|
||||
updateMessage.add(((FilterMixin)filter).getUpdateMessage());
|
||||
}
|
||||
}
|
||||
return updateMessage.size() == 1 ? updateMessage.get(0) : "Updating...";
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return myFilters.isEmpty();
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ public interface FilterMixin {
|
||||
@Nullable
|
||||
void applyHeavyFilter(Document copiedFragment, int startOffset, int startLineNumber, Consumer<AdditionalHighlight> consumer);
|
||||
|
||||
String getUpdateMessage();
|
||||
|
||||
abstract class AdditionalHighlight {
|
||||
private final int myStart;
|
||||
private final int myEnd;
|
||||
|
||||
@@ -400,7 +400,7 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo
|
||||
public JComponent getComponent() {
|
||||
if (myMainPanel == null) {
|
||||
myMainPanel = new JPanel(new BorderLayout());
|
||||
myJLayeredPane = new MyDiffContainer(myMainPanel, "Checking recent changes...");
|
||||
myJLayeredPane = new MyDiffContainer(myMainPanel, myPredefinedMessageFilter.getUpdateMessage());
|
||||
add(myJLayeredPane, BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user