Custom PropertyEditor for String[] does not work properly [message #24557] |
Wed, 10 March 2004 13:12  |
Eclipse User |
|
|
|
Originally posted by: dcarlucci.sigma-iface.com
We have a custom PropertyEditor (dialog) that works fine with VCE of VAJ.
This PropertyNamesEditor is able to set an array of Strings as property
value.
--------------------------------------------------------
Example:
ivjComboBoxView.setPropertyNames(new String[]{DB_BUCH1_ZUST_ARB_SICHERH,
DB_BUCH1_ZUST_ARB_SICHERH1});
--------------------------------------------------------
In VE our PropertyNamesEditor appears when we start to edit the property but
the entered values are not set when editing is stopped.
Here what I've seen debugging the Workbench (I hope it helps):
------------------------------------------------------------ ----
(*)
org.eclipse.ve.internal.java.core.BeanFeatureEditor->#getProxyValueFromPrope
rtyEditor returns null. The reason is that the method
org.eclipse.ve.internal.java.core.BeanProxyUtilities.wrapper BeanProxy
returns null
**** start code strip of #getProxyValueFromPropertyEditor ******
...
} else {
bean =
(IJavaObjectInstance) BeanProxyUtilities.wrapperBeanProxy(
newProxy,
JavaEditDomainHelper.getResourceSet(fEditDomain),
true);
//// Since we are getting a new value, we own it. (By definition, editors
are supposed to return new instances).
////------------here bean is null in this case, so the
javaInitialisationString is not set
if (bean != null) {
((IJavaObjectInstance) bean).setInitializationString(
fPropertyEditorWrapperProxy.getJavaInitializationString());
}
}
...
**** end code strip of #getProxyValueFromPropertyEditor ******
--------------------------------------------------------
--------------------------------------------------------
(*) the method #wrapperBeanProxy returns null because the mof class of the
type has TypeKind.UNDEFINED_LITERAL set as kind
**** start code strip of #wrapperBeanProxy ******
...
//// TODO For now, if the class can't be found, then there is nothing we
can do, so we will return null.
////This may change when we have our error handling for unfound types.");
////$NON-NLS-1$
////$NON-NLS-1$
////!!!here javaClass.getKind() == TypeKind.UNDEFINED_LITERAL ist true and
null is returned
if (javaClass.getKind() == TypeKind.UNDEFINED_LITERAL) {
return null;
} else {
...
**** end code strip of #wrapperBeanProxy ******
--------------------------------------------------------
--------------------------------------------------------
(*) javaClass.getKind() is equals TypeKind.UNDEFINED_LITERAL because the
method
org.eclipse.jem.internal.adapters.jdom.JavaClassJDOMAdaptor- >#getSourceType
called in the method #reflectValues returns null. #getSourceType returns
null because the called method JDOMSearchHelper->#findType does not find the
type "String[]"
**** start code strip of #getSourceType ******
....
sourceType =
JDOMSearchHelper.findType(
javaClass.getJavaPackage().getName(), ////1.
javaClass.getJavaPackage().getName() = "java.lang"
javaClass.primGetName(), ////2. javaClass.primGetName() =
"String[]"
getSourceProject()); ////3. (all projects/packages, java.lang
package included)
////------------here sourceType is null for java.lang.String[] (WHY???)
.....
**** end code strip of #getSourceType ******
--------------------------------------------------------
I'm not sure if I understand the problem but it seems that the type String[]
is not handled properly and that the mof class of this type has
TypeKind.UNDEFINED_LITERAL instead of TypeKind.CLASS_LITERAL set. Is this a
bug?
regards,
Donato Carlucci
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03472 seconds