public class TablePresentationsImpl extends java.lang.Object implements TablePresentations
| Modifier and Type | Field and Description |
|---|---|
protected TablePresentation |
current |
protected io.jmix.core.usersubstitution.CurrentUserSubstitution |
currentUserSubstitution |
protected io.jmix.core.DataManager |
dataManager |
protected TablePresentation |
defaultPresentation |
protected io.jmix.core.EntityStates |
entityStates |
protected io.jmix.core.FetchPlanRepository |
fetchPlanRepository |
protected java.util.List<PresentationsChangeListener> |
listeners |
protected io.jmix.core.Metadata |
metadata |
protected java.lang.String |
name |
protected java.util.Set<TablePresentation> |
needToRemove |
protected java.util.Set<TablePresentation> |
needToUpdate |
protected java.util.Map<java.lang.Object,TablePresentation> |
presentations |
| Constructor and Description |
|---|
TablePresentationsImpl(Component c) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(TablePresentation p)
Adds a new presentation
|
void |
addListener(PresentationsChangeListener listener)
Adds listener
|
protected void |
checkLoad() |
protected void |
clearCommitList() |
void |
commit()
Commits all changes into the database
|
void |
commited(java.util.Set entities) |
TablePresentation |
create() |
protected void |
fireCurrentPresentationChanged(java.lang.Object oldPresentationId) |
protected void |
fireDefaultPresentationChanged(java.lang.Object oldPresentationId) |
protected void |
firePresentationsSetChanged() |
java.lang.String |
getCaption(java.lang.Object id)
Returns presentation caption by its id
|
TablePresentation |
getCurrent()
Returns the current active presentation or
null if a current presentation didn't set |
TablePresentation |
getDefault()
Returns a default presentation or
null if it didn't set |
TablePresentation |
getPresentation(java.lang.Object id)
Returns presentation by its id or
null if a presentation doesn't exist |
TablePresentation |
getPresentationByName(java.lang.String name)
Returns a presentation by its name with ignored case.
|
java.util.Collection<java.lang.Object> |
getPresentationIds()
Returns a collection of the component presentations
|
java.lang.String |
getSettingsString(TablePresentation p) |
boolean |
isAutoSave(TablePresentation p)
Returns
true if the selected presentation has an autoSave settings else returns false |
boolean |
isGlobal(TablePresentation p)
Returns
true if the selected presentation is marked as global else returns false |
void |
modify(TablePresentation p)
Modifies the selected presentation
|
protected void |
persistDefaultPresentation(TablePresentation newDef) |
void |
remove(TablePresentation p)
Removes a presentation from the list of available presentations
|
void |
removeListener(PresentationsChangeListener listener)
Removes listener
|
void |
setCurrent(TablePresentation p)
Sets current active presentation for a component
|
void |
setDefault(TablePresentation p)
Sets a default presentation
|
void |
setSettings(TablePresentation p,
java.lang.String settings)
Sets user settings for the selected presentation
|
@Autowired protected io.jmix.core.Metadata metadata
@Autowired protected io.jmix.core.FetchPlanRepository fetchPlanRepository
@Autowired protected io.jmix.core.DataManager dataManager
@Autowired protected io.jmix.core.usersubstitution.CurrentUserSubstitution currentUserSubstitution
@Autowired protected io.jmix.core.EntityStates entityStates
protected java.lang.String name
protected java.util.Map<java.lang.Object,TablePresentation> presentations
protected TablePresentation current
protected TablePresentation defaultPresentation
protected java.util.Set<TablePresentation> needToUpdate
protected java.util.Set<TablePresentation> needToRemove
protected java.util.List<PresentationsChangeListener> listeners
public TablePresentationsImpl(Component c)
public void add(TablePresentation p)
TablePresentationsadd in interface TablePresentationspublic TablePresentation getCurrent()
TablePresentationsnull if a current presentation didn't setgetCurrent in interface TablePresentationspublic void setCurrent(@Nullable
TablePresentation p)
TablePresentationssetCurrent in interface TablePresentationspublic java.lang.String getSettingsString(TablePresentation p)
getSettingsString in interface TablePresentationsp - presentationnull if the presentation doesn't exist or if
the presentation doesn't contain any settingspublic void setSettings(TablePresentation p, @Nullable java.lang.String settings)
TablePresentationssetSettings in interface TablePresentationsp - presentationsettings - user settingspublic TablePresentation getPresentation(java.lang.Object id)
TablePresentationsnull if a presentation doesn't existgetPresentation in interface TablePresentationspublic java.lang.String getCaption(java.lang.Object id)
TablePresentationsgetCaption in interface TablePresentationspublic java.util.Collection<java.lang.Object> getPresentationIds()
TablePresentationsgetPresentationIds in interface TablePresentationspublic void setDefault(@Nullable
TablePresentation p)
TablePresentationssetDefault in interface TablePresentationspublic TablePresentation getDefault()
TablePresentationsnull if it didn't setgetDefault in interface TablePresentationsprotected void persistDefaultPresentation(@Nullable
TablePresentation newDef)
public void remove(TablePresentation p)
TablePresentationsremove in interface TablePresentationspublic void modify(TablePresentation p)
TablePresentationsmodify in interface TablePresentationspublic boolean isAutoSave(TablePresentation p)
TablePresentationstrue if the selected presentation has an autoSave settings else returns falseisAutoSave in interface TablePresentationspublic boolean isGlobal(TablePresentation p)
TablePresentationstrue if the selected presentation is marked as global else returns falseisGlobal in interface TablePresentationspublic void commit()
TablePresentationscommit in interface TablePresentationspublic void commited(java.util.Set entities)
public void addListener(PresentationsChangeListener listener)
TablePresentationsaddListener in interface TablePresentationspublic void removeListener(PresentationsChangeListener listener)
TablePresentationsremoveListener in interface TablePresentationspublic TablePresentation getPresentationByName(java.lang.String name)
TablePresentationsnull if a presentation with such name doesn't existgetPresentationByName in interface TablePresentationspublic TablePresentation create()
create in interface TablePresentationsprotected void fireCurrentPresentationChanged(java.lang.Object oldPresentationId)
protected void firePresentationsSetChanged()
protected void fireDefaultPresentationChanged(@Nullable
java.lang.Object oldPresentationId)
protected void checkLoad()
protected void clearCommitList()