Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 491478 - [Element Types] RuntimeValuesAdviceEditHelperAdvice ignores dialog cancellation
Summary: [Element Types] RuntimeValuesAdviceEditHelperAdvice ignores dialog cancellation
Status: RESOLVED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 2.0.0   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: M7   Edit
Assignee: Christian Damus CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 477821
  Show dependency tree
 
Reported: 2016-04-11 17:25 EDT by Christian Damus CLA
Modified: 2016-04-13 04:51 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Damus CLA 2016-04-11 17:25:38 EDT
The RuntimeValuesAdviceEditHelperAdvice checks whether the incoming advice has the parameter allowing cancellation of the dialog (why is this even an option? Every dialog asking for user input should be cancellable) but then just ignores the possibility that the dialog was cancelled.

In the doExecuteWithResult(...) method of the after-configure command is:

    Set<View> viewsToDisplay = getViewsToDisplay();
    if (!viewsToDisplay.isEmpty()) {
        EditionDialog dialog = new EditionDialog(...);
        dialog.setTitle("Edit " + EMFCoreUtil.getName(elementToConfigure));
        dialog.setViews(viewsToDisplay);
        dialog.setInput(elementToConfigure);

        dialog.open();
    }

    return CommandResult.newOKCommandResult(elementToConfigure);

So, we unconditionally complete the command, regardless of the dialog's return code.
Comment 1 Eclipse Genie CLA 2016-04-11 17:41:32 EDT
New Gerrit change created: https://git.eclipse.org/r/70425
Comment 3 Christian Damus CLA 2016-04-11 18:55:41 EDT
Fixed for Neon M7.