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)
TablePresentations
add
in interface TablePresentations
public TablePresentation getCurrent()
TablePresentations
null
if a current presentation didn't setgetCurrent
in interface TablePresentations
public void setCurrent(@Nullable TablePresentation p)
TablePresentations
setCurrent
in interface TablePresentations
public java.lang.String getSettingsString(TablePresentation p)
getSettingsString
in interface TablePresentations
p
- 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)
TablePresentations
setSettings
in interface TablePresentations
p
- presentationsettings
- user settingspublic TablePresentation getPresentation(java.lang.Object id)
TablePresentations
null
if a presentation doesn't existgetPresentation
in interface TablePresentations
public java.lang.String getCaption(java.lang.Object id)
TablePresentations
getCaption
in interface TablePresentations
public java.util.Collection<java.lang.Object> getPresentationIds()
TablePresentations
getPresentationIds
in interface TablePresentations
public void setDefault(@Nullable TablePresentation p)
TablePresentations
setDefault
in interface TablePresentations
public TablePresentation getDefault()
TablePresentations
null
if it didn't setgetDefault
in interface TablePresentations
protected void persistDefaultPresentation(@Nullable TablePresentation newDef)
public void remove(TablePresentation p)
TablePresentations
remove
in interface TablePresentations
public void modify(TablePresentation p)
TablePresentations
modify
in interface TablePresentations
public boolean isAutoSave(TablePresentation p)
TablePresentations
true
if the selected presentation has an autoSave
settings else returns false
isAutoSave
in interface TablePresentations
public boolean isGlobal(TablePresentation p)
TablePresentations
true
if the selected presentation is marked as global else returns false
isGlobal
in interface TablePresentations
public void commit()
TablePresentations
commit
in interface TablePresentations
public void commited(java.util.Set entities)
public void addListener(PresentationsChangeListener listener)
TablePresentations
addListener
in interface TablePresentations
public void removeListener(PresentationsChangeListener listener)
TablePresentations
removeListener
in interface TablePresentations
public TablePresentation getPresentationByName(java.lang.String name)
TablePresentations
null
if a presentation with such name doesn't existgetPresentationByName
in interface TablePresentations
public TablePresentation create()
create
in interface TablePresentations
protected void fireCurrentPresentationChanged(java.lang.Object oldPresentationId)
protected void firePresentationsSetChanged()
protected void fireDefaultPresentationChanged(@Nullable java.lang.Object oldPresentationId)
protected void checkLoad()
protected void clearCommitList()