|
|
|
@ -113,7 +113,7 @@ public class HeaderAreaPane extends JPanel {
|
|
|
|
|
SortColumnRowPane columnRowPane; |
|
|
|
|
JLayeredPane jLayeredPane; |
|
|
|
|
UIComboBox uiComboBox; |
|
|
|
|
boolean populateBeaning; |
|
|
|
|
boolean showHeaderArea; |
|
|
|
|
|
|
|
|
|
AreaJLayeredPane() { |
|
|
|
|
this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); |
|
|
|
@ -132,36 +132,37 @@ public class HeaderAreaPane extends JPanel {
|
|
|
|
|
uiComboBox.addItemListener(new ItemListener() { |
|
|
|
|
@Override |
|
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
|
if (e.getStateChange() != uiComboBox.getSelectedIndex()) { |
|
|
|
|
setSortColumnRowPaneShow(uiComboBox.getSelectedIndex() == 1); |
|
|
|
|
if ((showHeaderArea ? 1 : 0) != uiComboBox.getSelectedIndex()) { |
|
|
|
|
triggerItemChanged(uiComboBox.getSelectedIndex()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
uiComboBox.setEnabled(false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void triggerItemChanged(Integer index) { |
|
|
|
|
setSortColumnRowPaneShow(index == 1); |
|
|
|
|
if (index == 1) { |
|
|
|
|
ColumnRow columnRow = columnRowPane.updateBean(); |
|
|
|
|
if (cellSelectionManager.isNotSelectables(columnRow)) { |
|
|
|
|
columnRowPane.setColumnRow(ColumnRow.ERROR); |
|
|
|
|
} else { |
|
|
|
|
cellSelectionManager.addNotSelectables(columnRow); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
cellSelectionManager.removeNotSelectables(columnRowPane.updateBean()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void setSortColumnRowPaneShow(boolean show) { |
|
|
|
|
if (show) { |
|
|
|
|
jLayeredPane.setLayer(columnRowPane, JLayeredPane.POPUP_LAYER); |
|
|
|
|
jLayeredPane.setLayer(uiComboBox, JLayeredPane.MODAL_LAYER); |
|
|
|
|
if (!populateBeaning) { |
|
|
|
|
ColumnRow columnRow = columnRowPane.updateBean(); |
|
|
|
|
if (cellSelectionManager.isNotSelectables(columnRow)) { |
|
|
|
|
columnRowPane.setColumnRow(ColumnRow.ERROR); |
|
|
|
|
} else { |
|
|
|
|
cellSelectionManager.addNotSelectables(columnRow); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
jLayeredPane.setLayer(uiComboBox, JLayeredPane.POPUP_LAYER); |
|
|
|
|
jLayeredPane.setLayer(columnRowPane, JLayeredPane.MODAL_LAYER); |
|
|
|
|
if (!populateBeaning) { |
|
|
|
|
cellSelectionManager.removeNotSelectables(columnRowPane.updateBean()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
showHeaderArea = show; |
|
|
|
|
refresh(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -175,16 +176,11 @@ public class HeaderAreaPane extends JPanel {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void populateBean(ColumnRow columnRow, boolean showHeaderArea, boolean enabled) { |
|
|
|
|
populateBeaning = true; |
|
|
|
|
cellSelectionManager.build(); |
|
|
|
|
columnRowPane.populateBean(columnRow, enabled, cellSelectionManager); |
|
|
|
|
if (showHeaderArea) { |
|
|
|
|
uiComboBox.setSelectedIndex(1); |
|
|
|
|
} else { |
|
|
|
|
uiComboBox.setSelectedIndex(0); |
|
|
|
|
} |
|
|
|
|
setSortColumnRowPaneShow(showHeaderArea); |
|
|
|
|
uiComboBox.setSelectedIndex(showHeaderArea ? 1 : 0); |
|
|
|
|
uiComboBox.setEnabled(enabled); |
|
|
|
|
populateBeaning = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public ColumnRow updateBean() { |
|
|
|
|