Michael, These are good points. Here is what I am trying to do:
I've got a TaskFrame which extends a class that can host other docking windows. I want to modify the ViewAttributesPlugIn to add a docking window to the TaskFrame instead of creating a new JInternalFrame to display the attribute table. (In this case the TaskFrame class extends the InfoNode TabHolder class and the plug-in will add the attribute table to the TabHolder as an InfoNode View class.) For this to work I need to get a reference to the active TaskFrame from a PlugInContext class. This wasn't an issue before, because the ViewAttributesPlugIn just added a new JInternalFrame to the JUMPWorkbench. This isn't what I want. I guess I'm running into two problems here: [1] I don't want to make the JUMPWorkbench the parent of the DockingWindow integration. I want this to be the TaskFrame class. [2] I'm not prepared to deal with cloned Tasks. I wonder, was cloned tasks built-in as part of the orginal JUMP design, or after? It seems to me like it could complicate some aspects of an MDI program like JUMP, as here demonstrated. I understand the need to separate the model from the GUI, but if OpenJUMP is intended to be a MDI application perhaps it makes sense to give plug-in developers the access they needs to the different "documents" (in this case the Tasks) that are being displayed by the application? I'm open for suggestions on the best design in this scenario. I just thought I'd take a crack at the problem of integrating the attribute table into a docking window framework. As with all things programming, it is more complicated than it seems on the surface. SS On Mon, Nov 3, 2008 at 3:55 PM, Michael Michaud <[EMAIL PROTECTED]> wrote: > Hi Landon, > > Can you tell more about your need. > It seems to me that it is not safe to rely on JInternalFrame title to > find the TaskFrame attached to a plugin : > create a task named "Landon" (create new Task + save as... Landon) > create a clone (window>clone) : OJ will name it "Landon (view 2)" > delete the first "Landon" frame > --> Now, the TaskFrame attached to the Task "Landon" is named "Landon > (view 2)" > > As far as I understand the ui and the model, that also means that you > can have several TaskFrame for one Task > > I think most often, it is a good design to have references from the UI > to the model, and not from the model to the UI, but maybe you have > special needs for docking... > In that case, I would look after LayerManager which is shared by the > PluginContext and the Task. > > TaskFrame.getTask().getLayerManager() == pluginContext().getLayerManager() > > but you may have several frames where this condition is evaluated to > true if you used window>clone > > my two cents > > Michaël > > Sunburned Surveyor a écrit : >> Hmmm. I thought it returned the "active internal frame" which would be >> whatever internal frame had focus. So, if a plug-in had created an >> internal frame with focus, this object would be returned, not the >> TaskFrame. But I'm not sure now that you asked this question. It does >> seem logical that Vivid would have included this type of method. I >> will investigate and report my findings back to the list. >> >> Thanks, >> >> SS >> >> On Mon, Nov 3, 2008 at 2:32 PM, Larry Becker <[EMAIL PROTECTED]> wrote: >> >>> Does workbenchContext.getWorkbench().getFrame().getActiveInternalFrame() >>> give you what you need? >>> >>> Larry >>> >>> On Mon, Nov 3, 2008 at 4:12 PM, Sunburned Surveyor >>> <[EMAIL PROTECTED]> wrote: >>> >>>> I'd like to propose the attached code be added as a method of the >>>> WorkbenchContext class. I sometimes find myself with a need to access >>>> the active TaskFrame for the Workbench, especially when I work on the >>>> docking window integration. Perhaps others have found a need to do >>>> this as well. >>>> >>>> At any rate, any time I start to copy and paste code I get a little >>>> nervous. This is usually a sign that I need to make a utility method. >>>> >>>> If people think this change is a bad idea, I'll move the method to one >>>> of my own OpenJUMP utility classes. If you have changes or >>>> improvements to my implementation of the method, please let me know. >>>> If there are no objections, I will commit a patch adding the method. >>>> >>>> The Sunburned Surveyor >>>> >>>> ------------------------------------------------------------------------- >>>> This SF.Net email is sponsored by the Moblin Your Move Developer's >>>> challenge >>>> Build the coolest Linux based applications with Moblin SDK & win great >>>> prizes >>>> Grand prize is a trip for two to an Open Source event anywhere in the >>>> world >>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>>> _______________________________________________ >>>> Jump-pilot-devel mailing list >>>> Jump-pilot-devel@lists.sourceforge.net >>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel >>>> >>>> >>> >>> -- >>> http://amusingprogrammer.blogspot.com/ >>> >>> ------------------------------------------------------------------------- >>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >>> Build the coolest Linux based applications with Moblin SDK & win great >>> prizes >>> Grand prize is a trip for two to an Open Source event anywhere in the world >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>> _______________________________________________ >>> Jump-pilot-devel mailing list >>> Jump-pilot-devel@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel >>> >>> >>> >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >> Build the coolest Linux based applications with Moblin SDK & win great prizes >> Grand prize is a trip for two to an Open Source event anywhere in the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Jump-pilot-devel mailing list >> Jump-pilot-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel >> >> >> > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel