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 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


Back to the top