Package se.conciliate.extensions.store
Interface MTAttributeType
- All Superinterfaces:
Comparable<MTNamedObject>
,MTAttributeTypeHeader
,MTHistoryEnabled
,MTNamedObject
Full interface for attribute types. There can be one or
more attribute types in a repository (there is always at least
the default attribute type). These attribute types can then
be connected to symbol types (or models) to determine the available
attributes for a symbol or model. For more information about attributes and
its types, see
MTAttributeHeader
.- Since:
- 5.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears (removes) all MTAttributes with this type as its attribute type.void
Connects this attribute type to models.void
connectToModels
(int pos) Connects this attribute type to models and gives the attribute type the given position.void
Connects this attribute type to a symbol type.void
connectToSymbolType
(SymbolType type, int pos) Connects this attribute type to a symbol type and gives the attribute type the given position.Returns all connected symbol types and its position for this attribute type.int
Returns the position of this attribute type for Models.boolean
Inspects if this attribute type is connected for models.boolean
Returns true if this attribute type is connected to the connection type and is visible in the given model type, false otherwise.void
remove()
Removes this attribute type.void
Removes this attribute type from models.void
Removes this attribute type from a symbol type.void
save()
Saves a new attribute type or saves changes to an existing one.void
setDataType
(String dataType) Sets the data type of this attribute type.void
setIconURL
(URL iconURL) Sets the URL to the icon of the attribute type.void
setInputType
(String inputType) Sets the input type for this attribute type.void
setLastModified
(Date lastModified) Overrides the last modified date of the type.void
setRefinement
(String refinement) Sets the refinement of this attribute type in the current language.void
setRefinement
(MTLanguageHeader language, String refinement) Sets the refinement of this attribute type in the given language.void
setSummary
(String summary) Sets the summary in the current language.void
setSummary
(MTLanguageHeader language, String summary) Sets the summary in a given language.void
Sets the title in the current language.void
setTitle
(MTLanguageHeader language, String title) Sets the title in a given language.void
setVisibility
(ModelType modelType, Type connectionType, boolean visible) Sets the visibility of this attribute type in the context of the model type when viewed as a connection to the connection type.Methods inherited from interface se.conciliate.extensions.store.MTAttributeTypeHeader
expand, getDataType, getIconURL, getIconURL, getInputType, getLastModified, getRefinement, getRefinement, getSummary, getSummary
Methods inherited from interface se.conciliate.extensions.store.MTHistoryEnabled
getHistory, getID, getUUID
Methods inherited from interface se.conciliate.extensions.store.MTNamedObject
compareTo, getID, getParentRevisionID, getTitle, getTitle, getUUID
-
Method Details
-
setLastModified
Overrides the last modified date of the type.- Parameters:
lastModified
- The new last modified date.- Since:
- 5.0
-
setTitle
Sets the title in the current language.- Parameters:
title
- The new title.- Since:
- 5.0
-
setTitle
Sets the title in a given language.- Parameters:
language
- The language to set the title in.title
- The new title.- Since:
- 5.0
-
setRefinement
Sets the refinement of this attribute type in the current language.- Parameters:
refinement
- the new refinement- Since:
- 5.0
- See Also:
-
setRefinement
Sets the refinement of this attribute type in the given language.- Parameters:
language
- The languagerefinement
- The new refinement- Since:
- 5.0
- See Also:
-
setSummary
Sets the summary in the current language.- Parameters:
summary
- The new summary.- Since:
- 5.0
-
setSummary
Sets the summary in a given language.- Parameters:
language
- The language to set the summary in.summary
- The new summary.- Since:
- 5.0
-
setInputType
Sets the input type for this attribute type.- Parameters:
inputType
- A string representation of the input type.- See Also:
-
setDataType
Sets the data type of this attribute type.- Parameters:
dataType
- A string representation of the data type.- See Also:
-
setIconURL
Sets the URL to the icon of the attribute type.- Parameters:
iconURL
- the icon URL.
-
setVisibility
Sets the visibility of this attribute type in the context of the model type when viewed as a connection to the connection type. After the fact comment: This property is mainly used to support filters where one wants to show attribute types based on some context. The only context is currently ModelType, meaning that a filter can be constructed so that in the context of "General model", the attribute type "Cost" is never shown for "Business objects". This method would make a lot more sense if the context was an arbitrary object (ie a string). That way, callers could use any context as a filter. As it is now, this method is only useful for UIs like the AttributeView (No, readers of this are not supposed to know about the AttributeView, but this comment makes no sense anywhere else). Simply put, this is bad API design (by me).- Parameters:
modelType
- The context where the visibility applies.connectionType
- The connected type to which the visibility applies.visible
- True to make this attribute type's attributes visible in the given context when viewed as a connection to the given connection type, false to make it hidden.- See Also:
-
isVisible
Returns true if this attribute type is connected to the connection type and is visible in the given model type, false otherwise. This method can be used to filter out which attributes to show for a given type (connectionType) in a given context (modelType).- Parameters:
modelType
- The context where the attribute type's attributes are visible.connectionType
- The connection for the attribute type.- Returns:
- true if this attribute type is connected to the connection type and visible in the given model type, false otherwise.
- See Also:
-
isConnectedToModels
boolean isConnectedToModels()Inspects if this attribute type is connected for models.- Returns:
- true if this attribute type is connected for models, otherwise false.
- Since:
- 5.0
-
getConnectedToModelPosition
int getConnectedToModelPosition()Returns the position of this attribute type for Models. The behaviour of this method is unspecified ifisConnectedToModels()
returns false.- Returns:
- the position of this attribute type for Models.
- Since:
- 5.0
-
getConnectedSymbolTypes
Map<SymbolType,Integer> getConnectedSymbolTypes()Returns all connected symbol types and its position for this attribute type. The behaviour of this method is unspecified ifisConnectedToModels()
returns true.- Returns:
- all connected symbol types and its position for this attribute type.
- Since:
- 5.0
-
connectToSymbolType
Connects this attribute type to a symbol type.- Parameters:
type
- The symbol type to connect the attribute type to.- Since:
- 5.0
-
connectToSymbolType
Connects this attribute type to a symbol type and gives the attribute type the given position. The position will be used when editing attributes for symbols of the given symbol type, to order the editor-widgets for the attributes.- Parameters:
type
- The symbol type to connect the attribute type to.pos
- The position that editors for this attribute type should have relative to each other.- Since:
- 5.0
-
connectToModels
void connectToModels()Connects this attribute type to models.- Since:
- 5.0
-
connectToModels
void connectToModels(int pos) Connects this attribute type to models and gives the attribute type the given position. The position will be used when editing attributes for models, to order the editor-widgets for the attributes.- Parameters:
pos
- The position that editors for this attribute type should have relative to each other.- Since:
- 5.0
-
removeFromSymbolType
Removes this attribute type from a symbol type. All existing attributes of this type, connected to symbols of the given symbol type, will also be removed.- Parameters:
type
- The symbol type to remove the attribute type from.- Since:
- 5.0
-
removeFromModels
void removeFromModels()Removes this attribute type from models. All existing attributes of this type connected to models will be removed as well.- Since:
- 5.0
-
save
Saves a new attribute type or saves changes to an existing one.- Throws:
MTAccessException
- If an MTAccessException occurs.- Since:
- 5.0
-
remove
Removes this attribute type. This will remove the attribute type from all models and symbols that uses it and by extension all the attributes that has this attribute type.- Throws:
MTAccessException
- If an MTAccessException occurs.- Since:
- 5.0
-
clearData
Clears (removes) all MTAttributes with this type as its attribute type.- Throws:
MTAccessException
- If an MTAccessException occurs.
-