mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-21 17:52:27 +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.setShowGrid(false);
|
||||
myEntryTable.setDragEnabled(false);
|
||||
myEntryTable.setShowHorizontalLines(false);
|
||||
myEntryTable.setShowVerticalLines(false);
|
||||
myEntryTable.setIntercellSpacing(new Dimension(0, 0));
|
||||
|
||||
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.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) {
|
||||
final FontMetrics fontMetrics = myEntryTable.getFontMetrics(myEntryTable.getFont());
|
||||
final int width = fontMetrics.stringWidth(" " + textToMeasure + " ") + 4;
|
||||
final TableColumn checkboxColumn = myEntryTable.getTableHeader().getColumnModel().getColumn(columnIndex);
|
||||
checkboxColumn.setWidth(width);
|
||||
checkboxColumn.setPreferredWidth(width);
|
||||
checkboxColumn.setMaxWidth(width);
|
||||
checkboxColumn.setMinWidth(width);
|
||||
final TableColumn column = myEntryTable.getTableHeader().getColumnModel().getColumn(columnIndex);
|
||||
column.setResizable(false);
|
||||
column.setMaxWidth(column.getPreferredWidth());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-3
@@ -86,9 +86,9 @@ public class AvailablePluginsManagerMain extends PluginManagerMain {
|
||||
pluginsModel = new AvailablePluginsTableModel();
|
||||
pluginTable = new PluginTable(pluginsModel);
|
||||
pluginTable.getTableHeader().setReorderingAllowed(false);
|
||||
pluginTable.setColumnWidth(PluginManagerColumnInfo.COLUMN_DOWNLOADS, 60);
|
||||
pluginTable.setColumnWidth(PluginManagerColumnInfo.COLUMN_DATE, 60);
|
||||
pluginTable.setColumnWidth(PluginManagerColumnInfo.COLUMN_RATE, 70);
|
||||
pluginTable.setColumnWidth(PluginManagerColumnInfo.COLUMN_DOWNLOADS, 70);
|
||||
pluginTable.setColumnWidth(PluginManagerColumnInfo.COLUMN_DATE, 50);
|
||||
pluginTable.setColumnWidth(PluginManagerColumnInfo.COLUMN_RATE, 60);
|
||||
|
||||
return ScrollPaneFactory.createScrollPane(pluginTable);
|
||||
}
|
||||
|
||||
+1
-1
@@ -173,7 +173,7 @@ public class NotificationsConfigurablePanel extends JPanel implements Disposable
|
||||
});
|
||||
|
||||
final TableColumn logColumn = getColumnModel().getColumn(LOG_COLUMN);
|
||||
logColumn.setMaxWidth(new JComboBox().getPreferredSize().width);
|
||||
logColumn.setMaxWidth(logColumn.getPreferredWidth());
|
||||
|
||||
getEmptyText().setText("No notifications configured");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user