#205 DatabaseManagerSwing right-click menus for tree

closed-fixed
Fred Toussi
None
1
2010-03-28
2008-12-07
Dave Eccleston
No

This patch adds handy right click menus to the tree in
the DatabaseManagerSwing dialog. Right click on a
table, and you are presented with menus to place
templates for select, delete, update, and insert into
the command textarea.

For example, right click on table foo, and use the
select menu, and it inserts the text "SELECT * FROM
foo" into the command window. Open the foo table in
the tree and right click on the "name" column, and the
select menu will add the text "SELECT * FROM foo WHERE
name LIKE "%%" into the command window.

Discussion

1 2 > >> (Page 1 of 2)
  • Dave Eccleston
    Dave Eccleston
    2008-12-07

    right-click patch for swing gui tree

     
  • Fred Toussi
    Fred Toussi
    2008-12-19

    • assigned_to: nobody --> unsaved
    • priority: 5 --> 7
     
  • Fred Toussi
    Fred Toussi
    2008-12-19

    Thank you. Recommended for inclusion in 1.8.0.x and 1.9.0 if it doesn't cause any issue.

     
  • Dave Eccleston
    Dave Eccleston
    2009-04-08

    This patch hasn't made it in yet, and the assigned developer is 'unsaved'. Is this an oversight?

     
  • Fred Toussi
    Fred Toussi
    2010-03-15

    This doesn't seem to work. Right click on a table and the exception below is thrown. Might be something missing from the patch. Please upload a complete file (doesn't matter which revision) that works.

    Exception in thread "AWT-EventQueue-0" java.util.NoSuchElementException: node has no children
    at javax.swing.tree.DefaultMutableTreeNode.getFirstChild(DefaultMutableTreeNode.java:864)
    at org.hsqldb.util.DatabaseManagerSwing$PopupListener.getCommandString(DatabaseManagerSwing.java:2114)
    at org.hsqldb.util.DatabaseManagerSwing$PopupListener.toString(DatabaseManagerSwing.java:2046)
    at org.hsqldb.util.DatabaseManagerSwing.handlePopup(DatabaseManagerSwing.java:1999)
    at org.hsqldb.util.DatabaseManagerSwing.mouseReleased(DatabaseManagerSwing.java:1960)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273)
    at java.awt.Component.processMouseEvent(Component.java:6263)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6028)
    at java.awt.Container.processEvent(Container.java:2041)
    at java.awt.Component.dispatchEventImpl(Component.java:4630)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.java:2085)
    at java.awt.Window.dispatchEventImpl(Window.java:2478)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

     
  • Fred Toussi
    Fred Toussi
    2010-03-15

    • assigned_to: unsaved --> fredt
     
  • Attached the entire DatabaseManagerSwing class. Not sure why you were getting that error. Looking at the code, seems like you have a table with no columns, which shouldn't be allowed. Added some error checking to trap that error.

     
  • Fred Toussi
    Fred Toussi
    2010-03-15

    Thanks for responding, but DatabaseManagerSwing.java has not yet been atteched to this report.

     
  • Dave Eccleston
    Dave Eccleston
    2010-03-15

    DatabaseManagerSwing file

     
  • Dave Eccleston
    Dave Eccleston
    2010-03-15

    Sorry, it's attached now.

     
1 2 > >> (Page 1 of 2)