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