#86 Bugfix for Plugin MenuEditor: Separator-Button

closed-fixed
None
5
2014-08-16
2010-11-23
Daniel Bruessler
No

Hi, this is the patch to get the Separator-Button in the MenuEditor working.

Mainly these two lines caused the problem:
// separator.setTransferHandler(new SeparatorTransferHandler());
// separator.addMouseListener(new SeparatorMouseListener());

The attached patch file can patch the current version "MenuEditor 0.4" to version 0.5

Greets!
Daniel Brüßler

Discussion

1 2 > >> (Page 1 of 2)
  • current version "MenuEditor 0.4" to version 0.5

     
    • assigned_to: nobody --> shlomy
     
  • For me, the separator button is working as-is, without your changes - both click and drag & drop are working. Can you describe what is the behavior that you see?

     
  • My OS: Ubuntu 8.04
    Java version: JDK 1.6.0_20 (openjdk)

    In the original version the button didn't do anything. It didn't insert the separator when I clicked on it - not at the end and not after a selection.
    I didn't try to move the box by drag&drop into the left one because it's a button and buttons are to click on it. I didn't get that idea.

    So it behaved: The mouse pointer changed for a short (a part of a second) when I clicked on the button. It showed a special cursor what looked like a forbiden symbol.
    I don't see that cursor in the class java.awt.Cursor, but to show you how it looks see http://de.fotolia.com/id/19819841

     
  • I also get this "forbidden" (or "no entrance") icon when I press the button. But this does not prevent me from releasing the mouse button (and then the separator is appended to the list) or dragging it to the list of menu items and dropping it where I like.
    This icon is shown due to the "drag & drop" - currently the drop is only enabled on the list of items, you cannot drop anywhere else. But the mouse listener is the one that appends the separator to the end when you release the mouse button (even though the strange icon was shown when the mouse button was down).

     
  • If it doesn't work for you, then either it behaves differently on mac (on other OSs it works fine), or you don't have the latest trunk version.

     
  • Sorry, ignore my comment about mac. You wrote you use OpenJDK, I've never tried it with OpenJDK and as far as I know jEdit does not officially support it.

     
  • I installed the plugin using the jEdit PluginManager. Version 0.4 - can you make a diff between the official version 0.4 and the SVN trunk version?

    Is there a known error in openjdk/Swing what's not in the sun jdk? Until now I thought that it's well tested.

    It might be a timing problem in the Linux version of the JDK, maybe the click-event is in conflict with the drag-and-drop event and so Swing "thinks" I want to drag and drop the button to the button. ;-)

     
  • Now I switched back to the 0.4 version and see that the drag-and-drop feature of the button does work.

    But that's really a "hidden feature" ;-) A button is a button.

     
  • The "drag & drop" feature of the separator is more important for me than the click, since usually you'd want to place the separator in a specific place in the menu and not just append it. The reason I also added the "click to append" capability (that's actually the only reason for it to be a button) is that drag & drop is difficult to use for some people, who have a problem with delicate movements of the mouse. This is also the reason I added the buttons to move items from one list to the other - as these can also be dragged.

    About OpenJDK, see here: http://jedit.org/index.php?page=compatibility

    Finally, I also didn't like the button idea, but couldn't think of a better way to present an object that can both be dragged and clicked. If you have an idea how to do it better, let me know. One option would be to add it to the list on the right, so it can be added by dragging or one of the other buttons. But that would make it less visible for users (I think).

     
1 2 > >> (Page 1 of 2)