mirror of
https://github.com/Wisser/Jailer.git
synced 2026-05-20 02:55:00 -05:00
Keep view position when switching from type/value table view
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -24,6 +24,8 @@ import java.awt.Rectangle;
|
||||
import java.awt.Window;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.AdjustmentEvent;
|
||||
import java.awt.event.AdjustmentListener;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
@@ -90,16 +92,25 @@ public class TableDetailsView extends javax.swing.JPanel {
|
||||
}
|
||||
});
|
||||
}
|
||||
AdjustmentListener al = new AdjustmentListener() {
|
||||
@Override
|
||||
public void adjustmentValueChanged(AdjustmentEvent e) {
|
||||
lastKnownVPos = jScrollPane2.getViewport().getViewPosition();
|
||||
}
|
||||
};
|
||||
if (jScrollPane2.getHorizontalScrollBar() != null) {
|
||||
jScrollPane2.getHorizontalScrollBar().setUnitIncrement(16);
|
||||
jScrollPane2.getHorizontalScrollBar().addAdjustmentListener(al);
|
||||
}
|
||||
if (jScrollPane2.getVerticalScrollBar() != null) {
|
||||
jScrollPane2.getVerticalScrollBar().setUnitIncrement(16);
|
||||
jScrollPane2.getVerticalScrollBar().addAdjustmentListener(al);
|
||||
}
|
||||
if (currentView != null) {
|
||||
sortColumnsCheckBox.setSelected(currentView.sortColumnsCheckBox.isSelected());
|
||||
foundColumn = currentView.foundColumn;
|
||||
}
|
||||
|
||||
ImageIcon scaledFindColumnIcon1 = UIUtil.scaleIcon(this, findColumnIcon1);
|
||||
ImageIcon scaledFindColumnIcon2 = UIUtil.scaleIcon(this, findColumnIcon2);
|
||||
|
||||
@@ -629,6 +640,18 @@ public class TableDetailsView extends javax.swing.JPanel {
|
||||
private javax.swing.JPanel warnPanel;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
private Point lastKnownVPos = null;
|
||||
|
||||
public Point getViewPosition() {
|
||||
return lastKnownVPos == null? jScrollPane2.getViewport().getLocation() : lastKnownVPos;
|
||||
}
|
||||
|
||||
public void setViewPosition(Point vpos) {
|
||||
if (vpos != null) {
|
||||
jScrollPane2.getViewport().setViewPosition(vpos);
|
||||
}
|
||||
}
|
||||
|
||||
private static ImageIcon findColumnIcon1;
|
||||
private static ImageIcon findColumnIcon2;
|
||||
private static ImageIcon constraintPKIcon;
|
||||
|
||||
Reference in New Issue
Block a user