|
Lines 102-107
Link Here
|
| 102 |
import org.eclipse.ui.model.IWorkbenchAdapter; |
102 |
import org.eclipse.ui.model.IWorkbenchAdapter; |
| 103 |
import org.eclipse.ui.part.MultiEditor; |
103 |
import org.eclipse.ui.part.MultiEditor; |
| 104 |
import org.eclipse.ui.presentations.IStackPresentationSite; |
104 |
import org.eclipse.ui.presentations.IStackPresentationSite; |
|
|
105 |
import org.eclipse.ui.progress.IWorkbenchSiteProgressService; |
| 105 |
import org.eclipse.ui.views.IStickyViewDescriptor; |
106 |
import org.eclipse.ui.views.IStickyViewDescriptor; |
| 106 |
import org.eclipse.ui.views.IViewRegistry; |
107 |
import org.eclipse.ui.views.IViewRegistry; |
| 107 |
|
108 |
|
|
Lines 547-552
Link Here
|
| 547 |
if (window.isClosing()) |
548 |
if (window.isClosing()) |
| 548 |
return; |
549 |
return; |
| 549 |
|
550 |
|
|
|
551 |
// There is a preference to prevent background threads from activating views or bringing |
| 552 |
// them to the top. If the user has set this preference, just bold the tab whenever |
| 553 |
// a background thread tries to use VIEW_VISIBLE or VIEW_ACTIVATE |
| 554 |
|
| 555 |
if (composite != null && composite.isVisible() && isGrabFocusDisabled() && !InputMonitor.isProcessingUserInput()) { |
| 556 |
IWorkbenchSiteProgressService progressService = (IWorkbenchSiteProgressService)part.getSite().getAdapter(IWorkbenchSiteProgressService.class); |
| 557 |
|
| 558 |
// Bold the tab if possible |
| 559 |
if (progressService != null) { |
| 560 |
progressService.warnOfContentChange(); |
| 561 |
} |
| 562 |
|
| 563 |
// And exit to ensure we don't mess with activation or layout |
| 564 |
return; |
| 565 |
} |
| 566 |
|
| 550 |
// If zoomed, unzoom. |
567 |
// If zoomed, unzoom. |
| 551 |
zoomOutIfNecessary(part); |
568 |
zoomOutIfNecessary(part); |
| 552 |
|
569 |
|
|
Lines 751-756
Link Here
|
| 751 |
if (persp == null || !certifyPart(part)) |
768 |
if (persp == null || !certifyPart(part)) |
| 752 |
return; |
769 |
return; |
| 753 |
|
770 |
|
|
|
771 |
// There is a preference to prevent background threads from activating views or bringing |
| 772 |
// them to the top. If the user has set this preference, just bold the tab whenever |
| 773 |
// a background thread tries to use VIEW_VISIBLE or VIEW_ACTIVATE |
| 774 |
|
| 775 |
if (isGrabFocusDisabled() && !InputMonitor.isProcessingUserInput()) { |
| 776 |
IWorkbenchSiteProgressService progressService = (IWorkbenchSiteProgressService)part.getSite().getAdapter(IWorkbenchSiteProgressService.class); |
| 777 |
|
| 778 |
// Bold the tab if possible |
| 779 |
if (progressService != null) { |
| 780 |
progressService.warnOfContentChange(); |
| 781 |
} |
| 782 |
|
| 783 |
// And exit to ensure we don't mess with activation or layout |
| 784 |
return; |
| 785 |
} |
| 786 |
|
| 754 |
String label = null; // debugging only |
787 |
String label = null; // debugging only |
| 755 |
if (UIStats.isDebugging(UIStats.BRING_PART_TO_TOP)) { |
788 |
if (UIStats.isDebugging(UIStats.BRING_PART_TO_TOP)) { |
| 756 |
label = part != null ? part.getTitle() : "none"; //$NON-NLS-1$ |
789 |
label = part != null ? part.getTitle() : "none"; //$NON-NLS-1$ |
|
Lines 927-932
Link Here
|
| 927 |
*/ |
960 |
*/ |
| 928 |
private IViewPart busyShowView(String viewID, String secondaryID, int mode) |
961 |
private IViewPart busyShowView(String viewID, String secondaryID, int mode) |
| 929 |
throws PartInitException { |
962 |
throws PartInitException { |
|
|
963 |
|
| 930 |
Perspective persp = getActivePerspective(); |
964 |
Perspective persp = getActivePerspective(); |
| 931 |
if (persp == null) |
965 |
if (persp == null) |
| 932 |
return null; |
966 |
return null; |
|
Lines 962-967
Link Here
|
| 962 |
* Performs showing of the view in the given mode. |
996 |
* Performs showing of the view in the given mode. |
| 963 |
*/ |
997 |
*/ |
| 964 |
private void busyShowView(IViewPart part, int mode) { |
998 |
private void busyShowView(IViewPart part, int mode) { |
|
|
999 |
|
| 1000 |
// There is a preference to prevent background threads from activating views or bringing |
| 1001 |
// them to the top. If the user has set this preference, just bold the tab whenever |
| 1002 |
// a background thread tries to use VIEW_VISIBLE or VIEW_ACTIVATE |
| 1003 |
|
| 1004 |
if (isGrabFocusDisabled() && mode != VIEW_CREATE && !InputMonitor.isProcessingUserInput()) { |
| 1005 |
IWorkbenchSiteProgressService progressService = (IWorkbenchSiteProgressService)part.getSite().getAdapter(IWorkbenchSiteProgressService.class); |
| 1006 |
|
| 1007 |
// Bold the tab if possible |
| 1008 |
if (progressService != null) { |
| 1009 |
progressService.warnOfContentChange(); |
| 1010 |
} |
| 1011 |
|
| 1012 |
// And exit to ensure we don't mess with activation or layout |
| 1013 |
return; |
| 1014 |
} |
| 1015 |
|
| 965 |
if (mode == VIEW_ACTIVATE) |
1016 |
if (mode == VIEW_ACTIVATE) |
| 966 |
activate(part); |
1017 |
activate(part); |
| 967 |
else if (mode == VIEW_VISIBLE) { |
1018 |
else if (mode == VIEW_VISIBLE) { |
|
Lines 2061-2066
Link Here
|
| 2061 |
this.window = w; |
2112 |
this.window = w; |
| 2062 |
this.input = input; |
2113 |
this.input = input; |
| 2063 |
|
2114 |
|
|
|
2115 |
InputMonitor.init(); |
| 2064 |
// Create presentation. |
2116 |
// Create presentation. |
| 2065 |
createClientComposite(); |
2117 |
createClientComposite(); |
| 2066 |
editorPresentation = new EditorAreaHelper(this); |
2118 |
editorPresentation = new EditorAreaHelper(this); |
|
Lines 3214-3219
Link Here
|
| 3214 |
return showView(viewID, null, VIEW_ACTIVATE); |
3266 |
return showView(viewID, null, VIEW_ACTIVATE); |
| 3215 |
} |
3267 |
} |
| 3216 |
|
3268 |
|
|
|
3269 |
private boolean isGrabFocusDisabled() { |
| 3270 |
return WorkbenchPlugin.getDefault().getPreferenceStore().getBoolean( |
| 3271 |
IPreferenceConstants.NEVER_STEAL_FOCUS); |
| 3272 |
} |
| 3273 |
|
| 3217 |
/* |
3274 |
/* |
| 3218 |
* (non-Javadoc) |
3275 |
* (non-Javadoc) |
| 3219 |
* |
3276 |
* |
|
Lines 3222-3228
Link Here
|
| 3222 |
*/ |
3279 |
*/ |
| 3223 |
public IViewPart showView(final String viewID, final String secondaryID, |
3280 |
public IViewPart showView(final String viewID, final String secondaryID, |
| 3224 |
final int mode) throws PartInitException { |
3281 |
final int mode) throws PartInitException { |
| 3225 |
|
3282 |
|
| 3226 |
if (secondaryID != null) { |
3283 |
if (secondaryID != null) { |
| 3227 |
if (secondaryID.length() == 0 |
3284 |
if (secondaryID.length() == 0 |
| 3228 |
|| secondaryID.indexOf(ViewFactory.ID_SEP) != -1) |
3285 |
|| secondaryID.indexOf(ViewFactory.ID_SEP) != -1) |