Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 215486 Details for
Bug 375741
intermittent problems with context menu visibility etc.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Possible patch for review
active_selection_patch.txt (text/plain), 5.34 KB, created by
Oleg Besedin
on 2012-05-11 11:19:28 EDT
(
hide
)
Description:
Possible patch for review
Filename:
MIME Type:
Creator:
Oleg Besedin
Created:
2012-05-11 11:19:28 EDT
Size:
5.34 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityPart.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityPart.java >index 7d60aa4..6dac921 100644 >--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityPart.java >+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityPart.java >@@ -28,6 +28,11 @@ > import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; > import org.eclipse.e4.ui.workbench.IPresentationEngine; > import org.eclipse.e4.ui.workbench.UIEvents; >+import org.eclipse.e4.ui.workbench.modeling.ESelectionService; >+import org.eclipse.jface.viewers.IPostSelectionProvider; >+import org.eclipse.jface.viewers.ISelectionChangedListener; >+import org.eclipse.jface.viewers.ISelectionProvider; >+import org.eclipse.jface.viewers.SelectionChangedEvent; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.CTabFolder; > import org.eclipse.swt.custom.CTabItem; >@@ -53,7 +58,7 @@ > import org.osgi.service.event.Event; > import org.osgi.service.event.EventHandler; > >-public abstract class CompatibilityPart { >+public abstract class CompatibilityPart implements ISelectionChangedListener { > > public static final String COMPATIBILITY_EDITOR_URI = "bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor"; //$NON-NLS-1$ > >@@ -151,6 +156,19 @@ > WorkbenchPlugin.log("Unable to initialize error part", ex.getStatus()); //$NON-NLS-1$ > } > } >+ >+ IWorkbenchPartSite site = legacyPart.getSite(); >+ if (site != null) { >+ ISelectionProvider selectionProvider = site.getSelectionProvider(); >+ if (selectionProvider != null) { >+ selectionProvider.addSelectionChangedListener(this); >+ >+ if (selectionProvider instanceof IPostSelectionProvider) { >+ ((IPostSelectionProvider) selectionProvider) >+ .addPostSelectionChangedListener(this); >+ } >+ } >+ } > return true; > } > >@@ -168,6 +186,21 @@ > } > > private void invalidate() { >+ if (wrapped != null) { >+ IWorkbenchPartSite site = wrapped.getSite(); >+ if (site != null) { >+ ISelectionProvider selectionProvider = site.getSelectionProvider(); >+ if (selectionProvider != null) { >+ selectionProvider.removeSelectionChangedListener(this); >+ >+ if (selectionProvider instanceof IPostSelectionProvider) { >+ ((IPostSelectionProvider) selectionProvider) >+ .removePostSelectionChangedListener(this); >+ } >+ } >+ } >+ } >+ > WorkbenchPartReference reference = getReference(); > reference.invalidate(); > >@@ -380,4 +413,10 @@ > public MPart getModel() { > return part; > } >+ >+ public void selectionChanged(SelectionChangedEvent e) { >+ ESelectionService selectionService = (ESelectionService) part.getContext().get( >+ ESelectionService.class.getName()); >+ selectionService.setSelection(e.getSelection()); >+ } > } >diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/SelectionService.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/SelectionService.java >index 58f7dd1..f433fd8 100644 >--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/SelectionService.java >+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/SelectionService.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2010, 2011 IBM Corporation and others. >+ * Copyright (c) 2010, 2012 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -24,7 +24,6 @@ > import org.eclipse.e4.ui.model.application.ui.basic.MPart; > import org.eclipse.e4.ui.services.IServiceConstants; > import org.eclipse.e4.ui.workbench.modeling.ESelectionService; >-import org.eclipse.jface.viewers.IPostSelectionProvider; > import org.eclipse.jface.viewers.ISelection; > import org.eclipse.jface.viewers.ISelectionChangedListener; > import org.eclipse.jface.viewers.ISelectionProvider; >@@ -113,35 +112,11 @@ > > @Inject > void setPart(@Optional @Named(IServiceConstants.ACTIVE_PART) final MPart part) { >- if (activePart != null) { >- ISelectionProvider selectionProvider = activePart.getSite().getSelectionProvider(); >- if (selectionProvider != null) { >- selectionProvider.removeSelectionChangedListener(this); >- >- if (selectionProvider instanceof IPostSelectionProvider) { >- ((IPostSelectionProvider) selectionProvider) >- .removePostSelectionChangedListener(this); >- } >- } >- activePart = null; >- } >- >+ activePart = null; > if (part != null) { > Object client = part.getObject(); > if (client instanceof CompatibilityPart) { > IWorkbenchPart workbenchPart = ((CompatibilityPart) client).getPart(); >- >- ISelectionProvider selectionProvider = workbenchPart.getSite() >- .getSelectionProvider(); >- if (selectionProvider != null) { >- selectionProvider.addSelectionChangedListener(this); >- >- if (selectionProvider instanceof IPostSelectionProvider) { >- ((IPostSelectionProvider) selectionProvider) >- .addPostSelectionChangedListener(this); >- } >- } >- > activePart = workbenchPart; > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 375741
:
213397
|
215117
|
215367
| 215486