mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-115037 restrict 1st column movement
This commit is contained in:
@@ -193,30 +193,7 @@ public class JBTable extends JTable implements ComponentWithEmptyText, Component
|
||||
|
||||
@Override
|
||||
protected JTableHeader createDefaultTableHeader() {
|
||||
return new JTableHeader(columnModel) {
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
if (myEnableAntialiasing) {
|
||||
GraphicsUtil.setupAntialiasing(g);
|
||||
}
|
||||
super.paint(g);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getToolTipText(final MouseEvent event) {
|
||||
final TableModel model = getModel();
|
||||
if (model instanceof SortableColumnModel) {
|
||||
final int i = columnAtPoint(event.getPoint());
|
||||
final int infoIndex = i >= 0 ? convertColumnIndexToModel(i) : -1;
|
||||
final ColumnInfo[] columnInfos = ((SortableColumnModel)model).getColumnInfos();
|
||||
final String tooltipText = infoIndex >= 0 && infoIndex < columnInfos.length ? columnInfos[infoIndex].getTooltipText() : null;
|
||||
if (tooltipText != null) {
|
||||
return tooltipText;
|
||||
}
|
||||
}
|
||||
return super.getToolTipText(event);
|
||||
}
|
||||
};
|
||||
return new JBTableHeader();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
@@ -661,5 +638,34 @@ public class JBTable extends JTable implements ComponentWithEmptyText, Component
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected class JBTableHeader extends JTableHeader {
|
||||
public JBTableHeader() {
|
||||
super(JBTable.this.columnModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
if (myEnableAntialiasing) {
|
||||
GraphicsUtil.setupAntialiasing(g);
|
||||
}
|
||||
super.paint(g);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getToolTipText(final MouseEvent event) {
|
||||
final TableModel model = getModel();
|
||||
if (model instanceof SortableColumnModel) {
|
||||
final int i = columnAtPoint(event.getPoint());
|
||||
final int infoIndex = i >= 0 ? convertColumnIndexToModel(i) : -1;
|
||||
final ColumnInfo[] columnInfos = ((SortableColumnModel)model).getColumnInfos();
|
||||
final String tooltipText = infoIndex >= 0 && infoIndex < columnInfos.length ? columnInfos[infoIndex].getTooltipText() : null;
|
||||
if (tooltipText != null) {
|
||||
return tooltipText;
|
||||
}
|
||||
}
|
||||
return super.getToolTipText(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user