Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335543 - ProgressAnimationItem toolbar button selection opens ProgressView
Summary: ProgressAnimationItem toolbar button selection opens ProgressView
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7 M6   Edit
Assignee: Prakash Rangaraj CLA
QA Contact: Prakash Rangaraj CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 440294
  Show dependency tree
 
Reported: 2011-01-27 03:07 EST by Srimathi CLA
Modified: 2014-07-24 04:30 EDT (History)
3 users (show)

See Also:


Attachments
patch contains the changes proposed in previous comment. (1.64 KB, patch)
2011-01-28 06:25 EST, Srimathi CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Srimathi CLA 2011-01-27 03:07:34 EST
Build Identifier: 20100917-0705

Once the background job is complete a toolbar button is shown in ProgressRegion. If we select this button the action is being executed and after completing the action ProgressView opens automatically. We see this as a change of behavior from 3.5 to 3.6.

Reproducible: Always

Steps to Reproduce:
1.Set Action Property to a Eclipse job.
2.Run that job.
3.Select the button shown in ProgressRegion after job is complete.
4.We could see the action being execute (like showing results etc). After the action is complete ProgressView is opened.
Comment 1 Srimathi CLA 2011-01-27 04:31:46 EST
I propose the following change in ProgressAnimationItem.java.
void doAction() {

		JobTreeElement[] jobTreeElements = FinishedJobs.getInstance()
				.getKeptElements();
		// search from end (youngest)
		for (int i = jobTreeElements.length - 1; i >= 0; i--) {
			if (jobTreeElements[i] instanceof JobInfo) {
				JobInfo ji = (JobInfo) jobTreeElements[i];
				Job job = ji.getJob();
				if (job != null) {

					        ...
						removeTopElement(ji);
					}

					if(execute(ji, job)) {
					    //This change is to bring back the same behavior of 3.5, 
					    //that is, not opening ProgressView when Action/Command result is shown
					    return;
					}
				}
			}
		}

		progressRegion.processDoubleClick();
		refresh();
	}

	/**
	 * @param ji
	 * @param job
	 */
	private boolean execute(JobInfo ji, Job job) {
		Object prop = job.getProperty(IProgressConstants2.ACTION_PROPERTY);
		if (prop instanceof IAction && ((IAction) prop).isEnabled()) {
			IAction action = (IAction) prop;
			action.run();
			removeTopElement(ji);
			return true;
		}

		prop = job.getProperty(IProgressConstants2.COMMAND_PROPERTY);
		if (prop instanceof ParameterizedCommand) {
			...
            return true;

		}
		return false;
	}
Comment 2 Prakash Rangaraj CLA 2011-01-27 04:35:40 EST
(In reply to comment #1)
> I propose the following change in ProgressAnimationItem.java.

     Can you submit this as a patch?
Comment 3 Paul Webster CLA 2011-01-27 07:08:19 EST
(In reply to comment #2)
> 
>      Can you submit this as a patch?

See http://wiki.eclipse.org/Platform_UI/How_to_Contribute for steps.

PW
Comment 4 Srimathi CLA 2011-01-28 06:25:16 EST
Created attachment 187828 [details]
patch contains the changes proposed in previous comment.
Comment 5 Prakash Rangaraj CLA 2011-02-15 05:06:17 EST
Patch released to HEAD
Comment 6 Prakash Rangaraj CLA 2011-03-09 00:03:49 EST
Verified in I20110307-2110