Interface MTDataPresenter
public interface MTDataPresenter
Implementors of this interface knows how to list/convert/present
plugin-data of a given type to be able to show it in for example
lists/browser.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault void
create
(Component invoker, Point p, Consumer<MTDataPresenter.Presentable> onPersisted) Creates a new object of the given type.default void
edit
(MTDataPresenter.Presentable toEdit, Component invoker, Point p) Edits an object of the given type.findContent
(MTRepository repository, MTWorkspace workspace) Returns a query listing the available content in a workspace.default Icon
getFindIcon
(int size) Returns the icon shown when searching for entities in a browser tab.getPresentable
(MTPluginData data) Converts plugin-data to a presentable object.Returns the provider that this presenter can list/show data for.getTypeIcon
(int size) Returns an icon representing the type (16x16).Returns the name of the data type being listed.Returns the type name in plural.default boolean
Returns true if new objects can be created by the user.default boolean
Returns true if existing objects can be edited by the user.default boolean
Returns true if existing objects can be removed by the user.default boolean
isTitleEditable
(Optional<MTPluginData> value) Returns true if editing of titles is available in this model, both in general and for a specific value.default void
remove
(MTDataPresenter.Presentable toRemove) Removes an object of the given type.
-
Method Details
-
getProvider
MTDataProvider getProvider()Returns the provider that this presenter can list/show data for. -
findContent
Returns a query listing the available content in a workspace. -
getTypeName
String getTypeName()Returns the name of the data type being listed. -
getTypeNamePlural
String getTypeNamePlural()Returns the type name in plural. -
getTypeIcon
Returns an icon representing the type (16x16). It should be as close as possible to the requested size. -
getFindIcon
Returns the icon shown when searching for entities in a browser tab. The default implementation returns the type icon. -
getPresentable
Converts plugin-data to a presentable object. -
isCreatable
default boolean isCreatable()Returns true if new objects can be created by the user. -
isEditable
default boolean isEditable()Returns true if existing objects can be edited by the user.- Returns:
-
isTitleEditable
Returns true if editing of titles is available in this model, both in general and for a specific value.- Parameters:
value
- An optional value. If present the return value should reflect whether the title is editable for the specific value, otherwise it should reflect whether titles are editable in general. Models without title editing can just return false always.
-
isRemovable
default boolean isRemovable()Returns true if existing objects can be removed by the user. -
create
Creates a new object of the given type. It is up to the implementation whether it should be persisted right away or show an UI for creating the new object.onPersisted
should be called when the new object has been persisted to storage. -
edit
Edits an object of the given type. -
remove
Removes an object of the given type.
-