mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-22561 Data View: auto-update doesn't work with slices
This commit is contained in:
committed by
liana.bakradze
parent
e669fdade1
commit
cc8bbc1d9a
@@ -355,4 +355,8 @@ public class PyDebugValue extends XNamedValue {
|
||||
public String getTypeQualifier() {
|
||||
return myTypeQualifier;
|
||||
}
|
||||
|
||||
public boolean isTemporary() {
|
||||
return myTempName != null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class AsyncArrayTableModel extends AbstractTableModel {
|
||||
|
||||
private final ExecutorService myExecutorService = ConcurrencyUtil.newSingleThreadExecutor("Python async table");
|
||||
|
||||
private final PyDebugValue myDebugValue;
|
||||
private PyDebugValue myDebugValue;
|
||||
private final DataViewStrategy myStrategy;
|
||||
private LoadingCache<Pair<Integer, Integer>, ListenableFuture<ArrayChunk>> myChunkCache = CacheBuilder.newBuilder().build(
|
||||
new CacheLoader<Pair<Integer, Integer>, ListenableFuture<ArrayChunk>>() {
|
||||
@@ -256,4 +256,12 @@ public class AsyncArrayTableModel extends AbstractTableModel {
|
||||
public void invalidateCache() {
|
||||
myChunkCache.invalidateAll();
|
||||
}
|
||||
|
||||
public PyDebugValue getDebugValue() {
|
||||
return myDebugValue;
|
||||
}
|
||||
|
||||
public void setDebugValue(PyDebugValue debugValue) {
|
||||
myDebugValue = debugValue;
|
||||
}
|
||||
}
|
||||
@@ -86,11 +86,24 @@ public class PyDataViewerPanel extends JPanel {
|
||||
|
||||
private void updateModel() {
|
||||
AsyncArrayTableModel model = getModel();
|
||||
if (model != null) {
|
||||
model.invalidateCache();
|
||||
if (isShowing()) {
|
||||
model.fireTableDataChanged();
|
||||
}
|
||||
if (model == null) {
|
||||
return;
|
||||
}
|
||||
model.invalidateCache();
|
||||
updateDebugValue(model);
|
||||
if (isShowing()) {
|
||||
model.fireTableDataChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateDebugValue(@NotNull AsyncArrayTableModel model) {
|
||||
PyDebugValue oldValue = model.getDebugValue();
|
||||
if (!oldValue.isTemporary()) {
|
||||
return;
|
||||
}
|
||||
PyDebugValue newValue = getDebugValue(mySliceTextField.getText());
|
||||
if (newValue != null) {
|
||||
model.setDebugValue(newValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user