Re: Clarification of Custom Property Editor
On Fri, 14 Dec 2018, 21:05 Marc Streckfuß 2. I tried using editor.setValue(obj); FROM the Swing Component in the > Swing Thread (every time any UI Component changes it's value), but this > fails with java.lang.IllegalStateException: Attempt to mutate in > notification, because my Swing Components also react to > editor.setValue() calls. > That sounds along the right lines to me, except why does your custom editor have to respond to editor.setValue() calls? If you really need to, you could use a boolean updating flag. There's a range of pages on the old website around this. Maybe this is more useful for you? https://platform.netbeans.org/tutorials/nbm-propertyeditors-integration.html Perhaps this also useful? https://github.com/apache/incubator-netbeans/tree/master/platform/o.n.core/src/org/netbeans/beaninfo/editors Or have a look in the form module. Best wishes, Neil >
Clarification of Custom Property Editor
Hello Guys, I am having a problem when implementing a Custom Property Editor and I feel like the tutorial at https://platform.netbeans.org/tutorials/nbm-property-editors.html#customEditor should be edited. The Problem is for my usecase I don't want an InplaceEditor. So far so good, everything works as expected except from the behavior when I press "ok". I haven't found a way to propagate the UI Elements content back to the property: 1. I tried using PropertyEditorSupport#getValue() in conjunction with the reference to the return of #getCustomEditor() -> This fails because there are plenty(!) instances of My Editor Class but for some reason the one holding the customEditorComponent is exactly the one _not_ getting the getValue() calls. 2. I tried using editor.setValue(obj); FROM the Swing Component in the Swing Thread (every time any UI Component changes it's value), but this fails with java.lang.IllegalStateException: Attempt to mutate in notification, because my Swing Components also react to editor.setValue() calls. I tried digging into https://github.com/apache/incubator-netbeans/blob/master/platform/openide.explorer/src/org/openide/explorer/propertysheet/PropertyDialogManager.java#L493 and related lines, but I could not find out how to set "lastValueFromEditor", or say: My calls to env.setState(PropertyEnv.STATE_VALID); should actually trigger the lastValueFromEditor to be updated, but there we'd be at issue 1 again. I guess the solution is very simple but it'd be nice if this could be clarified because more complex properties just don't work with an inplace editor. It would be nice if these steps could also be shown in the related tutorial (instead of a JLabel, one could use a simple JInputField maybe?) The only other possibility I see is instead of passing a JPanel is passing something extending Window and handle the OK/Cancel myself, but that's just hacking around the way it was intended. Kind Regards, Marc Streckfuß - To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org For additional commands, e-mail: users-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: How to Hide "Customize" under "View -> Toolbars"?
I suggest you make a PR where that action becomes a real action registered in the layer which you can then hide. In the mean time you could either keep your in-house fork of NetBeans Platform and fix that or you could use reflection and hack the static ToolbarConfiguration.toolbarMenu and see if removing the item there is sufficient for your needs. --emi http://coolbeans.xyz/ - CoolBeans: An IDE for Java, JavaEE, PHP and more! On Mon, Dec 10, 2018 at 3:41 PM Daniel Hartman wrote: > > Is there a way to hide the "Customize" menu item that appears under "View -> > Toolbars" for an application built on top of the NetBeans platform? The > "Customize" menu item is added programmatically by the ToolbarConfiguration > class in the Core - Windows module. > > Thanks in advance for any suggestions. > > Dan > > - > To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org > For additional commands, e-mail: users-h...@netbeans.apache.org > > For further information about the NetBeans mailing lists, visit: > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > - To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org For additional commands, e-mail: users-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists