--- BeforeBranch.txt Mon Apr 7 14:02:10 2003 +++ Atbranch.commit Mon Apr 7 14:01:28 2003 @@ -3289,6 +3289,16 @@ } } + + /** Factory to create weak OperationListener + * + * @param l listener + * @param s the source the new listener will be attached to + */ + public static OperationListener createWeakOperationListener (OperationListener l, Object s) { + return (OperationListener)org.openide.util.WeakListener.create (OperationListener.class, l, s); + } + /** Add a listener for operations on data objects. * @param l the listener */ @@ -16064,6 +16074,9 @@ * @param instance the instance to check for help (it is permissible for the {@link InstanceCookie#instanceCreate} to return null) * @return the help context found on the instance or inferred from a Bean, * or null if none was found (or it was {@link HelpCtx#DEFAULT_HELP}) + * + * + * @deprecated use org.openide.util.HelpCtx.findHelp (Object) */ public static HelpCtx findHelp (InstanceCookie instance) { Class clazz = null; @@ -16076,30 +16089,13 @@ //ManifestSection.FileSystemSection.class.isAssignableFrom (clazz) || HelpCtx.class.isAssignableFrom (clazz)) { HelpCtx test; + Object obj = instance.instanceCreate (); - if (obj instanceof HelpCtx.Provider) - test = ((HelpCtx.Provider)obj).getHelpCtx(); - else if (obj instanceof WizardDescriptor.Panel) - test = ((WizardDescriptor.Panel) obj).getHelp (); - /* - else if (obj instanceof ManifestSection.FileSystemSection) - test = ((ManifestSection.FileSystemSection) obj).getHelpCtx (); - */ - else if (obj instanceof HelpCtx) - test = (HelpCtx) obj; - else - test = null; // obj==null or bad cookie - if (test != null && ! test.equals (HelpCtx.DEFAULT_HELP)) - return test; + return HelpCtx.findHelp(obj); } // If a component, look for attached help. if (JComponent.class.isAssignableFrom (clazz)) { - JComponent comp = (JComponent) instance.instanceCreate (); - if (comp != null) { - String hid = (String) comp.getClientProperty ("HelpID"); // NOI18N - if (hid != null) - return new HelpCtx (hid); - } + return HelpCtx.findHelp (instance.instanceCreate ()); } // [a.n] I have moved the code here as those components's BeanInfo do not contain helpID @@ -16114,16 +16110,7 @@ } } - // Look for Bean help. Also works on components not found above. - BeanDescriptor desc = Utilities.getBeanInfo (clazz).getBeanDescriptor (); - if (desc != null) { - // [PENDING] ideally would also look for a help set and add that to the system - // set if found, but there is no API for this at the moment - String val = (String) desc.getValue ("helpID"); // NOI18N - if (val != null) return new HelpCtx (val); - } - // All failed. - return null; + return HelpCtx.findHelp (clazz); } catch (Exception e) { ErrorManager.getDefault().notify(e); return null; @@ -18084,10 +18071,7 @@ changedUpdate (p1); } - public void addNotify () { - super.addNotify (); - newObjectName.requestFocus (); - } + /** Add a listener to changes of the panel's validity. * @param l the listener to add