public final class FavoritesPresenter extends Object implements FavoritesView.Listener
Constructor and Description |
---|
FavoritesPresenter(FavoritesView view,
FavoritesManager favoritesManager,
AppDescriptorRegistry appDescriptorRegistry,
info.magnolia.i18nsystem.I18nizer i18nizer,
info.magnolia.event.EventBus adminCentralEventBus,
LocationController locationController,
Shell shell)
Deprecated.
|
FavoritesPresenter(FavoritesView view,
FavoritesManager favoritesManager,
AppDescriptorRegistry appDescriptorRegistry,
info.magnolia.i18nsystem.I18nizer i18nizer,
LocationController locationController,
Shell shell) |
Modifier and Type | Method and Description |
---|---|
void |
addFavorite(JcrNewNodeAdapter favorite)
Adds a favorite.
|
void |
addFavoriteAndGroup(JcrNewNodeAdapter newFavorite,
JcrNewNodeAdapter newGroup)
Adding instantly a new group and a new favorite (and add the latter to the former).
|
void |
addGroup(JcrNewNodeAdapter newGroup)
Add a group.
|
JcrNewNodeAdapter |
createNewFavoriteSuggestion(String location,
String title,
String icon) |
JcrNewNodeAdapter |
createNewGroupSuggestion() |
JcrNewNodeAdapter |
determinePreviousLocation() |
void |
editFavorite(String relPath,
String newTitle)
Edit a favorite.
|
void |
editGroup(String relPath,
String newTitle)
Edit a group.
|
Map<String,String> |
getAvailableGroupsNames() |
void |
goToLocation(String location)
To go to the given location.
|
boolean |
hasItems()
Returns a boolean indicating whether there is at least one group or favorite-item exiting.
|
boolean |
itemsAreEditable()
Returns a boolean indicating whether the group- and favorite-items are currently editable which means whether they are showing or hiding the the delete- and edit-icons.
|
void |
moveFavorite(String relPath,
String group)
Moves a favorite.
|
void |
orderFavoriteAfter(String relPath,
String sibling)
Orders a favorite after a sibling.
|
void |
orderFavoriteBefore(String relPath,
String sibling)
Orders a favorite before a sibling.
|
void |
orderGroupAfter(String relPath,
String sibling)
Orders a group after a sibling.
|
void |
orderGroupBefore(String relPath,
String sibling)
Orders a group before a sibling.
|
void |
removeFavorite(String relPath)
Removes a favorite by the given path.
|
void |
removeGroup(String relPath)
Remove a group.
|
void |
setCurrentEditedItemId(String itemId)
Set the id of the EditableFavoriteItem which is currently edited.
|
void |
setItemsEditable(boolean isVisible)
Switches the all the favorite- and group-items to editable or not-editable, actually showing or hiding the the delete- and edit-icons on the items.
|
void |
setToInitialState()
Setting to the state where the EditableFavoriteItem(s) are in not-editable-state and with hidden icons.
|
FavoritesView |
start() |
@Deprecated public FavoritesPresenter(FavoritesView view, FavoritesManager favoritesManager, AppDescriptorRegistry appDescriptorRegistry, info.magnolia.i18nsystem.I18nizer i18nizer, info.magnolia.event.EventBus adminCentralEventBus, LocationController locationController, Shell shell)
FavoritesPresenter(FavoritesView, FavoritesManager, AppDescriptorRegistry, I18nizer, LocationController, Shell)
instead.@Inject public FavoritesPresenter(FavoritesView view, FavoritesManager favoritesManager, AppDescriptorRegistry appDescriptorRegistry, info.magnolia.i18nsystem.I18nizer i18nizer, LocationController locationController, Shell shell)
public FavoritesView start()
public void setToInitialState()
FavoritesView.Listener
setToInitialState
in interface FavoritesView.Listener
public void removeFavorite(String relPath)
FavoritesView.Listener
removeFavorite
in interface FavoritesView.Listener
relPath
- of the favorite to remove.public void addFavoriteAndGroup(JcrNewNodeAdapter newFavorite, JcrNewNodeAdapter newGroup)
FavoritesView.Listener
addFavoriteAndGroup
in interface FavoritesView.Listener
newFavorite
- The JcrNewNodeAdapter for the new favorite.newGroup
- The JcrNewNodeAdapter for the new group.public void addFavorite(JcrNewNodeAdapter favorite)
FavoritesView.Listener
addFavorite
in interface FavoritesView.Listener
favorite
- The JcrNewNodeAdapter for the new favorite.public void moveFavorite(String relPath, String group)
FavoritesView.Listener
moveFavorite
in interface FavoritesView.Listener
relPath
- The relative path to move the node.group
- The node-name of the group.public void orderFavoriteBefore(String relPath, String sibling)
FavoritesView.Listener
orderFavoriteBefore
in interface FavoritesView.Listener
relPath
- The path of the node to move.sibling
- The node-name of the sibling.public void orderFavoriteAfter(String relPath, String sibling)
FavoritesView.Listener
orderFavoriteAfter
in interface FavoritesView.Listener
relPath
- The path of the node to move.sibling
- The node-name of the sibling.public void orderGroupBefore(String relPath, String sibling)
FavoritesView.Listener
orderGroupBefore
in interface FavoritesView.Listener
relPath
- The path of the node to move.sibling
- The node-name of the sibling.public void orderGroupAfter(String relPath, String sibling)
FavoritesView.Listener
orderGroupAfter
in interface FavoritesView.Listener
relPath
- The node-name of the sibling.sibling
- The path of the node to move.public void setItemsEditable(boolean isVisible)
FavoritesView.Listener
setItemsEditable
in interface FavoritesView.Listener
isVisible
- boolean indicating whether the items should be set to 'editable' or 'not-editable'.public boolean itemsAreEditable()
FavoritesView.Listener
itemsAreEditable
in interface FavoritesView.Listener
public boolean hasItems()
FavoritesView.Listener
hasItems
in interface FavoritesView.Listener
public void goToLocation(String location)
FavoritesView.Listener
goToLocation
in interface FavoritesView.Listener
location
- The location to go to.public JcrNewNodeAdapter determinePreviousLocation()
public JcrNewNodeAdapter createNewFavoriteSuggestion(String location, String title, String icon)
JcrNewNodeAdapter
used to pre-populate a form in the UI with a suggestion for a new favorite.public JcrNewNodeAdapter createNewGroupSuggestion()
public void editFavorite(String relPath, String newTitle)
FavoritesView.Listener
editFavorite
in interface FavoritesView.Listener
relPath
- The relative path of the favorite to edit.newTitle
- The new title.public void addGroup(JcrNewNodeAdapter newGroup)
FavoritesView.Listener
addGroup
in interface FavoritesView.Listener
newGroup
- The JcrNewNodeAdapter for the new group.public void editGroup(String relPath, String newTitle)
FavoritesView.Listener
editGroup
in interface FavoritesView.Listener
relPath
- The relative path of the group to edit.newTitle
- The new title.public void removeGroup(String relPath)
FavoritesView.Listener
removeGroup
in interface FavoritesView.Listener
relPath
- The relative path of the group to remove.public void setCurrentEditedItemId(String itemId)
FavoritesView.Listener
setCurrentEditedItemId
in interface FavoritesView.Listener
Copyright © 2019 Magnolia International Ltd.. All rights reserved.