When creating a LaunchConfigurationTab how do I get the 'apply' button to highlight?

182 views Asked by At

I have the necessary extension points and my Tab class is extending AbstractLaunchConfigurationTab. I am doing nothing different to examples, such as, the CommonTab. I call updateLaunchConfigurationDialog() when a widget event is fired.

EDIT: The listener method for my widgets are definitely being called and the performApply method is being called. I am doing what the CommonTab class does with one of its radio buttons, for example:

fSharedRadioButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent evt) {
            handleSharedRadioButtonSelected();
        }
    });

/**
 * handles the shared radio button being selected
 */
private void handleSharedRadioButtonSelected() {
    setSharedEnabled(isShared());
    updateLaunchConfigurationDialog();
}

The only difference is that my widget is a spinner:

executionsSpinner.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            updateLaunchConfigurationDialog();
        }
    });
1

There are 1 answers

0
Lii On

When updateLaunchConfigurationDialog is called the framework triggers a call to your tab's performApply method.

performApply is passed an ILaunchConfigurationWorkingCopy instance as an argument. When performApply returns that ILaunchConfigurationWorkingCopy instance is compared with the original, unmodified ILaunchConfiguration. If there are any differences then the Apply button is enabled.

You must hence make some modification to the argument of performApply for Apply to be enabled, just as Greg notices in their comment.