mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-61766 Impossible to resize table columns
This commit is contained in:
+3
-10
@@ -99,8 +99,6 @@ public class ClasspathPanelImpl extends JPanel implements ClasspathPanel {
|
|||||||
myEntryTable = new JBTable(myModel);
|
myEntryTable = new JBTable(myModel);
|
||||||
myEntryTable.setShowGrid(false);
|
myEntryTable.setShowGrid(false);
|
||||||
myEntryTable.setDragEnabled(false);
|
myEntryTable.setDragEnabled(false);
|
||||||
myEntryTable.setShowHorizontalLines(false);
|
|
||||||
myEntryTable.setShowVerticalLines(false);
|
|
||||||
myEntryTable.setIntercellSpacing(new Dimension(0, 0));
|
myEntryTable.setIntercellSpacing(new Dimension(0, 0));
|
||||||
|
|
||||||
myEntryTable.setDefaultRenderer(ClasspathTableItem.class, new TableItemRenderer(getStructureConfigurableContext()));
|
myEntryTable.setDefaultRenderer(ClasspathTableItem.class, new TableItemRenderer(getStructureConfigurableContext()));
|
||||||
@@ -152,7 +150,6 @@ public class ClasspathPanelImpl extends JPanel implements ClasspathPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
setFixedColumnWidth(ClasspathTableModel.EXPORT_COLUMN, ClasspathTableModel.EXPORT_COLUMN_NAME);
|
setFixedColumnWidth(ClasspathTableModel.EXPORT_COLUMN, ClasspathTableModel.EXPORT_COLUMN_NAME);
|
||||||
setFixedColumnWidth(ClasspathTableModel.SCOPE_COLUMN, DependencyScope.COMPILE.toString() + " "); // leave space for combobox border
|
setFixedColumnWidth(ClasspathTableModel.SCOPE_COLUMN, DependencyScope.COMPILE.toString() + " "); // leave space for combobox border
|
||||||
|
|
||||||
@@ -246,13 +243,9 @@ public class ClasspathPanelImpl extends JPanel implements ClasspathPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setFixedColumnWidth(final int columnIndex, final String textToMeasure) {
|
private void setFixedColumnWidth(final int columnIndex, final String textToMeasure) {
|
||||||
final FontMetrics fontMetrics = myEntryTable.getFontMetrics(myEntryTable.getFont());
|
final TableColumn column = myEntryTable.getTableHeader().getColumnModel().getColumn(columnIndex);
|
||||||
final int width = fontMetrics.stringWidth(" " + textToMeasure + " ") + 4;
|
column.setResizable(false);
|
||||||
final TableColumn checkboxColumn = myEntryTable.getTableHeader().getColumnModel().getColumn(columnIndex);
|
column.setMaxWidth(column.getPreferredWidth());
|
||||||
checkboxColumn.setWidth(width);
|
|
||||||
checkboxColumn.setPreferredWidth(width);
|
|
||||||
checkboxColumn.setMaxWidth(width);
|
|
||||||
checkboxColumn.setMinWidth(width);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+3
-3
@@ -86,9 +86,9 @@ public class AvailablePluginsManagerMain extends PluginManagerMain {
|
|||||||
pluginsModel = new AvailablePluginsTableModel();
|
pluginsModel = new AvailablePluginsTableModel();
|
||||||
pluginTable = new PluginTable(pluginsModel);
|
pluginTable = new PluginTable(pluginsModel);
|
||||||
pluginTable.getTableHeader().setReorderingAllowed(false);
|
pluginTable.getTableHeader().setReorderingAllowed(false);
|
||||||
pluginTable.setColumnWidth(PluginManagerColumnInfo.COLUMN_DOWNLOADS, 60);
|
pluginTable.setColumnWidth(PluginManagerColumnInfo.COLUMN_DOWNLOADS, 70);
|
||||||
pluginTable.setColumnWidth(PluginManagerColumnInfo.COLUMN_DATE, 60);
|
pluginTable.setColumnWidth(PluginManagerColumnInfo.COLUMN_DATE, 50);
|
||||||
pluginTable.setColumnWidth(PluginManagerColumnInfo.COLUMN_RATE, 70);
|
pluginTable.setColumnWidth(PluginManagerColumnInfo.COLUMN_RATE, 60);
|
||||||
|
|
||||||
return ScrollPaneFactory.createScrollPane(pluginTable);
|
return ScrollPaneFactory.createScrollPane(pluginTable);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -173,7 +173,7 @@ public class NotificationsConfigurablePanel extends JPanel implements Disposable
|
|||||||
});
|
});
|
||||||
|
|
||||||
final TableColumn logColumn = getColumnModel().getColumn(LOG_COLUMN);
|
final TableColumn logColumn = getColumnModel().getColumn(LOG_COLUMN);
|
||||||
logColumn.setMaxWidth(new JComboBox().getPreferredSize().width);
|
logColumn.setMaxWidth(logColumn.getPreferredWidth());
|
||||||
|
|
||||||
getEmptyText().setText("No notifications configured");
|
getEmptyText().setText("No notifications configured");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user