Menu

#86 Bugfix for Plugin MenuEditor: Separator-Button

closed-fixed
None
5
2014-08-16
2010-11-23
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

  • Daniel Bruessler

    current version "MenuEditor 0.4" to version 0.5

     
  • Daniel Bruessler

    • assigned_to: nobody --> shlomy
     
  • Anonymous

    Anonymous - 2010-11-23

    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?

     
  • Daniel Bruessler

    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

     
  • Anonymous

    Anonymous - 2010-11-23

    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).

     
  • Anonymous

    Anonymous - 2010-11-23

    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.

     
  • Anonymous

    Anonymous - 2010-11-23

    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.

     
  • Daniel Bruessler

    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. ;-)

     
  • Daniel Bruessler

    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.

     
  • Anonymous

    Anonymous - 2010-11-24

    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).

     
  • Daniel Bruessler

    MenuEditor Separator proposal2

     
  • Daniel Bruessler

    Hey Shlomy,

    I added a screenshot, how I would find it good. In the actions list of the right menu you see the separator "-" with the label
    menu-editor.separator=---- Separator ----
    from MenuEditor.props. There's no problem to have the MenuElement with a label for this element in the menu list, it works.

    So the separator from the actions list is usable for drag'n'drop and the Button is just a Button how users expect it. :-)

     
  • Anonymous

    Anonymous - 2010-11-26

    I think that would be okay. And then there is also no need for the "Add Separator" button since the separator menu item can be used. I'll do that.

     
  • Daniel Bruessler

    That's cool! So I think the user interface looks cleaner also, because it's just a "from right to left".

    I have put
    allActionsModel.addElement(new MenuElement(menuSeparator, getProp("menu-editor.separator")));

    into private void updateActions(String actionSet) - is that a good place?

     
  • Anonymous

    Anonymous - 2010-11-27

    Can you try the updated version here:
    http://community.jedit.org/?q=node/view/4577
    and let me know what you think?

     
  • Daniel Bruessler

    works like a charm :-)

    using openjdk-6-jdk (1.6.0_20-b02)

    I think you can think about a versionn number of 1.0, because the extension is doing what it tells. It just good to test it also on 64bit and with java5.

     
  • Anonymous

    Anonymous - 2010-11-27

    The fix will be included in the next release.

     
  • Anonymous

    Anonymous - 2010-11-27
    • status: open --> closed
     
  • Anonymous

    Anonymous - 2010-11-27
    • status: closed --> closed-fixed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.