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

(-)BeforeBranch.txt (-34 / +18 lines)
Lines 3289-3294 Link Here
3289
        }
3289
        }
3290
    }
3290
    }
3291
    
3291
    
3292
    
3293
    /** Factory to create weak OperationListener
3294
     *
3295
     * @param l listener
3296
     * @param s the source the new listener will be attached to
3297
     */
3298
    public static OperationListener createWeakOperationListener (OperationListener l, Object s) {
3299
        return (OperationListener)org.openide.util.WeakListener.create (OperationListener.class, l, s);
3300
    }
3301
    
3292
    /** Add a listener for operations on data objects.
3302
    /** Add a listener for operations on data objects.
3293
     * @param l the listener
3303
     * @param l the listener
3294
     */
3304
     */
Lines 16064-16069 Link Here
16064
    * @param instance the instance to check for help (it is permissible for the {@link InstanceCookie#instanceCreate} to return <code>null</code>)
16074
    * @param instance the instance to check for help (it is permissible for the {@link InstanceCookie#instanceCreate} to return <code>null</code>)
16065
    * @return the help context found on the instance or inferred from a Bean,
16075
    * @return the help context found on the instance or inferred from a Bean,
16066
    * or <code>null</code> if none was found (or it was {@link HelpCtx#DEFAULT_HELP})
16076
    * or <code>null</code> if none was found (or it was {@link HelpCtx#DEFAULT_HELP})
16077
     *
16078
     *
16079
     * @deprecated use org.openide.util.HelpCtx.findHelp (Object)
16067
    */
16080
    */
16068
    public static HelpCtx findHelp (InstanceCookie instance) {
16081
    public static HelpCtx findHelp (InstanceCookie instance) {
16069
        Class clazz = null;
16082
        Class clazz = null;
Lines 16076-16105 Link Here
16076
                    //ManifestSection.FileSystemSection.class.isAssignableFrom (clazz) ||
16089
                    //ManifestSection.FileSystemSection.class.isAssignableFrom (clazz) ||
16077
                    HelpCtx.class.isAssignableFrom (clazz)) {
16090
                    HelpCtx.class.isAssignableFrom (clazz)) {
16078
                HelpCtx test;
16091
                HelpCtx test;
16092
                
16079
                Object obj = instance.instanceCreate ();
16093
                Object obj = instance.instanceCreate ();
16080
                if (obj instanceof HelpCtx.Provider)
16094
                return HelpCtx.findHelp(obj);
16081
                    test = ((HelpCtx.Provider)obj).getHelpCtx();
16082
                else if (obj instanceof WizardDescriptor.Panel)
16083
                    test = ((WizardDescriptor.Panel) obj).getHelp ();
16084
                /*
16085
                else if (obj instanceof ManifestSection.FileSystemSection)
16086
                    test = ((ManifestSection.FileSystemSection) obj).getHelpCtx ();
16087
                */
16088
                else if (obj instanceof HelpCtx)
16089
                    test = (HelpCtx) obj;
16090
                else
16091
                    test = null;          // obj==null or bad cookie
16092
                if (test != null && ! test.equals (HelpCtx.DEFAULT_HELP))
16093
                    return test;
16094
            }
16095
            }
16095
            // If a component, look for attached help.
16096
            // If a component, look for attached help.
16096
            if (JComponent.class.isAssignableFrom (clazz)) {
16097
            if (JComponent.class.isAssignableFrom (clazz)) {
16097
                JComponent comp = (JComponent) instance.instanceCreate ();
16098
                return HelpCtx.findHelp (instance.instanceCreate ());
16098
                if (comp != null) {
16099
                    String hid = (String) comp.getClientProperty ("HelpID"); // NOI18N
16100
                    if (hid != null)
16101
                        return new HelpCtx (hid);
16102
                }
16103
            }
16099
            }
16104
16100
16105
            // [a.n] I have moved the code here as those components's BeanInfo do not contain helpID
16101
            // [a.n] I have moved the code here as those components's BeanInfo do not contain helpID
Lines 16114-16129 Link Here
16114
                }
16110
                }
16115
            }
16111
            }
16116
16112
16117
            // Look for Bean help. Also works on components not found above.
16113
            return HelpCtx.findHelp (clazz);
16118
            BeanDescriptor desc = Utilities.getBeanInfo (clazz).getBeanDescriptor ();
16119
            if (desc != null) {
16120
                // [PENDING] ideally would also look for a help set and add that to the system
16121
                // set if found, but there is no API for this at the moment
16122
                String val = (String) desc.getValue ("helpID"); // NOI18N
16123
                if (val != null) return new HelpCtx (val);
16124
            }
16125
            // All failed.
16126
            return null;
16127
        } catch (Exception e) {
16114
        } catch (Exception e) {
16128
            ErrorManager.getDefault().notify(e);
16115
            ErrorManager.getDefault().notify(e);
16129
            return null;
16116
            return null;
Lines 18084-18093 Link Here
18084
        changedUpdate (p1);
18071
        changedUpdate (p1);
18085
    }
18072
    }
18086
18073
18087
    public void addNotify () {
18074
18088
        super.addNotify ();
18089
        newObjectName.requestFocus ();
18090
    }
18091
18075
18092
    /** Add a listener to changes of the panel's validity.
18076
    /** Add a listener to changes of the panel's validity.
18093
    * @param l the listener to add
18077
    * @param l the listener to add

Return to bug 32143