This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 217624
Collapse All | Expand All

(-)openide.explorer/apichanges.xml (+15 lines)
Lines 50-55 Link Here
50
<apidef name="explorer">Explorer API</apidef>
50
<apidef name="explorer">Explorer API</apidef>
51
</apidefs>
51
</apidefs>
52
<changes>
52
<changes>
53
    <change id="PropertySheetExtensions">
54
        <api name="explorer"/>
55
        <summary>PropertySheet extensions</summary>
56
        <version major="6" minor="47"/>
57
        <date day="30" month="8" year="2012"/>
58
        <author login="saubrecht"/>
59
        <compatibility binary="compatible" source="compatible" deprecation="no" deletion="no" addition="yes"/>
60
        <description>
61
            PropertySheet class has new methods which allow subclasses to provide custom
62
            popup menu, check expansion state, expand/collapse property categories,
63
            retrieve the selected property.
64
        </description>
65
        <class package="org.openide.explorer.propertysheet" name="PropertySheet"/>
66
        <issue number="217624"/>
67
    </change>
53
    <change id="OutlineView_setPropertyColumnAttribute">
68
    <change id="OutlineView_setPropertyColumnAttribute">
54
        <api name="explorer"/>
69
        <api name="explorer"/>
55
        <summary>setPropertyColumnAttribute() method added to OutlineView</summary>
70
        <summary>setPropertyColumnAttribute() method added to OutlineView</summary>
(-)openide.explorer/manifest.mf (-1 / +1 lines)
Lines 2-6 Link Here
2
OpenIDE-Module: org.openide.explorer
2
OpenIDE-Module: org.openide.explorer
3
OpenIDE-Module-Localizing-Bundle: org/openide/explorer/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/openide/explorer/Bundle.properties
4
AutoUpdate-Essential-Module: true
4
AutoUpdate-Essential-Module: true
5
OpenIDE-Module-Specification-Version: 6.46
5
OpenIDE-Module-Specification-Version: 6.47
6
6
(-)openide.explorer/src/org/openide/explorer/propertysheet/PropertySheet.java (-1 / +49 lines)
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

Return to bug 217624