Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.rap.ui.tests/IAD API Tests.launch4
-rw-r--r--tests/org.eclipse.rap.ui.tests/IAD API Tests/org/eclipse/rap/interactiondesign/tests/ConfigurationActionTest.java26
-rw-r--r--tests/org.eclipse.rap.ui.tests/IAD API Tests/org/eclipse/rap/interactiondesign/tests/impl/ConfigurationActionImpl.java72
-rw-r--r--tests/org.eclipse.rap.ui.tests/plugin.xml3
4 files changed, 102 insertions, 3 deletions
diff --git a/tests/org.eclipse.rap.ui.tests/IAD API Tests.launch b/tests/org.eclipse.rap.ui.tests/IAD API Tests.launch
index ea1b299bc4..192d0ef520 100644
--- a/tests/org.eclipse.rap.ui.tests/IAD API Tests.launch
+++ b/tests/org.eclipse.rap.ui.tests/IAD API Tests.launch
@@ -52,10 +52,10 @@
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
<booleanAttribute key="show_selected_only" value="false"/>
-<stringAttribute key="target_bundles" value="javax.servlet@default:default,org.eclipse.osgi.services@default:default,org.eclipse.equinox.http.servlet@default:default,com.ibm.icu.base@default:default,org.eclipse.help@default:default,org.eclipse.equinox.preferences@default:default,org.junit@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.core.resources@default:default,org.mortbay.jetty.server@default:default,org.mortbay.jetty.util@default:default,org.eclipse.core.commands@default:default,org.eclipse.equinox.app@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.databinding@default:default,org.eclipse.osgi@-1:true,org.eclipse.core.databinding.property@default:default,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.equinox.common@2:true,org.eclipse.core.runtime@default:true"/>
+<stringAttribute key="target_bundles" value="org.eclipse.equinox.http.jetty@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.databinding.beans@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.databinding@default:default,org.eclipse.update.configurator@default:default,org.mortbay.jetty.util@default:default,javax.servlet@default:default,org.eclipse.core.runtime.compatibility*3.2.0.v20090413@default:default,org.eclipse.core.resources@default:default,org.mortbay.jetty.server@default:default,org.eclipse.equinox.http.registry@default:default,com.ibm.icu.base@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.help@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.filesystem.macosx@default:false,org.eclipse.osgi@-1:true,org.eclipse.core.jobs@default:default,org.junit@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.osgi.services@default:default,org.eclipse.core.commands@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.common@2:true"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useDefaultConfig" value="true"/>
<booleanAttribute key="useDefaultConfigArea" value="false"/>
<booleanAttribute key="useProduct" value="true"/>
-<stringAttribute key="workspace_bundles" value="org.eclipse.core.tests.harness@default:default,org.eclipse.rap.ui.tests.harness@default:default,org.eclipse.rap.ui.workbench@default:default,org.eclipse.rap.rwt.testfixture@default:false,org.eclipse.update.configurator@3:true,org.eclipse.rap.rwt.q07@default:false,org.eclipse.rap.ui.forms.test@default:false,org.eclipse.rap.jface.databinding@default:default,org.eclipse.rap.rwt.test@default:false,org.eclipse.rap.ui@default:default,org.eclipse.rap.junit@default:default,org.eclipse.rap.rwt.q07.test@default:false,org.eclipse.rap.ui.views@default:default,org.eclipse.rap.jface@default:default,org.eclipse.rap.ui.forms@default:default,org.eclipse.rap.ui.tests@default:default,org.eclipse.rap.rwt@default:default,org.eclipse.rap.rwt.test.mockup@default:false,org.eclipse.test.performance@default:default,org.eclipse.rap.junit.runtime@default:default,org.eclipse.core.runtime.compatibility@default:default"/>
+<stringAttribute key="workspace_bundles" value="org.eclipse.rap.ui.tests@default:default,org.eclipse.rap.jface@default:default,org.eclipse.rap.junit.runtime@default:default,org.eclipse.rap.rwt@default:default,org.eclipse.rap.rwt.q07@default:false,org.eclipse.rap.equinox.registry@default:false,org.eclipse.rap.ui.workbench@default:default,org.eclipse.rap.ui@default:default,org.eclipse.rap.ui.forms@default:default,org.eclipse.rap.ui.views@default:default,org.eclipse.test.performance@default:default,org.eclipse.rap.ui.tests.harness@default:default,org.eclipse.core.tests.harness@default:default,org.eclipse.rap.junit@default:default,org.eclipse.rap.jface.databinding@default:default"/>
</launchConfiguration>
diff --git a/tests/org.eclipse.rap.ui.tests/IAD API Tests/org/eclipse/rap/interactiondesign/tests/ConfigurationActionTest.java b/tests/org.eclipse.rap.ui.tests/IAD API Tests/org/eclipse/rap/interactiondesign/tests/ConfigurationActionTest.java
index e9103817d3..ecebe5eec6 100644
--- a/tests/org.eclipse.rap.ui.tests/IAD API Tests/org/eclipse/rap/interactiondesign/tests/ConfigurationActionTest.java
+++ b/tests/org.eclipse.rap.ui.tests/IAD API Tests/org/eclipse/rap/interactiondesign/tests/ConfigurationActionTest.java
@@ -16,6 +16,7 @@ import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.rap.interactiondesign.tests.impl.ConfigurableStackImpl;
+import org.eclipse.rap.interactiondesign.tests.impl.ConfigurationActionImpl;
import org.eclipse.rap.junit.RAPTestCase;
import org.eclipse.rap.ui.interactiondesign.ConfigurableStack;
import org.eclipse.rap.ui.interactiondesign.ConfigurationAction;
@@ -140,6 +141,18 @@ public class ConfigurationActionTest extends RAPTestCase {
assertFalse( visible );
}
+ public void testPartMenuVisibilityWithGlobalValue() {
+ boolean visible = configAction.isPartMenuVisible();
+ assertFalse( visible );
+ ConfigurationActionImpl action = ( ConfigurationActionImpl ) configAction;
+ action.setGlobalVisibilityAttribute( true );
+ visible = configAction.isPartMenuVisible();
+ assertTrue( visible );
+ action.setGlobalVisibilityAttribute( false );
+ visible = configAction.isPartMenuVisible();
+ assertFalse( visible );
+ }
+
public void testActionVisibility() {
String viewId = "org.eclipse.view";
String actionId = "org.eclipse.action";
@@ -153,6 +166,19 @@ public class ConfigurationActionTest extends RAPTestCase {
assertFalse( visible );
}
+ public void testActionVisibilityWithGlobalValue() {
+ String viewId = "org.eclipse.view";
+ String actionId = "org.eclipse.action";
+ boolean visible = configAction.isViewActionVisibile( viewId, actionId );
+ assertFalse( visible );
+ ConfigurationActionImpl action = ( ConfigurationActionImpl ) configAction;
+ action.setGlobalVisibilityAttribute( true );
+ visible = configAction.isViewActionVisibile( viewId, actionId );
+ assertTrue( visible );
+ action.setGlobalVisibilityAttribute( false );
+ visible = configAction.isViewActionVisibile( viewId, actionId );
+ assertFalse( visible );
+ }
private ConfigurableStack getConfigurableStack() {
ConfigurableStack result = null;
diff --git a/tests/org.eclipse.rap.ui.tests/IAD API Tests/org/eclipse/rap/interactiondesign/tests/impl/ConfigurationActionImpl.java b/tests/org.eclipse.rap.ui.tests/IAD API Tests/org/eclipse/rap/interactiondesign/tests/impl/ConfigurationActionImpl.java
index e8f8700a10..00b1bc3523 100644
--- a/tests/org.eclipse.rap.ui.tests/IAD API Tests/org/eclipse/rap/interactiondesign/tests/impl/ConfigurationActionImpl.java
+++ b/tests/org.eclipse.rap.ui.tests/IAD API Tests/org/eclipse/rap/interactiondesign/tests/impl/ConfigurationActionImpl.java
@@ -9,12 +9,84 @@
*******************************************************************************/
package org.eclipse.rap.interactiondesign.tests.impl;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.rap.ui.interactiondesign.ConfigurableStack;
import org.eclipse.rap.ui.interactiondesign.ConfigurationAction;
+import org.eclipse.rap.ui.interactiondesign.internal.ConfigurableStackProxy;
+import org.eclipse.ui.internal.util.PrefUtil;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
public class ConfigurationActionImpl extends ConfigurationAction {
+
+ /**
+ * Helper method to check if all view contrib items are visible by default.
+ * @return true if all items are visible by default.
+ */
+ public static boolean allActionsVisible() {
+ return visibility;
+ }
+
+ private static boolean visibility = false;
+
+ public void setGlobalVisibilityAttribute( final boolean visibility ) {
+ ConfigurationActionImpl.visibility = visibility;
+ }
public ConfigurationActionImpl() {
}
+ public boolean isViewActionVisibile( final String viewId,
+ final String actionId )
+ {
+ boolean result = true;
+ if( !allActionsVisible() ) {
+ String identifier = getActionIdentifier( viewId, actionId );
+ ScopedPreferenceStore prefStore
+ = ( ScopedPreferenceStore ) PrefUtil.getAPIPreferenceStore();
+ result = prefStore.getBoolean( identifier );
+ }
+ return result;
+ }
+
+ public boolean isPartMenuVisible() {
+ boolean result = true;
+ if( !allActionsVisible() ) {
+ if( getStackPresentation() instanceof ConfigurableStack ) {
+ ConfigurableStack configStack
+ = ( ConfigurableStack ) getStackPresentation();
+ String paneId = configStack.getPaneId( getSite() );
+ String identifier = getPartMenuIdentifier( paneId );
+ result = loadPartmenuVisibility( identifier );
+ }
+ }
+ return result;
+ }
+
+ private boolean loadPartmenuVisibility( final String identifier ) {
+ boolean result = false;
+ IPreferenceStore preferenceStore = PrefUtil.getAPIPreferenceStore();
+ result = preferenceStore.getBoolean( identifier );
+ return result;
+ }
+
+ private String getActionIdentifier( final String viewId,
+ final String actionId )
+ {
+ return
+ ConfigurableStackProxy.STACK_PRESENTATION_ID
+ + "/"
+ + viewId
+ + "/"
+ + actionId;
+ }
+
+ private String getPartMenuIdentifier( final String paneId ) {
+ return
+ ConfigurableStackProxy.STACK_PRESENTATION_ID
+ + "/"
+ + paneId
+ + "/partMenu";
+ }
+
}
diff --git a/tests/org.eclipse.rap.ui.tests/plugin.xml b/tests/org.eclipse.rap.ui.tests/plugin.xml
index 0eea6ff6a3..ba01265bd7 100644
--- a/tests/org.eclipse.rap.ui.tests/plugin.xml
+++ b/tests/org.eclipse.rap.ui.tests/plugin.xml
@@ -3855,7 +3855,8 @@
<presentationFactory
defaultLayoutId="org.eclipse.rap.ui.interactiondesign.test.layout2"
id="org.eclipse.rap.ui.interactiondesign.test.factory"
- name="TestFactory">
+ name="TestFactory"
+ viewActionsVisible="false">
<stackPresentation
id="org.eclipse.rap.ui.interactiondesign.test.stackPresentation"
name="TestStack"

Back to the top