@Component(value="cuba_DynamicAttributesGuiTools")
public class DynamicAttributesGuiTools
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
Constructor and Description |
---|
DynamicAttributesGuiTools() |
Modifier and Type | Method and Description |
---|---|
PickerField.LookupAction |
createLookupAction(PickerField pickerField,
java.lang.String joinClause,
java.lang.String whereClause)
Creates the lookup action that will open the lookup screen with the dynamic filter applied.
|
CollectionDatasource |
createOptionsDatasourceForLookup(MetaClass metaClass,
java.lang.String joinClause,
java.lang.String whereClause)
Creates the collection datasource that is used for selecting the dynamic attribute value.
|
java.util.Set<CategoryAttribute> |
getAttributesToShowOnTheScreen(MetaClass metaClass,
java.lang.String screen,
java.lang.String component)
Get attributes which should be added automatically to the screen and component.
|
void |
initDefaultAttributeValues(BaseGenericIdEntity item,
MetaClass metaClass) |
void |
initEntityPickerField(PickerField pickerField,
CategoryAttribute categoryAttribute)
Initializes the pickerField for selecting the dynamic attribute value.
|
void |
listenCategoryChanges(Datasource ds) |
void |
listenDynamicAttributesChanges(Datasource datasource)
Enforce the datasource to change modified status if dynamic attribute is changed
|
void |
reloadDynamicAttributes(BaseGenericIdEntity entity)
Reload dynamic attributes on the entity
|
boolean |
screenContainsDynamicAttributes(View mainDatasourceView,
java.lang.String screenId)
Method checks whether any class in the view hierarchy contains dynamic attributes that must be displayed on
the current screen
|
public static final java.lang.String NAME
public void listenDynamicAttributesChanges(Datasource datasource)
public java.util.Set<CategoryAttribute> getAttributesToShowOnTheScreen(MetaClass metaClass, java.lang.String screen, @Nullable java.lang.String component)
public boolean screenContainsDynamicAttributes(View mainDatasourceView, java.lang.String screenId)
public void initDefaultAttributeValues(BaseGenericIdEntity item, MetaClass metaClass)
public void listenCategoryChanges(Datasource ds)
public void initEntityPickerField(PickerField pickerField, CategoryAttribute categoryAttribute)
pickerField
- PickerField component whose lookup action must be initializedcategoryAttribute
- CategoryAttribute that is represented by the pickerFieldpublic CollectionDatasource createOptionsDatasourceForLookup(MetaClass metaClass, java.lang.String joinClause, java.lang.String whereClause)
public PickerField.LookupAction createLookupAction(PickerField pickerField, java.lang.String joinClause, java.lang.String whereClause)
public void reloadDynamicAttributes(BaseGenericIdEntity entity)