mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 10:19:23 +02:00
GT-2763 - Table Sorting - review fixes
This commit is contained in:
parent
445c7ca03e
commit
aa8dc6a491
17 changed files with 81 additions and 145 deletions
|
@ -16,7 +16,8 @@
|
||||||
package ghidra.app.plugin.core.symtable;
|
package ghidra.app.plugin.core.symtable;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.event.TableModelListener;
|
import javax.swing.event.TableModelListener;
|
||||||
|
@ -118,7 +119,7 @@ class SymbolPanel extends JPanel {
|
||||||
|
|
||||||
protected RowFilterTransformer<SymbolRowObject> updateRowDataTransformer(boolean nameOnly) {
|
protected RowFilterTransformer<SymbolRowObject> updateRowDataTransformer(boolean nameOnly) {
|
||||||
if (nameOnly) {
|
if (nameOnly) {
|
||||||
return new NameOnlyRowTransformer();
|
return new NameOnlyRowTransformer(tableModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new DefaultRowFilterTransformer<>(tableModel, symTable.getColumnModel());
|
return new DefaultRowFilterTransformer<>(tableModel, symTable.getColumnModel());
|
||||||
|
@ -200,13 +201,18 @@ class SymbolPanel extends JPanel {
|
||||||
// Inner Classes
|
// Inner Classes
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
|
|
||||||
private class NameOnlyRowTransformer implements RowFilterTransformer<SymbolRowObject> {
|
private static class NameOnlyRowTransformer implements RowFilterTransformer<SymbolRowObject> {
|
||||||
private List<String> list = new ArrayList<>();
|
private List<String> list = new ArrayList<>();
|
||||||
|
private SymbolTableModel model;
|
||||||
|
|
||||||
|
NameOnlyRowTransformer(SymbolTableModel model) {
|
||||||
|
this.model = model;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> transform(SymbolRowObject rowObject) {
|
public List<String> transform(SymbolRowObject rowObject) {
|
||||||
list.clear();
|
list.clear();
|
||||||
Symbol symbol = tableModel.getSymbolForRowObject(rowObject);
|
Symbol symbol = model.getSymbolForRowObject(rowObject);
|
||||||
if (symbol != null) {
|
if (symbol != null) {
|
||||||
list.add(symbol.getName());
|
list.add(symbol.getName());
|
||||||
}
|
}
|
||||||
|
@ -215,11 +221,8 @@ class SymbolPanel extends JPanel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
// not meant to put in hashing structures; the data for equals may change over time
|
||||||
int result = 1;
|
throw new UnsupportedOperationException();
|
||||||
result = prime * result + getEnclosingInstance().hashCode();
|
|
||||||
result = prime * result + ((list == null) ? 0 : list.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -233,20 +236,7 @@ class SymbolPanel extends JPanel {
|
||||||
if (getClass() != obj.getClass()) {
|
if (getClass() != obj.getClass()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
NameOnlyRowTransformer other = (NameOnlyRowTransformer) obj;
|
|
||||||
if (!getEnclosingInstance().equals(other.getEnclosingInstance())) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(list, other.list)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SymbolPanel getEnclosingInstance() {
|
|
||||||
return SymbolPanel.this;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,7 +177,7 @@ public class VTMarkupItemsTableModel extends AddressBasedTableModel<VTMarkupItem
|
||||||
// Inner Classes
|
// Inner Classes
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
|
|
||||||
private class MarkupTablePassthroughFilter implements TableFilter<VTMarkupItem> {
|
private static class MarkupTablePassthroughFilter implements TableFilter<VTMarkupItem> {
|
||||||
|
|
||||||
private List<Filter<VTMarkupItem>> appliedFilters;
|
private List<Filter<VTMarkupItem>> appliedFilters;
|
||||||
|
|
||||||
|
@ -246,40 +246,17 @@ public class VTMarkupItemsTableModel extends AddressBasedTableModel<VTMarkupItem
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
// not meant to put in hashing structures; the data for equals changes
|
||||||
int result = 1;
|
throw new UnsupportedOperationException();
|
||||||
result = prime * result + getEnclosingInstance().hashCode();
|
|
||||||
result = prime * result + ((appliedFilters == null) ? 0 : appliedFilters.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj) {
|
// For now we don't support equals(); if this filter gets re-created,
|
||||||
return true;
|
// then the table must be re-filtered. If we decide to implement this method, then
|
||||||
}
|
// we must also implement equals() on the filters used by this filter.
|
||||||
if (obj == null) {
|
return this == obj;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (getClass() != obj.getClass()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
MarkupTablePassthroughFilter other = (MarkupTablePassthroughFilter) obj;
|
|
||||||
if (!getEnclosingInstance().equals(other.getEnclosingInstance())) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(appliedFilters, other.appliedFilters)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private VTMarkupItemsTableModel getEnclosingInstance() {
|
|
||||||
return VTMarkupItemsTableModel.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// column for selecting/editing?
|
// column for selecting/editing?
|
||||||
|
|
|
@ -137,7 +137,7 @@ public abstract class AbstractVTMatchTableModel extends AddressBasedTableModel<V
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
// Inner Classes
|
// Inner Classes
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
private class MatchTablePassthroughFilter implements TableFilter<VTMatch> {
|
private static class MatchTablePassthroughFilter implements TableFilter<VTMatch> {
|
||||||
|
|
||||||
private List<Filter<VTMatch>> appliedFilters;
|
private List<Filter<VTMatch>> appliedFilters;
|
||||||
|
|
||||||
|
@ -206,37 +206,16 @@ public abstract class AbstractVTMatchTableModel extends AddressBasedTableModel<V
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
// not meant to put in hashing structures; the data for equals changes
|
||||||
int result = 1;
|
throw new UnsupportedOperationException();
|
||||||
result = prime * result + getEnclosingInstance().hashCode();
|
|
||||||
result = prime * result + ((appliedFilters == null) ? 0 : appliedFilters.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj) {
|
// For now we don't support equals(); if this filter gets re-created,
|
||||||
return true;
|
// then the table must be re-filtered. If we decide to implement this method, then
|
||||||
}
|
// we must also implement equals() on the filters used by this filter.
|
||||||
if (obj == null) {
|
return this == obj;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (getClass() != obj.getClass()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
MatchTablePassthroughFilter other = (MatchTablePassthroughFilter) obj;
|
|
||||||
if (!getEnclosingInstance().equals(other.getEnclosingInstance())) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!Objects.equals(appliedFilters, other.appliedFilters)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private AbstractVTMatchTableModel getEnclosingInstance() {
|
|
||||||
return AbstractVTMatchTableModel.this;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,11 +70,8 @@ public abstract class AbstractPatternTextFilter implements TextFilter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
// not meant to put in hashing structures; the data for equals may change over time
|
||||||
int result = 1;
|
throw new UnsupportedOperationException();
|
||||||
result = prime * result + ((filterPattern == null) ? 0 : filterPattern.hashCode());
|
|
||||||
result = prime * result + ((filterText == null) ? 0 : filterText.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -90,12 +87,10 @@ public abstract class AbstractPatternTextFilter implements TextFilter {
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractPatternTextFilter other = (AbstractPatternTextFilter) obj;
|
AbstractPatternTextFilter other = (AbstractPatternTextFilter) obj;
|
||||||
|
if (!patternsEqual(createPattern(), other.createPattern())) {
|
||||||
String myPattern = getPatternString();
|
|
||||||
String otherPattern = other.getPatternString();
|
|
||||||
if (!myPattern.equals(otherPattern)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Objects.equals(filterText, other.filterText)) {
|
if (!Objects.equals(filterText, other.filterText)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -103,8 +98,24 @@ public abstract class AbstractPatternTextFilter implements TextFilter {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getPatternString() {
|
private boolean patternsEqual(Pattern p1, Pattern p2) {
|
||||||
return filterPattern == null ? "" : filterPattern.pattern();
|
String myPattern = getPatternString(p1);
|
||||||
|
String otherPattern = getPatternString(p2);
|
||||||
|
if (!myPattern.equals(otherPattern)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int f1 = getPatternFlags(p1);
|
||||||
|
int f2 = getPatternFlags(p2);
|
||||||
|
return f1 == f2;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getPatternString(Pattern p) {
|
||||||
|
return p == null ? "" : p.pattern();
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getPatternFlags(Pattern p) {
|
||||||
|
return p == null ? -1 : p.flags();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -43,10 +43,8 @@ public class InvertedTextFilter implements TextFilter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
// not meant to put in hashing structures; the data for equals may change over time
|
||||||
int result = 1;
|
throw new UnsupportedOperationException();
|
||||||
result = prime * result + ((filter == null) ? 0 : filter.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -40,11 +40,8 @@ public abstract class MatchesPatternTextFilter extends AbstractPatternTextFilter
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
// not meant to put in hashing structures; the data for equals may change over time
|
||||||
int result = super.hashCode();
|
throw new UnsupportedOperationException();
|
||||||
result = prime * result + (allowGlobbing ? 1231 : 1237);
|
|
||||||
result = prime * result + (caseSensitive ? 1231 : 1237);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -103,10 +103,8 @@ public class CombinedTableFilter<T> implements TableFilter<T> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
// not meant to put in hashing structures; the data for equals may change over time
|
||||||
int result = 1;
|
throw new UnsupportedOperationException();
|
||||||
result = prime * result + ((filters == null) ? 0 : filters.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -131,12 +131,8 @@ public class DefaultRowFilterTransformer<ROW_OBJECT> implements RowFilterTransfo
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
// not meant to put in hashing structures; the data for equals may change over time
|
||||||
int result = 1;
|
throw new UnsupportedOperationException();
|
||||||
result = prime * result + ((columnData == null) ? 0 : columnData.hashCode());
|
|
||||||
result = prime * result + ((columnModel == null) ? 0 : columnModel.hashCode());
|
|
||||||
result = prime * result + ((model == null) ? 0 : model.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -160,7 +156,8 @@ public class DefaultRowFilterTransformer<ROW_OBJECT> implements RowFilterTransfo
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Objects.equals(model, other.model)) {
|
// use '==' so that we don't end up comparing all table data
|
||||||
|
if (model != other.model) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -38,10 +38,8 @@ public class InvertedTableFilter<ROW_OBJECT> implements TableFilter<ROW_OBJECT>
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
// not meant to put in hashing structures; the data for equals may change over time
|
||||||
int result = 1;
|
throw new UnsupportedOperationException();
|
||||||
result = prime * result + ((filter == null) ? 0 : filter.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -91,12 +91,8 @@ public class MultiTextFilterTableFilter<ROW_OBJECT> implements TableFilter<ROW_O
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
// not meant to put in hashing structures; the data for equals may change over time
|
||||||
int result = 1;
|
throw new UnsupportedOperationException();
|
||||||
result = prime * result + ((evalMode == null) ? 0 : evalMode.hashCode());
|
|
||||||
result = prime * result + ((filters == null) ? 0 : filters.hashCode());
|
|
||||||
result = prime * result + ((transformer == null) ? 0 : transformer.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -59,11 +59,8 @@ public class TableTextFilter<ROW_OBJECT> implements TableFilter<ROW_OBJECT> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
// not meant to put in hashing structures; the data for equals may change over time
|
||||||
int result = 1;
|
throw new UnsupportedOperationException();
|
||||||
result = prime * result + ((textFilter == null) ? 0 : textFilter.hashCode());
|
|
||||||
result = prime * result + ((transformer == null) ? 0 : transformer.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -29,16 +29,16 @@ public class AddRemoveJob<T> extends TableUpdateJob<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized boolean filter() {
|
public synchronized boolean requestFilter() {
|
||||||
//
|
//
|
||||||
// This is a request to fully filter the table's data (like when the filter changes).
|
// This is a request to fully filter the table's data (like when the filter changes).
|
||||||
// In this case, we had disabled 'force filter', as the sorting did not need it.
|
// In this case, we had disabled 'force filter', as the sorting did not need it.
|
||||||
// However, when the client asks to filter, make sure we filter.
|
// However, when the client asks to filter, make sure we filter.
|
||||||
//
|
//
|
||||||
boolean jobIsStillRunning = super.filter();
|
boolean canFilter = super.requestFilter();
|
||||||
if (jobIsStillRunning) {
|
if (canFilter) {
|
||||||
setForceFilter(true); // reset, since we had turned it off above; now we have to filter
|
setForceFilter(true); // reset, since we had turned it off above; now we have to filter
|
||||||
}
|
}
|
||||||
return jobIsStillRunning;
|
return canFilter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -22,6 +21,6 @@ public class LoadJob<T> extends TableUpdateJob<T> {
|
||||||
LoadJob(ThreadedTableModel<T, ?> model, TaskMonitor monitor) {
|
LoadJob(ThreadedTableModel<T, ?> model, TaskMonitor monitor) {
|
||||||
super(model, monitor);
|
super(model, monitor);
|
||||||
reload(); // set job to totally reload data;
|
reload(); // set job to totally reload data;
|
||||||
sort(model.getSortingContext(), false); // set the comparator so the data will be sorted
|
requestSort(model.getSortingContext(), false); // set the comparator so the data will be sorted
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -26,6 +25,6 @@ public class LoadSpecificDataJob<T> extends TableUpdateJob<T> {
|
||||||
|
|
||||||
// set the comparator so the data will be sorted; always force a sort, since we just
|
// set the comparator so the data will be sorted; always force a sort, since we just
|
||||||
// loaded the data
|
// loaded the data
|
||||||
sort(model.getSortingContext(), true);
|
requestSort(model.getSortingContext(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,20 +24,20 @@ public class SortJob<T> extends TableUpdateJob<T> {
|
||||||
TableSortingContext<T> sortingContext, boolean forceSort) {
|
TableSortingContext<T> sortingContext, boolean forceSort) {
|
||||||
super(model, monitor);
|
super(model, monitor);
|
||||||
setForceFilter(false); // only sorting
|
setForceFilter(false); // only sorting
|
||||||
sort(sortingContext, forceSort);
|
requestSort(sortingContext, forceSort);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized boolean filter() {
|
public synchronized boolean requestFilter() {
|
||||||
//
|
//
|
||||||
// This is a request to fully filter the table's data (like when the filter changes).
|
// This is a request to fully filter the table's data (like when the filter changes).
|
||||||
// In this case, we had disabled 'force filter', as the sorting did not need it.
|
// In this case, we had disabled 'force filter', as the sorting did not need it.
|
||||||
// However, when the client asks to filter, make sure we filter.
|
// However, when the client asks to filter, make sure we filter.
|
||||||
//
|
//
|
||||||
boolean jobIsStillRunning = super.filter();
|
boolean canFilter = super.requestFilter();
|
||||||
if (jobIsStillRunning) {
|
if (canFilter) {
|
||||||
setForceFilter(true); // reset, since we had turned it off above; now we have to filter
|
setForceFilter(true); // reset, since we had turned it off above; now we have to filter
|
||||||
}
|
}
|
||||||
return jobIsStillRunning;
|
return canFilter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,7 +204,7 @@ public class TableUpdateJob<T> {
|
||||||
* @return true if the sort can be processed by this job, false if this job is essentially already
|
* @return true if the sort can be processed by this job, false if this job is essentially already
|
||||||
* completed and therefor cannot perform the sort job.
|
* completed and therefor cannot perform the sort job.
|
||||||
*/
|
*/
|
||||||
public synchronized boolean sort(TableSortingContext<T> newSortingContext, boolean forceSort) {
|
public synchronized boolean requestSort(TableSortingContext<T> newSortingContext, boolean forceSort) {
|
||||||
if (currentState == DONE) {
|
if (currentState == DONE) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@ public class TableUpdateJob<T> {
|
||||||
* @return true if the filter can be processed by this job, false if this job is essentially already
|
* @return true if the filter can be processed by this job, false if this job is essentially already
|
||||||
* completed and therefor cannot perform the filter job.
|
* completed and therefor cannot perform the filter job.
|
||||||
*/
|
*/
|
||||||
public synchronized boolean filter() {
|
public synchronized boolean requestFilter() {
|
||||||
if (currentState == DONE) {
|
if (currentState == DONE) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,12 +211,12 @@ class ThreadedTableModelUpdateMgr<T> {
|
||||||
void sort(TableSortingContext<T> sortingContext, boolean forceSort) {
|
void sort(TableSortingContext<T> sortingContext, boolean forceSort) {
|
||||||
synchronized (updateManager) {
|
synchronized (updateManager) {
|
||||||
if (currentJob != null && pendingJob == null &&
|
if (currentJob != null && pendingJob == null &&
|
||||||
currentJob.sort(sortingContext, forceSort)) {
|
currentJob.requestSort(sortingContext, forceSort)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pendingJob != null) {
|
if (pendingJob != null) {
|
||||||
pendingJob.sort(sortingContext, forceSort);
|
pendingJob.requestSort(sortingContext, forceSort);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pendingJob = new SortJob<>(model, monitor, sortingContext, forceSort);
|
pendingJob = new SortJob<>(model, monitor, sortingContext, forceSort);
|
||||||
|
@ -240,11 +240,11 @@ class ThreadedTableModelUpdateMgr<T> {
|
||||||
*/
|
*/
|
||||||
void filter() {
|
void filter() {
|
||||||
synchronized (updateManager) {
|
synchronized (updateManager) {
|
||||||
if (currentJob != null && pendingJob == null && currentJob.filter()) {
|
if (currentJob != null && pendingJob == null && currentJob.requestFilter()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pendingJob != null) {
|
if (pendingJob != null) {
|
||||||
pendingJob.filter();
|
pendingJob.requestFilter();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pendingJob = new FilterJob<>(model, monitor);
|
pendingJob = new FilterJob<>(model, monitor);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue