mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Combobox in table: set popup min size via builder
This commit is contained in:
+3
-5
@@ -141,6 +141,8 @@ public class JBComboBoxTableCellEditorComponent extends JBLabel {
|
||||
if (myRenderer != null) {
|
||||
myList.setCellRenderer(myRenderer);
|
||||
}
|
||||
final Rectangle rect = myTable.getCellRect(myRow, myColumn, true);
|
||||
Point point = new Point(rect.x, rect.y);
|
||||
final boolean surrendersFocusOnKeystrokeOldValue = myTable instanceof JBTable ? ((JBTable)myTable).surrendersFocusOnKeyStroke() : myTable.getSurrendersFocusOnKeystroke();
|
||||
final JBPopup popup = JBPopupFactory.getInstance()
|
||||
.createListPopupBuilder(myList)
|
||||
@@ -178,12 +180,8 @@ public class JBComboBoxTableCellEditorComponent extends JBLabel {
|
||||
super.onClosed(event);
|
||||
}
|
||||
})
|
||||
.setMinSize(myWide ? new Dimension(((int)rect.getSize().getWidth()), -1) : null)
|
||||
.createPopup();
|
||||
final Rectangle rect = myTable.getCellRect(myRow, myColumn, true);
|
||||
Point point = new Point(rect.x, rect.y);
|
||||
if (myWide) {
|
||||
popup.setMinimumSize(new Dimension(((int)rect.getSize().getWidth()), -1));
|
||||
}
|
||||
popup.show(new RelativePoint(myTable, point));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user