Improve selector: Add close button and allow to drag

Issue #21 resolved
Matthias Schoettle created an issue

In order for better multi-user support there needs to be a better way to close a selector. Currently this is done by tapping on the background (only in the structural view). However, if two users are using the tool this will cause problems.

I suggest that we add a close button (x) to the selector for closing it. This would also improve the code as currently the DisplayAspectScene keeps track of all opened selectors to be able to close them. Also, StructuralViewHandler is receiving the tap event and delegates it to the DisplayAspectScene. All this code has to be removed once a close button is added.

Furthermore, it would be nice to have the ability to drag the selector as it might hide something the user wants to see.

Comments (14)

  1. Matthias Schoettle reporter

    What might be helpful as well is a title that tells the user what the selection is for.

    For example: "Select return type for ...", "Select message to call ...", ...

  2. Matthias Schoettle reporter

    If we have a close button, it might make sense to add a selectorClosed method to the RamSelectorListener, otherwise elementSelected will never be called. This makes it possible to revert something when the selector is closed.

  3. Laura Martellotto

    To allow to revert something when the selector is closed, I added a selectorClosed() method in the RamSelectorListener interface. But, in order to simplify the code (because around 15 instances implement this interface with a default behavior when the close button is clicked), I added a AbstractDefaultRamSelectorListener which just destroy the selector. In this way, when you want to add a RamSelectorComponent :

    • you implement the AbstractDefaultRamSelectorListener if the close button just destroy the object, or

    • you implement the RamSelectorListener if the close button has to do something else.

  4. Matthias Schoettle reporter

    Very cool! Merci!

    Would it be possible to move the close button somewhere else? It forces the search field to become quite small (for example, when creating an implementation class). What would be quite cool is to have it in the right corner. But I am not sure if it is possible to get it there. Maybe by using setPositionRelativeToParent (but then it needs to be a child of the selector itself) ...

    Since you are working on the selector. For some reason there is no space between the search field and the list anymore. I think it should be enough to set a buffer on the south of the input container (setBufferSize(...)).

  5. Matthias Schoettle reporter

    References issue #21: Small fixes to the UI:

    • removed list of active selectors in DisplayAspectScene, because it is not needed anymore
    • added buffer to have some space between search field and list in selector
    • decreased space between close button and search field
    • renamed deleteButton to closeButton

    → <<cset eb60ec1aa435>>

  6. Log in to comment