Interface IFormItemNamingService
-
public interface IFormItemNamingService
Represents a service for the form item naming.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
getUniqueName(String candidate, ItemType itemType, FormVisualEntity context, Form form)
Generates unique form item name depending on the item typevoid
rename(String newName, FormItem item)
Renames the specified form item and all of it predefined children on first level of hierarchy only.void
renameDuplicate(FormItem item, FormVisualEntity context, Form form)
Renames the specified form item and all of it children on all levels of hierarchy.void
setUniqueName(AbstractDataPath path, DataItem item, FormVisualEntity context, Form form, IDataSourceInfoAssociationService associationService, String itemName)
Sets a unique name for the specified form item and all of it predefined children on first level of hierarchy only.default void
setUniqueNameWithChildren(FormItem item, FormVisualEntity context, Form form)
Sets a unique name for the specified form item and for all of it children on all levels of hierarchy.void
setUniqueNameWithChildren(FormItem item, FormVisualEntity context, Form form, String itemName)
Sets a unique name for the specified form item and for all of it children on all levels of hierarchy.void
setUniqueNameWithChildren(String candidate, FormItem item, FormVisualEntity context, Form form)
Sets a unique name for the specified form item and for all of it children on all levels of hierarchy.
-
-
-
Method Detail
-
getUniqueName
String getUniqueName(String candidate, ItemType itemType, FormVisualEntity context, Form form)
Generates unique form item name depending on the item type- Parameters:
candidate
- the candidate for a new name, can benull
or empty.itemType
- the item type, cannot benull
context
- the object in which the current item lies, can not benull
.form
- the form, can not benull
.- Returns:
- unique form item name, never
null
-
setUniqueNameWithChildren
void setUniqueNameWithChildren(FormItem item, FormVisualEntity context, Form form, String itemName)
Sets a unique name for the specified form item and for all of it children on all levels of hierarchy.The new name will be generated automatically depending on the type of the specified
item
.- Parameters:
item
- the form item for set a unique name, can not benull
.context
- the object in which the current item lies, can not benull
.form
- the form, can not benull
.itemName
- the user defined item name, can benull
.- Throws:
IllegalArgumentException
- if thecandidate
was set for theitem
of predefined item type because forbidden to change the name of predefined item directly.
-
setUniqueNameWithChildren
default void setUniqueNameWithChildren(FormItem item, FormVisualEntity context, Form form)
Sets a unique name for the specified form item and for all of it children on all levels of hierarchy.The new name will be generated automatically depending on the type of the specified
item
.- Parameters:
item
- the form item for set a unique name, can not benull
.context
- the object in which the current item lies, can not benull
.form
- the form, can not benull
.- Throws:
IllegalArgumentException
- if thecandidate
was set for theitem
of predefined item type because forbidden to change the name of predefined item directly.
-
setUniqueNameWithChildren
void setUniqueNameWithChildren(String candidate, FormItem item, FormVisualEntity context, Form form)
Sets a unique name for the specified form item and for all of it children on all levels of hierarchy.- Parameters:
candidate
- the candidate for a new name, can not benull
or empty.item
- the form item for set a unique name, can not benull
.context
- the object in which the current item lies, can not benull
.form
- the form, can not benull
.- Throws:
IllegalArgumentException
- if thecandidate
was set for theitem
of predefined item type because forbidden to change the name of predefined item directly.
-
setUniqueName
void setUniqueName(AbstractDataPath path, DataItem item, FormVisualEntity context, Form form, IDataSourceInfoAssociationService associationService, String itemName)
Sets a unique name for the specified form item and all of it predefined children on first level of hierarchy only.- Parameters:
path
- the data path, can not benull
or empty.item
- the form item for which a new name will be set, can not benull
.context
- the object in which the current item lies, can not benull
.form
- the form, can not benull
.associationService
- the special information service, can not benull
.itemName
- the use defined item name, can benull
.- Throws:
IllegalArgumentException
- if theitem
has predefined item type because forbidden to change the name of predefined item directly.
-
rename
void rename(String newName, FormItem item)
Renames the specified form item and all of it predefined children on first level of hierarchy only.- Parameters:
newName
- the new name, can not benull
or empty.item
- the form item for set a unique name, can not benull
.- Throws:
IllegalArgumentException
- in the following cases:- If the specified
newName
was set for theitem
of predefined item type because forbidden to change the predefined item name directly.- If the specified
newName
is not unique in context of form.- If the specified
-
renameDuplicate
void renameDuplicate(FormItem item, FormVisualEntity context, Form form)
Renames the specified form item and all of it children on all levels of hierarchy.The unique name will be set for the specified
item
by the old name of it with updated number in the postfix of name. This works just as if a duplicate was created and would have a new unique name.- Parameters:
item
- the form item for set a unique name, can not benull
.context
- the context of the specified form item usage, can not benull
.form
- the form, can not benull
.- Throws:
IllegalArgumentException
- if theitem
has predefined item type because forbidden to copy the predefined item directly.
-
-