|
From: Shlomy R. <sre...@gm...> - 2007-09-03 14:50:11
|
Well, yes, but don't try my patch yet as-is. I still intend to modify it a little. The patch as it is requires a plugin dockable to implement the DockableWindow interface (which currently defines a single method, move(position)). Since most dockables do not care where they are positioned, and since i don't want plugins' code to change in order to allow this, I intend to add an attribute "MOVABLE" in dockables.xml, that if set to true, makes jEdit use the same instance rather than invoke BeanShell code for repositioning the dockable. In addition, if the dockable implements DockableWindow, it will also be notified about being moved, otherwise it will just be moved without being notified. This will allow changing the behavior of a plugin dockable simply by editing the XML. Now let me bring up another issue I encountered, that might effect the approach significantly: jEdit defines a "Float" action for dockables, that moves them out of the view into a "floating" state (their own window). If I try to move the dockable instance from its position in the view to its own window, it is sometimes not repainted in its own window, and the window appears to be blank. What happens is that the JPanel that was docked inside the jEdit view is now reparented to its own JFrame, and this sometimes works, sometimes not. But the small menu button in the floating window is visible and I can use it to change the docking of the dockable window back to the view,and then it gets painted again. Does anyone know why this happens, and if there's a solution to this? Maybe reparenting between different top level windows is not possible in Java/Swing, in which case the approach should be to keep the dockable state separate from its GUI elements, and recreate the JPanel every time the docking position changes but initialize it with the existing state. Shlomy On 9/3/07, Dale Anson <da...@gr...> wrote: > > Hi Shlomy, > > I haven't had time to try out your patch, but I like the direction > you're headed with this. You're right, the individual plugins shouldn't > need to do any work to go from docked to floating, that should be > handled by the docking framework. > > With your patch, do individual plugins need to be adjusted at all? > > Thanks, > > Dale > > |