Pivot
  1. Pivot
  2. PIVOT-737

TerraTableViewSkin opens a TableViewRowEditor listening to both mouse buttons

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.1
    • Component/s: wtk-terra
    • Labels:
      None

      Description

      The default TerraTableViewSkin initiates a TableViewRowEditor without regard for which mouse button is pressed.
      The problem is in the functions mouseClick() and mouseDown() which should be fixed to distinguish between left and right mouse click.

        Activity

        Hide
        Raffaele Borrelli added a comment -

        Thanks Sandro and Greg, I was having the problem with multiple selection in my application but I couldn't figure out where it was coming from. Now everything works fine.

        Show
        Raffaele Borrelli added a comment - Thanks Sandro and Greg, I was having the problem with multiple selection in my application but I couldn't figure out where it was coming from. Now everything works fine.
        Hide
        Sandro Martini added a comment -

        Resolved.

        Then to test multiple selection (for example to ensure no side effects), you can use the following test bxml files:

        multiple_selection_list.bxml
        multiple_selection_table.bxml
        multiple_selection_tree.bxml

        Show
        Sandro Martini added a comment - Resolved. Then to test multiple selection (for example to ensure no side effects), you can use the following test bxml files: multiple_selection_list.bxml multiple_selection_table.bxml multiple_selection_tree.bxml
        Hide
        Greg Brown added a comment -

        It is preferable to leave things stable in SVN whenever possible. Reverting the change was the simplest way to do that.

        Show
        Greg Brown added a comment - It is preferable to leave things stable in SVN whenever possible. Reverting the change was the simplest way to do that.
        Hide
        Sandro Martini added a comment - - edited

        Just committed a new fix and some test bxml for multiple selection

        Show
        Sandro Martini added a comment - - edited Just committed a new fix and some test bxml for multiple selection
        Hide
        Greg Brown added a comment -

        The changes for this fix were reverted since they broke multi-select in ListView, TableView, and TreeView.

        Show
        Greg Brown added a comment - The changes for this fix were reverted since they broke multi-select in ListView, TableView, and TreeView.
        Hide
        Sandro Martini added a comment -

        Fixed, and to ensure that all is good, add a contextual menu on Right Click in both Tests User applications, reusing the new version of ContextMenus (under Tests), with more combinations of elements.

        If something is not Ok, be free to reopen the ticket.

        Show
        Sandro Martini added a comment - Fixed, and to ensure that all is good, add a contextual menu on Right Click in both Tests User applications, reusing the new version of ContextMenus (under Tests), with more combinations of elements. If something is not Ok, be free to reopen the ticket.
        Hide
        Sandro Martini added a comment -

        Hi Greg, I'll try to clarify the part related to the Contextual menu (I agree tha wasn't so clear, even for me, now that I re-read it ):
        in the Nabble thread ( http://apache-pivot-users.399431.n3.nabble.com/Disable-Menu-Item-td2865710.html ) Raffaele said:
        > You can use the context-menu example provided by pivot tutorial. I just added the line of code: whatIsThisMenuItem.setEnabled(false);
        to the file ContextMenu.java (at line 40). The context menu is still visible and working. Can you reproduce it?
        >
        > In the meanwhile I found the problem. If the action is removed then setEnabled(false) warks as it should. Apparently you must have a null action, or the menu item is forced to be enabled. Is this true?
        >
        etc ...

        So this part of my proposal was that if I add the line
        whatIsThisMenuItem.setEnabled(false);
        in the ContextMenus Tutorial, the context menu is visible the same ... is it a bug ?
        And last, if Yes, what do you think if I'd add a radio button (on top of the window containing the components of that Tutorial) so we could see what happens enabling/disabling the contextual menu ? Otherwise I could add a similar Test class, more in line with user tests.

        I hope to be clear this time ... what do you think ?

        Show
        Sandro Martini added a comment - Hi Greg, I'll try to clarify the part related to the Contextual menu (I agree tha wasn't so clear, even for me, now that I re-read it ): in the Nabble thread ( http://apache-pivot-users.399431.n3.nabble.com/Disable-Menu-Item-td2865710.html ) Raffaele said: > You can use the context-menu example provided by pivot tutorial. I just added the line of code: whatIsThisMenuItem.setEnabled(false); to the file ContextMenu.java (at line 40). The context menu is still visible and working. Can you reproduce it? > > In the meanwhile I found the problem. If the action is removed then setEnabled(false) warks as it should. Apparently you must have a null action, or the menu item is forced to be enabled. Is this true? > etc ... So this part of my proposal was that if I add the line whatIsThisMenuItem.setEnabled(false); in the ContextMenus Tutorial, the context menu is visible the same ... is it a bug ? And last, if Yes, what do you think if I'd add a radio button (on top of the window containing the components of that Tutorial) so we could see what happens enabling/disabling the contextual menu ? Otherwise I could add a similar Test class, more in line with user tests. I hope to be clear this time ... what do you think ?
        Hide
        Greg Brown added a comment -

        Thanks for making this fix Sandro. I have not tested it, but your changes to the code look good.

        I'm not sure what you mean by this:

        "on the contextual menu issue (in the original thread, on nabble), do you think could be useful for example to add a radio button in that demo (at the top of the window) so the user could choose between contextual menu enabled (default) and disabled, to see even if/when this is right ?"

        Can you clarify?

        Show
        Greg Brown added a comment - Thanks for making this fix Sandro. I have not tested it, but your changes to the code look good. I'm not sure what you mean by this: "on the contextual menu issue (in the original thread, on nabble), do you think could be useful for example to add a radio button in that demo (at the top of the window) so the user could choose between contextual menu enabled (default) and disabled, to see even if/when this is right ?" Can you clarify?
        Hide
        Sandro Martini added a comment - - edited

        Ciao Raffaele, Yes, even to me the proposed change (to mouseDown() ) makes sense, but this part of the issue is by design (and after we have to test each Pivot component to see if it works in the same way).
        I've just tried what happens in Linux (for example in GNome, under Ubuntu 10.x):
        selections inside table/list/trees are handled even with right click, and where there is a context menu (related to the selected element), it's opened.

        At this point the only thing that I think we could do on right click on selections (to mouseDown() ) is to see if the current situation is working even for Raffaele (for example to work like in Ubuntu), or maybe think to add a style where we could eneble/disable selection on right click ... from an usability point of view this could be a little but useful feature I think.

        Greg, Chris, and others, comments ?

        Show
        Sandro Martini added a comment - - edited Ciao Raffaele, Yes, even to me the proposed change (to mouseDown() ) makes sense, but this part of the issue is by design (and after we have to test each Pivot component to see if it works in the same way). I've just tried what happens in Linux (for example in GNome, under Ubuntu 10.x): selections inside table/list/trees are handled even with right click, and where there is a context menu (related to the selected element), it's opened. At this point the only thing that I think we could do on right click on selections (to mouseDown() ) is to see if the current situation is working even for Raffaele (for example to work like in Ubuntu), or maybe think to add a style where we could eneble/disable selection on right click ... from an usability point of view this could be a little but useful feature I think. Greg, Chris, and others, comments ?
        Hide
        Raffaele Borrelli added a comment -

        That is exactly what I wanted. I have a TableView with both a RowEditor and a contextual menu installed, right clicking should open the contextual menu, left clicking should start the row editor. Is this ok for you?

        Show
        Raffaele Borrelli added a comment - That is exactly what I wanted. I have a TableView with both a RowEditor and a contextual menu installed, right clicking should open the contextual menu, left clicking should start the row editor. Is this ok for you?
        Hide
        Sandro Martini added a comment -

        Maybe now I understand the fix of Raffaele: prevent selection of elements using the mouse RIGHT button, but are we sure that this is the behavior that we want here now ?
        At least on Windows, Right click usually opens a contextual menu (if any) or do nothing ... so this should become the new default for selections here.

        Greg, Chris and of course Raffaele, what do you think ?

        Show
        Sandro Martini added a comment - Maybe now I understand the fix of Raffaele: prevent selection of elements using the mouse RIGHT button, but are we sure that this is the behavior that we want here now ? At least on Windows, Right click usually opens a contextual menu (if any) or do nothing ... so this should become the new default for selections here. Greg, Chris and of course Raffaele, what do you think ?
        Hide
        Sandro Martini added a comment - - edited

        Just committed the fix for mouseClicked on TerraListViewSkin, TerraTableViewSkin , TerraTreeViewSkin and test the right behavior with TableViewTest2, ListViewTest2 .

        Show
        Sandro Martini added a comment - - edited Just committed the fix for mouseClicked on TerraListViewSkin, TerraTableViewSkin , TerraTreeViewSkin and test the right behavior with TableViewTest2, ListViewTest2 .
        Hide
        Sandro Martini added a comment -

        Hi all,
        on the contextual menu issue (in the original thread, on nabble), do you think could be useful for example to add a radio button in that demo (at the top of the window) so the user could choose between contextual menu enabled (default) and disabled, to see even if/when this is right ?
        Or if it's not an issue maybe we could show there how to handle that situation. Or maybe this could become a sub-issue of this, if useful.

        Tell me,

        Bye,
        Sandro

        Show
        Sandro Martini added a comment - Hi all, on the contextual menu issue (in the original thread, on nabble), do you think could be useful for example to add a radio button in that demo (at the top of the window) so the user could choose between contextual menu enabled (default) and disabled, to see even if/when this is right ? Or if it's not an issue maybe we could show there how to handle that situation. Or maybe this could become a sub-issue of this, if useful. Tell me, Bye, Sandro
        Show
        Raffaele Borrelli added a comment - http://apache-pivot-users.399431.n3.nabble.com/Disable-Menu-Item-td2865710.html
        Hide
        Raffaele Borrelli added a comment -

        The problem can be easily reproduced with any tableView with a TableViewRowEditor.

        Show
        Raffaele Borrelli added a comment - The problem can be easily reproduced with any tableView with a TableViewRowEditor.

          People

          • Assignee:
            Sandro Martini
            Reporter:
            Raffaele Borrelli
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development