Skip to content
This repository was archived by the owner on Feb 15, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,49 +80,6 @@ protected void configurePopup() {
setBorder(new SubstanceBorder(new Insets(0, 2, 2, 2)));
}

/**
* Sets the list selection index to the selectedIndex. This method is used
* to synchronize the list selection with the combo box selection.
*
* @param selectedIndex
* the index to set the list
*/
private void setListSelection(int selectedIndex) {
if (selectedIndex == -1) {
this.list.clearSelection();
} else {
this.list.setSelectedIndex(selectedIndex);
this.list.ensureIndexIsVisible(selectedIndex);
}
}

/**
* Calculates the upper left location of the popup.
*
* @return The upper left location of the popup.
*/
private Point getPopupLocation() {
Dimension popupSize = this.comboBox.getSize();
Insets insets = this.getInsets();

// reduce the width of the scrollpane by the insets so that the popup
// is the same width as the combo box.
popupSize.setSize(popupSize.width - (insets.right + insets.left), this
.getPopupHeightForRowCount(this.comboBox.getMaximumRowCount()));
Rectangle popupBounds = this.computePopupBounds(0, this.comboBox
.getBounds().height, popupSize.width, popupSize.height);
Dimension scrollSize = popupBounds.getSize();
Point popupLocation = popupBounds.getLocation();

this.scroller.setMaximumSize(scrollSize);
this.scroller.setPreferredSize(scrollSize);
this.scroller.setMinimumSize(scrollSize);

this.list.revalidate();

return new Point(popupLocation.x, popupLocation.y);
}

/*
* (non-Javadoc)
*
Expand Down