|
Lines 107-112
Link Here
|
| 107 |
import org.eclipse.ui.model.IWorkbenchAdapter; |
107 |
import org.eclipse.ui.model.IWorkbenchAdapter; |
| 108 |
import org.eclipse.ui.part.MultiEditor; |
108 |
import org.eclipse.ui.part.MultiEditor; |
| 109 |
import org.eclipse.ui.presentations.IStackPresentationSite; |
109 |
import org.eclipse.ui.presentations.IStackPresentationSite; |
|
|
110 |
import org.eclipse.ui.progress.IWorkbenchSiteProgressService; |
| 110 |
import org.eclipse.ui.views.IStickyViewDescriptor; |
111 |
import org.eclipse.ui.views.IStickyViewDescriptor; |
| 111 |
import org.eclipse.ui.views.IViewRegistry; |
112 |
import org.eclipse.ui.views.IViewRegistry; |
| 112 |
|
113 |
|
|
Lines 574-579
Link Here
|
| 574 |
if (window.isClosing()) { |
575 |
if (window.isClosing()) { |
| 575 |
return; |
576 |
return; |
| 576 |
} |
577 |
} |
|
|
578 |
// There is a preference to prevent background threads from activating views or bringing |
| 579 |
// them to the top. If the user has set this preference, just bold the tab whenever |
| 580 |
// a background thread tries to use VIEW_VISIBLE or VIEW_ACTIVATE |
| 581 |
|
| 582 |
if (composite != null && composite.isVisible() && isGrabFocusDisabled() && !InputMonitor.isProcessingUserInput()) { |
| 583 |
IWorkbenchSiteProgressService progressService = (IWorkbenchSiteProgressService)part.getSite().getAdapter(IWorkbenchSiteProgressService.class); |
| 584 |
|
| 585 |
// Bold the tab if possible |
| 586 |
if (progressService != null) { |
| 587 |
progressService.warnOfContentChange(); |
| 588 |
} |
| 589 |
|
| 590 |
// And exit to ensure we don't mess with activation or layout |
| 591 |
return; |
| 592 |
} |
| 577 |
|
593 |
|
| 578 |
// If zoomed, unzoom. |
594 |
// If zoomed, unzoom. |
| 579 |
zoomOutIfNecessary(part); |
595 |
zoomOutIfNecessary(part); |
|
Lines 780-785
Link Here
|
| 780 |
if (persp == null || !certifyPart(part)) { |
796 |
if (persp == null || !certifyPart(part)) { |
| 781 |
return; |
797 |
return; |
| 782 |
} |
798 |
} |
|
|
799 |
// There is a preference to prevent background threads from activating views or bringing |
| 800 |
// them to the top. If the user has set this preference, just bold the tab whenever |
| 801 |
// a background thread tries to use VIEW_VISIBLE or VIEW_ACTIVATE |
| 802 |
|
| 803 |
if (isGrabFocusDisabled() && !InputMonitor.isProcessingUserInput()) { |
| 804 |
IWorkbenchSiteProgressService progressService = (IWorkbenchSiteProgressService)part.getSite().getAdapter(IWorkbenchSiteProgressService.class); |
| 805 |
|
| 806 |
// Bold the tab if possible |
| 807 |
if (progressService != null) { |
| 808 |
progressService.warnOfContentChange(); |
| 809 |
} |
| 810 |
|
| 811 |
// And exit to ensure we don't mess with activation or layout |
| 812 |
return; |
| 813 |
} |
| 783 |
|
814 |
|
| 784 |
String label = null; // debugging only |
815 |
String label = null; // debugging only |
| 785 |
if (UIStats.isDebugging(UIStats.BRING_PART_TO_TOP)) { |
816 |
if (UIStats.isDebugging(UIStats.BRING_PART_TO_TOP)) { |
|
Lines 1004-1010
Link Here
|
| 1004 |
* Performs showing of the view in the given mode. |
1035 |
* Performs showing of the view in the given mode. |
| 1005 |
*/ |
1036 |
*/ |
| 1006 |
private void busyShowView(IViewPart part, int mode) { |
1037 |
private void busyShowView(IViewPart part, int mode) { |
| 1007 |
if (mode == VIEW_ACTIVATE) { |
1038 |
|
|
|
1039 |
// There is a preference to prevent background threads from activating views or bringing |
| 1040 |
// them to the top. If the user has set this preference, just bold the tab whenever |
| 1041 |
// a background thread tries to use VIEW_VISIBLE or VIEW_ACTIVATE |
| 1042 |
|
| 1043 |
if (isGrabFocusDisabled() && mode != VIEW_CREATE && !InputMonitor.isProcessingUserInput()) { |
| 1044 |
IWorkbenchSiteProgressService progressService = (IWorkbenchSiteProgressService)part.getSite().getAdapter(IWorkbenchSiteProgressService.class); |
| 1045 |
|
| 1046 |
// Bold the tab if possible |
| 1047 |
if (progressService != null) { |
| 1048 |
progressService.warnOfContentChange(); |
| 1049 |
} |
| 1050 |
|
| 1051 |
// And exit to ensure we don't mess with activation or layout |
| 1052 |
return; |
| 1053 |
} |
| 1054 |
|
| 1055 |
if (mode == VIEW_ACTIVATE) { |
| 1008 |
activate(part); |
1056 |
activate(part); |
| 1009 |
} else if (mode == VIEW_VISIBLE) { |
1057 |
} else if (mode == VIEW_VISIBLE) { |
| 1010 |
IWorkbenchPartReference ref = getActivePartReference(); |
1058 |
IWorkbenchPartReference ref = getActivePartReference(); |
|
Lines 2224-2229
Link Here
|
| 2224 |
// Save args. |
2272 |
// Save args. |
| 2225 |
this.window = w; |
2273 |
this.window = w; |
| 2226 |
this.input = input; |
2274 |
this.input = input; |
|
|
2275 |
|
| 2276 |
InputMonitor.init(); |
| 2227 |
|
2277 |
|
| 2228 |
// Create presentation. |
2278 |
// Create presentation. |
| 2229 |
createClientComposite(); |
2279 |
createClientComposite(); |
|
Lines 3538-3543
Link Here
|
| 3538 |
return showView(viewID, null, VIEW_ACTIVATE); |
3588 |
return showView(viewID, null, VIEW_ACTIVATE); |
| 3539 |
} |
3589 |
} |
| 3540 |
|
3590 |
|
|
|
3591 |
private boolean isGrabFocusDisabled() { |
| 3592 |
return WorkbenchPlugin.getDefault().getPreferenceStore().getBoolean( |
| 3593 |
IPreferenceConstants.NEVER_STEAL_FOCUS); |
| 3594 |
} |
| 3595 |
|
| 3541 |
/* |
3596 |
/* |
| 3542 |
* (non-Javadoc) |
3597 |
* (non-Javadoc) |
| 3543 |
* |
3598 |
* |