[MGNLUI-1476] All actions should be disabled in actionbar when more than one item is selected Created: 29/May/13  Updated: 14/Jun/13  Resolved: 07/Jun/13

Status: Closed
Project: Magnolia UI
Component/s: content app, framework
Affects Version/s: None
Fix Version/s: 5.0

Type: Task Priority: Neutral
Reporter: Tobias Mattsson Assignee: Jozef Chocholacek
Resolution: Fixed Votes: 0
Labels: apitem
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
is causing MGNLUI-1516 Fix ContentPresenterTest.testOnItemSe... Closed
dependency
depends upon MGNLUI-1540 The WorkbenchChooseDialogPresenter sh... Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Sprint: Beta 3, RC 1

 Description   

We should allow selecting more than one item in the workbench but we will then show all actions as disabled.

This may involve changes in both workspace and browser to make it aware of multiple selection.

Note that we do not want multi-selection in the choose dialog.



 Comments   
Comment by Tobias Mattsson [ 03/Jun/13 ]

Overall

  • In choose dialogs there's now multi selection, we don't want that.
  • The status bar changes when something more is selected, sometimes, not always. The cause of this is the use of HashSet
  • The location changes sometimes, also caused by using HashSet
  • Vaadin actually gives us a LinkedHashSet so we can use that to make this stuff predictable.
  • Switching between content views loses multiple selection, only one item is selected when switching back to tree from list

ItemsSelectedEvent

  • should be SelectionChangedEvent
  • items is a HashSet, therefore there is no guarantee what the order of the items are
  • add a method for getting the first selected item, this should always be the item that was selected first by the user
    • make sure this is used everywhere instead of getItems().iterator().next()
  • change the Set to a List with a defined order, first in the list should be the first selected by the user
  • some implementations of ItemsSelectedEvent.Handler check if items is null and some also test if it is empty, others assume that there is always at least one item
    • what is correct here? is it always of length 1 ? when nothing is selected is it the workbench root?

AbstractActionExecutor

  • not necessary to test for items != null on line 133

AvailabilityRule.isAvailable

  • javadoc is incorrect, for root the method is given an array of length 1, containing a null reference

BrowserPresenter

  • on content changed event, if the first selected item does exist then all other items are lost from selection

BrowserSubApp

  • continue using the name workbenchRootItemId, as it is then more evident that its not the workspace root
  • items.toArray(new Item[0]) should be items.toArray(new Item[items.size()]) in two places
  • logging in registerSubAppEventsHandlers can fail because event.getItemIds can be empty since its tested for just that in the try clause

JcrItemUtil

  • getItems should be named getJcrItems
  • getItems(String, List, String) needs a better name, what it does is very specific
    • maybe it can be in BrowserSubApp since that's where the use case is relevant

ThumbnailPresenter

  • getJcrItemsByThumbnailItems creates a Set containing JcrItemAdapter classes, but we don't have a equals/hashCode contract for those classes, is the intention to make the set hold any instance but only once?

AbstractContentPresenter

  • onItemSelection
    • should use JcrItemUtil to get the itemId instead of doing getIdentifier()

ContentView

  • onItemSelection needs to be generic, not clear if its JCR items, vaadin items, or item ids
  • remove commented out previous method

WorkbenchPresenter

  • select will call activePresenter.setSelectedItemId with the workbench root for every item that does not exist
  • why doesn't select(String) just package its argument in a list and pass it to select(List) ?

WorkbenchStatusBarPresenter

  • selectedItems field is updated but never read, can be removed
Comment by Tobias Mattsson [ 11/Jun/13 ]

Please rename SelectionChangedEvent.Handler.onItemSelected() to onSelectionChanged()

Generated at Mon Feb 12 08:46:57 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.