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 20794
Collapse All | Expand All

(-)openide/src/org/openide/explorer/propertysheet/Bundle.properties (-1 / +3 lines)
Lines 6-12 Link Here
6
# http://www.sun.com/
6
# http://www.sun.com/
7
# 
7
# 
8
# The Original Code is NetBeans. The Initial Developer of the Original
8
# The Original Code is NetBeans. The Initial Developer of the Original
9
# Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
9
# Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
10
# Microsystems, Inc. All Rights Reserved.
10
# Microsystems, Inc. All Rights Reserved.
11
11
12
12
Lines 40-45 Link Here
40
ACS_CTL_VisibleWritableOnly=Show Editable Properties Only
40
ACS_CTL_VisibleWritableOnly=Show Editable Properties Only
41
CTL_Customize=Customizer
41
CTL_Customize=Customizer
42
ACS_CTL_Customize=Customizer
42
ACS_CTL_Customize=Customizer
43
CTL_Help=Help
44
ACS_CTL_Help=Help
43
45
44
# PropertyPanel
46
# PropertyPanel
45
# This message is printed to ide.log if user is customizing an object as bean 
47
# This message is printed to ide.log if user is customizing an object as bean 
(-)openide/src/org/openide/explorer/propertysheet/PropertySheet.java (-1 / +46 lines)
Lines 7-13 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 * 
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
Lines 116-121 Link Here
116
    static protected Icon         iCustomize;
116
    static protected Icon         iCustomize;
117
    
117
    
118
    static final String PROP_HAS_CUSTOMIZER = "hasCustomizer"; // NOI18N
118
    static final String PROP_HAS_CUSTOMIZER = "hasCustomizer"; // NOI18N
119
    static final String PROP_PAGE_HELP_ID = "pageHelpID"; // NOI18N
119
    
120
    
120
    private static String getString(String key) {
121
    private static String getString(String key) {
121
        return NbBundle.getBundle(PropertySheet.class).getString(key);
122
        return NbBundle.getBundle(PropertySheet.class).getString(key);
Lines 310-315 Link Here
310
        if (index != pages.getSelectedIndex ()) {
311
        if (index != pages.getSelectedIndex ()) {
311
            pages.setSelectedIndex (index);
312
            pages.setSelectedIndex (index);
312
        }
313
        }
314
        firePropertyChange(PROP_PAGE_HELP_ID, null, null);
313
    }
315
    }
314
316
315
    /**
317
    /**
Lines 331-336 Link Here
331
    public int getCurrentPage () {
333
    public int getCurrentPage () {
332
        return pages.getSelectedIndex ();
334
        return pages.getSelectedIndex ();
333
    }
335
    }
336
    
337
    String getPageHelpID() {
338
        if (isAncestorOf(pages)) {
339
            Component comp = pages.getSelectedComponent();
340
            if (comp instanceof PropertySheetTab) {
341
                String helpID = ((PropertySheetTab)comp).getHelpID();
342
                if (helpID != null) {
343
                    return helpID;
344
                }
345
            }
346
        }
347
        return null;
348
    }
334
349
335
    /**
350
    /**
336
    * Set whether buttons in sheet should be plastic.
351
    * Set whether buttons in sheet should be plastic.
Lines 477-482 Link Here
477
        if (selectedTabName != null) {
492
        if (selectedTabName != null) {
478
            setCurrentPage(selectedTabName);
493
            setCurrentPage(selectedTabName);
479
        }
494
        }
495
        firePropertyChange(PROP_PAGE_HELP_ID, null, null);
480
    }
496
    }
481
497
482
    /**
498
    /**
Lines 525-530 Link Here
525
//        JOptionPane.showMessageDialog(null, activeNode.getCustomizer(), "", JOptionPane.CLOSED_OPTION);
541
//        JOptionPane.showMessageDialog(null, activeNode.getCustomizer(), "", JOptionPane.CLOSED_OPTION);
526
    }
542
    }
527
    
543
    
544
    /** Show help on the selected tab.
545
     */
546
    void invokeHelp() {
547
        try {
548
            Class c = Class.forName("org.openide.explorer.propertysheet.PropertySheet$HelpInvoker"); // NOI18N
549
            Runnable r = (Runnable)c.newInstance();
550
            current.set(this);
551
            r.run();
552
            return;
553
        } catch (Exception e) {
554
            // if something went wrong just
555
            // don't bother (IDE probably not present, cannot show help)
556
        } catch (LinkageError e) {
557
        }
558
    }
559
    
528
    static ThreadLocal current = new ThreadLocal();
560
    static ThreadLocal current = new ThreadLocal();
529
    
561
    
530
    
562
    
Lines 540-545 Link Here
540
                throw new IllegalStateException();
572
                throw new IllegalStateException();
541
            }
573
            }
542
            org.openide.TopManager.getDefault ().getNodeOperation ().customize (instance.activeNode);
574
            org.openide.TopManager.getDefault ().getNodeOperation ().customize (instance.activeNode);
575
        }
576
    }
577
    
578
    /** Shows help for the selected tab without using the top manager.
579
     */
