Lines 332-343
Link Here
|
332 |
Exceptions.printStackTrace(e); |
332 |
Exceptions.printStackTrace(e); |
333 |
} |
333 |
} |
334 |
} |
334 |
} |
335 |
|
335 |
|
336 |
/** Enable/disable display of the description area */ |
336 |
private boolean popupEnabled = true; |
337 |
void setDescriptionVisible(boolean val) { |
337 |
/** |
|
|
338 |
* Set whether or not the popup menu should be available on |
339 |
* right-click. |
340 |
* @param val If true, right-clicking the property sheet will show a popup |
341 |
* offering sorting options, show/hide description area, etc. |
342 |
* @since 6.9 |
343 |
*/ |
344 |
public final void setPopupEnabled(boolean val) { |
345 |
this.popupEnabled = val; |
346 |
} |
347 |
|
348 |
/** |
349 |
* Set the visibility of the description area. |
350 |
* |
351 |
* @param val Whether or not it should be visible |
352 |
* @since 6.9 |
353 |
*/ |
354 |
public final void setDescriptionAreaVisible (boolean val) { |
338 |
if (isDescriptionVisible() != val) { |
355 |
if (isDescriptionVisible() != val) { |
339 |
int state = psheet.getState(); |
356 |
int state = psheet.getState(); |
340 |
|
|
|
341 |
if (!val) { |
357 |
if (!val) { |
342 |
int newState = ((state & PSheet.STATE_HAS_TABS) != 0) ? PSheet.STATE_HAS_TABS : 0; |
358 |
int newState = ((state & PSheet.STATE_HAS_TABS) != 0) ? PSheet.STATE_HAS_TABS : 0; |
343 |
|
359 |
|
Lines 348-358
Link Here
|
348 |
|
364 |
|
349 |
psheet.setState(newState); |
365 |
psheet.setState(newState); |
350 |
} |
366 |
} |
351 |
|
|
|
352 |
PropUtils.saveShowDescription(val); |
353 |
} |
367 |
} |
354 |
} |
368 |
} |
355 |
|
369 |
|
|
|
370 |
/** Enable/disable display of the description area */ |
371 |
void setDescriptionVisible(boolean val) { |
372 |
setDescriptionAreaVisible (val); |
373 |
PropUtils.saveShowDescription(val); |
374 |
} |
375 |
|
356 |
boolean isDescriptionVisible() { |
376 |
boolean isDescriptionVisible() { |
357 |
return (psheet.getState() & PSheet.STATE_HAS_DESCRIPTION) != 0; |
377 |
return (psheet.getState() & PSheet.STATE_HAS_DESCRIPTION) != 0; |
358 |
} |
378 |
} |
Lines 762-769
Link Here
|
762 |
public @Deprecated boolean getDisplayWritableOnly() { |
782 |
public @Deprecated boolean getDisplayWritableOnly() { |
763 |
return false; |
783 |
return false; |
764 |
} |
784 |
} |
765 |
|
785 |
|
766 |
final void showPopup(Point p) { |
786 |
final void showPopup(Point p) { |
|
|
787 |
if (!popupEnabled) { |
788 |
return; |
789 |
} |
767 |
JMenuItem helpItem = new JMenuItem(); |
790 |
JMenuItem helpItem = new JMenuItem(); |
768 |
JRadioButtonMenuItem sortNamesItem = new JRadioButtonMenuItem(); |
791 |
JRadioButtonMenuItem sortNamesItem = new JRadioButtonMenuItem(); |
769 |
JRadioButtonMenuItem unsortedItem = new JRadioButtonMenuItem(); |
792 |
JRadioButtonMenuItem unsortedItem = new JRadioButtonMenuItem(); |