Added ETable.setColumnSelectionPopupOn(int mouseButton, Boolean popup)
,
+ ETable.isColumnSelectionPopupOn(int mouseButton)
and
+ ETable.showColumnSelectionDialog()
methods.
+
true
, when left mouse click invokes a popup menu,
+ * or false
, when left mouse click opens a dialog for column selection.
*/
public boolean isPopupUsedFromTheCorner() {
- return popupUsedFromTheCorner;
+ synchronized (columnSelectionPopupLock) {
+ Boolean popupUsedFromTheCorner = columnSelectionPopup[1];
+ return (popupUsedFromTheCorner != null) ? popupUsedFromTheCorner.booleanValue() : false;
+ }
}
/**
- * The column selection corner can use either dialog or popup menu.
+ * The column selection corner can use either dialog or popup menu.3
and popupUsedFromTheCorner
.
+ *
+ * @param popupUsedFromTheCorner When true
, left mouse click invokes a popup menu,
+ * when false
, left mouse click opens a dialog for column selection.
*/
public void setPopupUsedFromTheCorner(boolean popupUsedFromTheCorner) {
- this.popupUsedFromTheCorner = popupUsedFromTheCorner;
+ synchronized (columnSelectionPopupLock) {
+ columnSelectionPopup[1] = popupUsedFromTheCorner ? Boolean.TRUE : Boolean.FALSE;
+ }
+ }
+
+ /**
+ * Test if the popup with column selection menu or column selection dialog
+ * is displayed as a response to the mouse event.Boolean.TRUE
when popup menu is displayed,
+ * Boolean.FALSE
when dialog is displayed,
+ * null
when nothing is displayed.
+ * @since 1.17
+ */
+ public Boolean isColumnSelectionPopupOn(int mouseButton) {
+ if (mouseButton < 0) {
+ throw new IllegalArgumentException("Button = "+mouseButton);
+ }
+ synchronized (columnSelectionPopupLock) {
+ if (mouseButton >= columnSelectionPopup.length) {
+ return null;
+ }
+ return columnSelectionPopup[mouseButton];
+ }
+ }
+
+ /**
+ * Set if popup with column selection menu or column selection dialog
+ * should be displayed as a response to the mouse event.Boolean.TRUE
when popup menu should be displayed,
+ * Boolean.FALSE
when dialog should be displayed,
+ * null
when nothing should be displayed.
+ * @since 1.17
+ */
+ public void setColumnSelectionPopupOn(int mouseButton, Boolean popup) {
+ if (mouseButton < 0) {
+ throw new IllegalArgumentException("Button = "+mouseButton);
+ }
+ synchronized (columnSelectionPopupLock) {
+ if (mouseButton >= columnSelectionPopup.length) {
+ Boolean[] csp = new Boolean[mouseButton + 1];
+ System.arraycopy(columnSelectionPopup, 0, csp, 0, columnSelectionPopup.length);
+ columnSelectionPopup = csp;
+ }
+ columnSelectionPopup[mouseButton] = popup;
+ }
+ }
+
+ /**
+ * Shows dialog that allows to show/hide columns.
+ * @since 1.17
+ */
+ public final void showColumnSelectionDialog() {
+ ColumnSelectionPanel.showColumnSelectionDialog(this);
}
/**