Lines 859-870
Link Here
|
859 |
final void showPopup(Point p) { |
859 |
final void showPopup(Point p) { |
860 |
if( !popupEnabled ) |
860 |
if( !popupEnabled ) |
861 |
return; |
861 |
return; |
|
|
862 |
|
863 |
JPopupMenu popup = createPopupMenu(); |
864 |
|
865 |
if( null == popup ) { |
862 |
JMenuItem helpItem = new JMenuItem(); |
866 |
JMenuItem helpItem = new JMenuItem(); |
863 |
JRadioButtonMenuItem sortNamesItem = new JRadioButtonMenuItem(); |
867 |
JRadioButtonMenuItem sortNamesItem = new JRadioButtonMenuItem(); |
864 |
JRadioButtonMenuItem unsortedItem = new JRadioButtonMenuItem(); |
868 |
JRadioButtonMenuItem unsortedItem = new JRadioButtonMenuItem(); |
865 |
JCheckBoxMenuItem descriptionItem = new JCheckBoxMenuItem(); |
869 |
JCheckBoxMenuItem descriptionItem = new JCheckBoxMenuItem(); |
866 |
JMenuItem defaultValueItem = new JMenuItem(); |
870 |
JMenuItem defaultValueItem = new JMenuItem(); |
867 |
JPopupMenu popup = new JPopupMenu(); |
871 |
popup = new JPopupMenu(); |
868 |
|
872 |
|
869 |
unsortedItem.setSelected(getSortingMode() == UNSORTED); |
873 |
unsortedItem.setSelected(getSortingMode() == UNSORTED); |
870 |
sortNamesItem.setSelected(getSortingMode() == SORTED_BY_NAMES); |
874 |
sortNamesItem.setSelected(getSortingMode() == SORTED_BY_NAMES); |
Lines 887-895
Link Here
|
887 |
popup.add(defaultValueItem); |
891 |
popup.add(defaultValueItem); |
888 |
popup.add(new JSeparator()); |
892 |
popup.add(new JSeparator()); |
889 |
popup.add(helpItem); |
893 |
popup.add(helpItem); |
|
|
894 |
} |
890 |
popup.show(psheet, p.x, p.y); |
895 |
popup.show(psheet, p.x, p.y); |
891 |
} |
896 |
} |
892 |
|
897 |
|
|
|
898 |
/** |
899 |
* Subclasses may override this method to create a custom popup menu that will |
900 |
* show on right-click in the property sheet. |
901 |
* @return Custom popup menu or null to use the default popup menu provided |
902 |
* by this class. |
903 |
* @since 6.47 |
904 |
*/ |
905 |
protected JPopupMenu createPopupMenu() { |
906 |
return null; |
907 |
} |
908 |
|
909 |
/** |
910 |
* Check if the PropertySet the given property belongs to is expanded or not. |
911 |
* @param fd Property or PropertySet to check. |
912 |
* @return True if the PropertySet the given property belongs is expanded. |
913 |
* @since 6.47 |
914 |
*/ |
915 |
protected final boolean isExpanded( FeatureDescriptor fd ) { |
916 |
return table.getPropertySetModel().isExpanded( fd ); |
917 |
} |
918 |
|
919 |
/** |
920 |
* Expand or collapse the PropertySet the given property belongs to. |
921 |
* @param fd |
922 |
* @since 6.47 |
923 |
*/ |
924 |
protected final void toggleExpanded( FeatureDescriptor fd ) { |
925 |
int index = table.getPropertySetModel().indexOf( fd ); |
926 |
if( index >= 0 ) { |
927 |
table.getPropertySetModel().toggleExpanded( WIDTH ); |
928 |
} |
929 |
} |
930 |
|
931 |
/** |
932 |
* Retrieve currently selected property or PropertySet. |
933 |
* @return Selected property or PropertySet or null if there is no selection. |
934 |
* @since 6.47 |
935 |
*/ |
936 |
protected final FeatureDescriptor getSelection() { |
937 |
return table.getSelection(); |
938 |
} |
939 |
|
940 |
|
893 |
Node[] getCurrentNodes() { |
941 |
Node[] getCurrentNodes() { |
894 |
Node n = pclistener.getNode(); |
942 |
Node n = pclistener.getNode(); |
895 |
|
943 |
|