summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorRemy Suen2011-07-27 13:03:41 (EDT)
committer Paul Webster2011-08-25 10:21:56 (EDT)
commit9414773932aabebdf5e4baef82235174d5cd0186 (patch)
tree28b1c1deb2809e5c930a848a755f1b3ff55d5ca8
parent7d7702ec5da9a80ecb27c5909b4dd3decb0401d8 (diff)
downloadeclipse.platform.ui-9414773932aabebdf5e4baef82235174d5cd0186.zip
eclipse.platform.ui-9414773932aabebdf5e4baef82235174d5cd0186.tar.gz
eclipse.platform.ui-9414773932aabebdf5e4baef82235174d5cd0186.tar.bz2
Bug 353233 [Compatibility] IWorkbenchPageTest's testSetPartState is
failing The Eclipse 4 test facade has an empty implementation for determining whether a view is a fast view or not. The fix is to retrieve the parent container of the part and identify whether it has been minimized or not by checking its tags.
-rw-r--r--tests/org.eclipse.e4.ui.compat.tests.tweaklet/src/org/eclipse/e4/ui/compat/tests/tweaklet/TestFacadeE4Impl.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/org.eclipse.e4.ui.compat.tests.tweaklet/src/org/eclipse/e4/ui/compat/tests/tweaklet/TestFacadeE4Impl.java b/tests/org.eclipse.e4.ui.compat.tests.tweaklet/src/org/eclipse/e4/ui/compat/tests/tweaklet/TestFacadeE4Impl.java
index 9b81eda..6814996 100644
--- a/tests/org.eclipse.e4.ui.compat.tests.tweaklet/src/org/eclipse/e4/ui/compat/tests/tweaklet/TestFacadeE4Impl.java
+++ b/tests/org.eclipse.e4.ui.compat.tests.tweaklet/src/org/eclipse/e4/ui/compat/tests/tweaklet/TestFacadeE4Impl.java
@@ -14,11 +14,14 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.ui.model.application.MApplication;
+import org.eclipse.e4.ui.model.application.ui.MUIElement;
+import org.eclipse.e4.ui.model.application.ui.advanced.MPlaceholder;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
import org.eclipse.e4.ui.workbench.modeling.ISaveHandler;
@@ -40,6 +43,7 @@ import org.eclipse.ui.internal.SlavePageService;
import org.eclipse.ui.internal.SlavePartService;
import org.eclipse.ui.internal.SlaveSelectionService;
import org.eclipse.ui.internal.Workbench;
+import org.eclipse.ui.internal.WorkbenchPartReference;
import org.eclipse.ui.internal.e4.compatibility.E4Util;
import org.eclipse.ui.tests.helpers.TestFacade;
@@ -82,7 +86,20 @@ public class TestFacadeE4Impl extends TestFacade {
@Override
public boolean isFastView(IWorkbenchPage page, IViewReference ref) {
- E4Util.unsupported("assertActionSetId");
+ MPart part = ((WorkbenchPartReference) ref).getModel();
+ MUIElement parent = part.getParent();
+ if (parent == null) {
+ MPlaceholder placeholder = part.getCurSharedRef();
+ if (placeholder != null) {
+ parent = placeholder.getParent();
+ }
+ }
+
+ if (parent != null) {
+ List<String> tags = parent.getTags();
+ return tags.contains("Minimized") //$NON-NLS-1$
+ || tags.contains("MinimizedByZoom"); //$NON-NLS-1$
+ }
return false;
}