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.
Class JamPropertyButton contains method getValue() that return value of property from PropertySheet. This value is counted as : String description = jComponent.getAccessibleContext().getAccessibleName(); return description.substring(description.lastIndexOf(':') + 2); It means, that from accessible description gets only string after last occurence of ':', this is incorrect trimm !!! What about property type Icon ?! Value is : "Classpath: /data/myPicture.gif" but getValue returns only "/data/myPicture.gif" or URL ?! Value is : "URL: http://www.netbeans.org/myPicture.gif" but getValue returns only "/www.netebeans.org/myPicture.gif" And maybe new pottentional problem arise if property value isn't valid, how can we test it ?? (if value is invalid , red-rectangle icon displayed, accessible description is : "<property_name>: Invalid value Classpath: /data/myPicture.gif" ) Why P2 ? : I am testing property sheet and property editors and I need get real value of the property, not trimmed !!! SUGGESTION: - add new method public String getRealValue() { verify(); if (flagValueButton) { return jComponent.getAccessibleContext().getAccessibleName(); } else if (flagNameButton) { getPropertyValueButton().getValue(); } throw new JamRuntimeException("getValue() for dotDotDotButton"); }
OK. I would suggest to use SheetButton.toString() to get real value: if (flagValueButton) { String toStringValue = jComponent.toString(); return toStringValue.substring(toStringValue.indexOf("[ \"")+3, toStringValue.indexOf("\" ]")); } else if (flagNameButton) { getPropertyValueButton().getValue(); } It should work. Any objections?
Ok, I agree, this is better solution as my one.
Fixed both in trunk and release33. jelly-nb.jar also updated.
New problems with property type Color arise, please add method getRealValue in JamPropertyButton. Thanks in advance.
I would suggest you fix getValue() to trim smarter rather than implementing getRealValue() This should be easy to do.
I revert to use again getAccessibleContext() but it uses better parsing (I hope).
verified, it works fine now, thanks Jirka.