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) { IStatus status = job.getResult(); if (status != null && status.getSeverity() == IStatus.ERROR) { StatusAdapter statusAdapter = StatusAdapterHelper.getInstance().getStatusAdapter(ji); if (statusAdapter == null) statusAdapter = new StatusAdapter(status); StatusManager.getManager().handle(statusAdapter, StatusManager.SHOW); removeTopElement(ji); } execute(ji, job); } } } progressRegion.processDoubleClick(); refresh(); }
/* * (non-Javadoc) * * @see org.eclipse.ui.internal.progress.AnimationItem#animationDone() */ @Override void animationDone() { super.animationDone(); animationRunning = false; if (bar.isDisposed()) { return; } bar.setVisible(false); refresh(); }
/* * (non-Javadoc) * * @see org.eclipse.ui.internal.progress.AnimationItem#animationStart() */ @Override void animationStart() { super.animationStart(); animationRunning = true; if (bar.isDisposed()) { return; } bar.setVisible(true); refresh(); }
/* * (non-Javadoc) * * @see org.eclipse.ui.internal.progress.AnimationItem#createAnimationItem(org.eclipse.swt.widgets.Composite) */ @Override protected Control createAnimationItem(Composite parent) { if (okImage == null) { Display display = parent.getDisplay(); noneImage = WorkbenchImages.getWorkbenchImageDescriptor("progress/progress_none.png") .createImage(display); // $NON-NLS-1$ okImage = WorkbenchImages.getWorkbenchImageDescriptor("progress/progress_ok.png") .createImage(display); // $NON-NLS-1$ errorImage = WorkbenchImages.getWorkbenchImageDescriptor("progress/progress_error.png") .createImage(display); // $NON-NLS-1$ } top = new Composite(parent, SWT.NULL); top.addDisposeListener( new DisposeListener() { @Override public void widgetDisposed(DisposeEvent e) { FinishedJobs.getInstance().removeListener(ProgressAnimationItem.this); noneImage.dispose(); okImage.dispose(); errorImage.dispose(); } }); boolean isCarbon = Util.isMac(); GridLayout gl = new GridLayout(); if (isHorizontal()) gl.numColumns = isCarbon ? 3 : 2; gl.marginHeight = 0; gl.marginWidth = 0; if (isHorizontal()) { gl.horizontalSpacing = 2; } else { gl.verticalSpacing = 2; } top.setLayout(gl); bar = new ProgressBar(top, flags | SWT.INDETERMINATE); bar.setVisible(false); bar.addMouseListener(mouseListener); GridData gd; int hh = 12; if (isHorizontal()) { gd = new GridData(SWT.BEGINNING, SWT.CENTER, true, false); gd.heightHint = hh; } else { gd = new GridData(SWT.CENTER, SWT.BEGINNING, false, true); gd.widthHint = hh; } bar.setLayoutData(gd); toolbar = new ToolBar(top, SWT.FLAT); toolbar.setVisible(false); toolButton = new ToolItem(toolbar, SWT.NONE); toolButton.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { doAction(); } }); if (isCarbon) { new Label(top, SWT.NONE).setLayoutData(new GridData(4, 4)); } refresh(); return top; }