use of org.eclipse.scout.rt.shared.data.form.AbstractFormData in project scout.rt by eclipse.
the class AbstractForm method getFormDataClass.
protected Class<? extends AbstractFormData> getFormDataClass() {
FormData formDataAnnotation = getClass().getAnnotation(FormData.class);
// look in superclasses for annotation
Class<?> superclazz = getClass().getSuperclass();
while (formDataAnnotation == null && superclazz != null) {
formDataAnnotation = superclazz.getAnnotation(FormData.class);
superclazz = superclazz.getSuperclass();
}
if (formDataAnnotation == null) {
// no annotation found..
return null;
}
@SuppressWarnings("unchecked") Class<? extends AbstractFormData> formDataClass = formDataAnnotation.value();
if (formDataClass == null) {
return null;
}
if (AbstractFormData.class.isAssignableFrom(formDataClass) && !Modifier.isAbstract(formDataClass.getModifiers())) {
return formDataClass;
}
return null;
}
use of org.eclipse.scout.rt.shared.data.form.AbstractFormData in project scout.rt by eclipse.
the class AbstractForm method execResetSearchFilter.
/**
* Called when saving the form via {@link #resetSearchFilter()}.
* <p>
* This operation fills up the search filter and subclass override sets the formData property of the
* {@link SearchFilter#setFormData(AbstractFormData)} and adds verbose texts with
* {@link SearchFilter#addDisplayText(String)}
* <p>
* May call {@link #setSearchFilter(SearchFilter)}
* <p>
* Attaches a filled form data to the search filter if {@link #execCreateFormData()} returns a value.
*
* @param searchFilter
* is never null
*/
@ConfigOperation
@Order(10)
protected void execResetSearchFilter(final SearchFilter searchFilter) {
searchFilter.clear();
// add verbose field texts
// do not use visitor, so children can block traversal on whole subtrees
getRootGroupBox().applySearch(searchFilter);
// add verbose form texts
interceptAddSearchTerms(searchFilter);
// override may add form data
AbstractFormData data = createFormData();
if (data != null) {
exportFormData(data);
getSearchFilter().setFormData(data);
}
}
Aggregations