580
    static class HelpInvoker implements Runnable {
581
        public void run() {
582
            PropertySheet instance = (PropertySheet)current.get();
583
            current.set(null);
584
            if (instance == null || instance.getPageHelpID() == null){
585
                throw new IllegalStateException();
586
            }
587
            org.openide.TopManager.getDefault().showHelp(new HelpCtx(instance.getPageHelpID()));
543
        }
588
        }
544
    }
589
    }
545
590
(-)openide/src/org/openide/explorer/propertysheet/PropertySheetToolbar.java (-1 / +23 lines)
Lines 7-13 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 * 
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
Lines 48-53 Link Here
48
    /** Set of buttons. */
48
    /** Set of buttons. */
49
    private ToolbarToggleButton   bNoSort, bAlphaSort, bTypeSort, bDisplayWritableOnly;
49
    private ToolbarToggleButton   bNoSort, bAlphaSort, bTypeSort, bDisplayWritableOnly;
50
    private ToolbarButton         customizer;
50
    private ToolbarButton         customizer;
51
    /** Show help on the active property sheet tab (Node.PropertySet) if applicable.
52
     * Does not show node- nor property-level help.
53
     * @see #20794
54
     */
55
    private ToolbarButton         help;
51
    
56
    
52
    /** When firing back to the PropertySheet we should not react to changes -
57
    /** When firing back to the PropertySheet we should not react to changes -
53
     * - this should prevent the loop.
58
     * - this should prevent the loop.
Lines 112-117 Link Here
112
        customizer.setToolTipText(getString("CTL_Customize"));
117
        customizer.setToolTipText(getString("CTL_Customize"));
113
        customizer.setEnabled(false);
118
        customizer.setEnabled(false);
114
        customizer.addActionListener(this);
119
        customizer.addActionListener(this);
120
        
121
        ts = new Toolbar.Separator();
122
        add(ts);
123
        ts.updateUI();
124
        
125
        add(help = new ToolbarButton(new ImageIcon(Utilities.loadImage(
126
            "org/openide/resources/propertysheet/help.gif")))); // NOI18N
127
        
128
        help.getAccessibleContext().setAccessibleName(getString("ACS_CTL_Help"));
129
        help.setToolTipText(getString("CTL_Help"));
130
        help.setEnabled(false);
131
        help.addActionListener(this);
115
    }
132
    }
116
133
117
    
134
    
Lines 128-133 Link Here
128
            setSortingMode(PropertySheet.SORTED_BY_TYPES);
145
            setSortingMode(PropertySheet.SORTED_BY_TYPES);
129
        } else if(source == customizer) {
146
        } else if(source == customizer) {
130
            mySheet.invokeCustomization();
147
            mySheet.invokeCustomization();
148
        } else if (source == help) {
149
            mySheet.invokeHelp();
131
        } else if(source == bDisplayWritableOnly) {
150
        } else if(source == bDisplayWritableOnly) {
132
            ignorePropertyChange = true;
151
            ignorePropertyChange = true;
133
            try {
152
            try {
Lines 174-179 Link Here
174
        }
193
        }
175
        if (evt.getPropertyName().equals(PropertySheet.PROP_HAS_CUSTOMIZER)) {
194
        if (evt.getPropertyName().equals(PropertySheet.PROP_HAS_CUSTOMIZER)) {
176
            customizer.setEnabled(((Boolean)evt.getNewValue()).booleanValue());
195
            customizer.setEnabled(((Boolean)evt.getNewValue()).booleanValue());
196
        }
197
        if (evt.getPropertyName().equals(PropertySheet.PROP_PAGE_HELP_ID)) {
198
            help.setEnabled(mySheet.getPageHelpID() != null);
177
        }
199
        }
178
    }
200
    }
179
    
201
    
(-)openide/test/stdalone/src/org/openide/stdalonetest/TestClassResolution.java (+1 lines)
Lines 46-51 Link Here
46
        "org/openide/explorer/propertysheet/PropertyPanel$PropertySheetSettingsInvoker",
46
        "org/openide/explorer/propertysheet/PropertyPanel$PropertySheetSettingsInvoker",
47
        "org/openide/explorer/propertysheet/PropertySheet$PropertySheetSettingsInvoker",
47
        "org/openide/explorer/propertysheet/PropertySheet$PropertySheetSettingsInvoker",
48
        "org/openide/explorer/propertysheet/PropertySheet$CustomizationInvoker",
48
        "org/openide/explorer/propertysheet/PropertySheet$CustomizationInvoker",
49
        "org/openide/explorer/propertysheet/PropertySheet$HelpInvoker",
49
        "org/openide/explorer/view/DragDropUtilities$WarningInvoker",
50
        "org/openide/explorer/view/DragDropUtilities$WarningInvoker",
50
        "org/openide/explorer/ExplorerActions$DestroyInvoker",
51
        "org/openide/explorer/ExplorerActions$DestroyInvoker",
51
        "org/openide/explorer/ExplorerActions$ConfirmationInvoker",
52
        "org/openide/explorer/ExplorerActions$ConfirmationInvoker",

Return to bug 20794