Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-user] PTP initalizastion of widget values

Hi Chris,

Thanks for the detailed explanation.  The question is related to the behavior of  the HPCT plugin.

The problem I have is that the HPCT plugin (a PTP plugin) is reading a value from the Application tab (the file name).  In order to reduce the number of clicks for the user, when the Performance Analysis tab is activated, the plugin's UpdateModel sub-class' initialize method calls another method that analyzes the file to gather all the instrumentation points.  If the file does not exist for whatever reason, or if there are any issues w/handling the file, then we pop-up an error message.

Because the initialization method is called twice in handleUpdate (once in the inner for loop and once in the outer for loop, through initializeFrom), any problems that result in pop-up warnings/errors to the user are displayed twice.

Regardless of the HPCT plug-in, updateHandle calls the initialization of the widgets twice using the same LaunchConfigurationWorkingCopy object, which results in duplicate initialization.  Normally, if that initialization is only reading some values, then it shouldn't matter;  however, if the initialization is doing more than that, there's a problem.

Also, you mentioned that the code attempts to rebuild the Performance tab when activated.  I see that happening the first time I select it (i.e. click on it.)  However, if I then go to another tab, for example the Application tab, and modify something and I return to Performance Analysis tab, then I don't see the updateModel running again.  Is there another interface that is called when the tab is activated subsequently? (i.e. after the first time.)

Thanks so much,

Serban Maerean, CISSP 120913
HPC Tools Team
HPC Security/IPv6
T/L: 293-9770, Tel.: 845-433-9770
E-mail: serban@xxxxxxxxxx




From:        Christopher Navarro <cmnavarr@xxxxxxxxxxxx>
To:        <ptp-user@xxxxxxxxxxx>,
Date:        09/19/2013 05:25 PM
Subject:        Re: [ptp-user] PTP initalizastion of widget values
Sent by:        ptp-user-bounces@xxxxxxxxxxx




Hi Serban,

Although the two methods look similar, they are called under different circumstances. The initializeFrom inside the performance tab is inherited the parent class, AbstractLaunchConfigurationTab and it gets called when the tab is activated. When the Performance tab is selected (activated), we attempt to rebuild it from the launch configuration IF a tool was previously selected and saved as part of the launch configuration. This restores the tab. handleUpdate is called when a tool is selected within the tab from the tool selection box. Since the tools are storing their values in the launchConfiguration, when a new tool is selected we are tearing down part of the tab and rebuilding it.

To set initial values for widgets, you should only need to put default values in the tool's xml file. You can set defaults by creating attributes and associating it with a particular widget. The TAU tool is a good example of how to set initial values so if you are trying to develop a tool I would look at the tau tool plugins. I'm not sure under what circumstances you are seeing an error window popup twice, but can you provide more details on what you are trying to do so I can better understand what might be happening?

Thanks,
Chris

On 09/18/2013 12:34 PM, Serban Maerean wrote:

Hello;

I have a question about the
PerformanceAnalysisTab class in PTP, more specifically about the handleUpdate method.

The method is fairly simple:


       
private void handleUpdate() {
               
launchTabParent.initializeFrom(this.launchConfiguration);

               
for (IJAXBLaunchConfigurationTab tabControl : tabControllers) {
                       
for (IUpdateModel m : tabControl.getLocalWidgets().values()) {
                               
m.initialize(this.launchConfiguration, vmap, launchTabParent.getVariableMap());
                       
}

                       ((JAXBDynamicLaunchConfigurationTab) tabControl).initializeFrom(
this.launchConfiguration);
               }

       }


The question I have is why do I need to initialize all the widget values before calling
initializeFrom, when that method initializes them again?

       
public RMLaunchValidation initializeFrom(ILaunchConfiguration configuration) {
               
listenerConfiguration = configuration;
               
try {
                       IUpdateHandler handler = getParent().getUpdateHandler();


                       
viewers.clear();
                       
for (Map.Entry<Object, IUpdateModel> e : localWidgets.entrySet()) {
                               Object key = e.getKey();

                               
if (key instanceof Viewer) {
                                       Viewer viewer = (Viewer) key;

                                       
viewers.add(viewer);
                               }

                               handler.addUpdateModelEntry(key, e.getValue());

                       }


                       LCVariableMap lcMap =
parentTab.getVariableMap();
                       IVariableMap rmMap =
fControl.getEnvironment();

                       
for (IUpdateModel m : localWidgets.values()) {
                               m.initialize(configuration, rmMap, lcMap);        <--- initialized again

                       }


Do I need to explicitly initialize the widget values before calling initializeFrom? The problem I have is that the initialization may pop up some error windows and I get them twice.


Thanks,



Serban Maerean, CISSP 120913
HPC Tools Team
HPC Security/IPv6
T/L: 293-9770, Tel.: 845-433-9770
E-mail:
serban@xxxxxxxxxx

_______________________________________________
ptp-user mailing list
ptp-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-user

_______________________________________________
ptp-user mailing list
ptp-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-user


Back to the top