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 142135 Details for
Bug 280299
[design] provide a solution to make all viewactions visible
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]
solution for optional view action visibility
viewActionVisibility (text/plain), 8.95 KB, created by
Holger Staudacher
on 2009-07-21 10:16:01 EDT
(
hide
)
Description:
solution for optional view action visibility
Filename:
MIME Type:
Creator:
Holger Staudacher
Created:
2009-07-21 10:16:01 EDT
Size:
8.95 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.ui >Index: schema/rap/branding.exsd >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.ui/org.eclipse.rap.ui/schema/rap/branding.exsd,v >retrieving revision 1.6 >diff -u -r1.6 branding.exsd >--- schema/rap/branding.exsd 15 Jun 2009 12:23:27 -0000 1.6 >+++ schema/rap/branding.exsd 21 Jul 2009 14:13:01 -0000 >@@ -294,6 +294,13 @@ > </documentation> > </annotation> > </attribute> >+ <attribute name="viewactionsVisibile" type="boolean"> >+ <annotation> >+ <documentation> >+ Sets the default vibility value for a view's action/command. When checked, all actions are visible. When unchecked all actions are invisible and can be configured via the configuration menu. >+ </documentation> >+ </annotation> >+ </attribute> > </complexType> > </element> > >#P org.eclipse.rap.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.ui/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java,v >retrieving revision 1.3 >diff -u -r1.3 WorkbenchWindowConfigurer.java >--- Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java 24 Feb 2009 11:29:44 -0000 1.3 >+++ Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java 21 Jul 2009 14:13:07 -0000 >@@ -27,6 +27,7 @@ > import org.eclipse.jface.action.IToolBarManager; > import org.eclipse.jface.internal.provisional.action.ICoolBarManager2; > import org.eclipse.jface.internal.provisional.action.IToolBarContributionItem; >+import org.eclipse.jface.preference.IPreferenceStore; > import org.eclipse.jface.window.Window; > import org.eclipse.osgi.util.TextProcessor; > import org.eclipse.rwt.branding.AbstractBranding; >@@ -648,6 +649,15 @@ > = element.getChildren( "presentationFactory" ); > if( factory.length > 0 ) { > result = factory[ 0 ].getAttribute( "id" ); >+ String visibility = factory[ 0 ].getAttribute( "viewactionsVisibile" ); >+ boolean actionsVisible = false; >+ if( visibility != null >+ && Boolean.valueOf( visibility ).booleanValue() ) >+ { >+ actionsVisible = true; >+ } >+ IPreferenceStore apiPreferenceStore = PrefUtil.getAPIPreferenceStore(); >+ apiPreferenceStore.setValue( "viewActionVisibility", actionsVisible ); > } > return result; > } >Index: Eclipse UI/org/eclipse/rap/ui/interactiondesign/ConfigurableStack.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.ui/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/rap/ui/interactiondesign/ConfigurableStack.java,v >retrieving revision 1.5 >diff -u -r1.5 ConfigurableStack.java >--- Eclipse UI/org/eclipse/rap/ui/interactiondesign/ConfigurableStack.java 8 Jun 2009 18:41:55 -0000 1.5 >+++ Eclipse UI/org/eclipse/rap/ui/interactiondesign/ConfigurableStack.java 21 Jul 2009 14:13:06 -0000 >@@ -60,6 +60,8 @@ > */ > public abstract class ConfigurableStack extends StackPresentation { > >+ public static final String VIEW_ACTION_VISIBILITY = "viewActionVisibility"; >+ > private static final String CONFIG_ACTION_NAME = "actionClass"; > > private static IStackPresentationSite siteDummy >@@ -235,30 +237,39 @@ > PresentablePart part = ( PresentablePart ) selectedPart; > result = part.getPane().getToolBar(); > } >- // set the correct visibility >- for( int i = 0; i < items.length; i++ ) { >- if( items[ i ] instanceof ActionContributionItem ) { >- // actions >- ActionContributionItem actionItem >- = ( ActionContributionItem ) items[ i ]; >- String actionId = actionItem.getAction().getId(); >- boolean isVisible >- = action.isViewActionVisibile( paneId, actionId ); >- actionItem.setVisible( isVisible ); >- if( isVisible ) { >- actionCount++; >+ >+ // check if all actions are visible or not >+ IPreferenceStore apiPreferenceStore = PrefUtil.getAPIPreferenceStore(); >+ boolean actionsVisible >+ = apiPreferenceStore.getBoolean( VIEW_ACTION_VISIBILITY ); >+ if( !actionsVisible ) { >+ // set the correct visibility >+ for( int i = 0; i < items.length; i++ ) { >+ if( items[ i ] instanceof ActionContributionItem ) { >+ // actions >+ ActionContributionItem actionItem >+ = ( ActionContributionItem ) items[ i ]; >+ String actionId = actionItem.getAction().getId(); >+ boolean isVisible >+ = action.isViewActionVisibile( paneId, actionId ); >+ actionItem.setVisible( isVisible ); >+ if( isVisible ) { >+ actionCount++; >+ } >+ } else if( items[ i ] instanceof CommandContributionItem ) { >+ // commands >+ CommandContributionItem commandItem >+ = ( CommandContributionItem ) items[ i ]; >+ boolean isVisible >+ = action.isViewActionVisibile( paneId, commandItem.getId() ); >+ commandItem.setVisible( isVisible ); >+ if( isVisible ) { >+ actionCount++; >+ } > } >- } else if( items[ i ] instanceof CommandContributionItem ) { >- // commands >- CommandContributionItem commandItem >- = ( CommandContributionItem ) items[ i ]; >- boolean isVisible >- = action.isViewActionVisibile( paneId, commandItem.getId() ); >- commandItem.setVisible( isVisible ); >- if( isVisible ) { >- actionCount++; >- } > } >+ } else { >+ actionCount = 1; > } > > // update the toolbar manager with the new visibility >@@ -552,7 +563,9 @@ > > private boolean isPartMenuVisisble() { > boolean result = false; >- if( configAction != null ) { >+ IPreferenceStore apiPreferenceStore = PrefUtil.getAPIPreferenceStore(); >+ result = apiPreferenceStore.getBoolean( VIEW_ACTION_VISIBILITY ); >+ if( configAction != null && !result ) { > result = configAction.isPartMenuVisible(); > } > >#P org.eclipse.rap.design.example >Index: src/org/eclipse/rap/internal/design/example/business/stacks/ViewStackPresentation.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.ui/org.eclipse.rap.design.example/src/org/eclipse/rap/internal/design/example/business/stacks/ViewStackPresentation.java,v >retrieving revision 1.4 >diff -u -r1.4 ViewStackPresentation.java >--- src/org/eclipse/rap/internal/design/example/business/stacks/ViewStackPresentation.java 15 Jun 2009 17:02:53 -0000 1.4 >+++ src/org/eclipse/rap/internal/design/example/business/stacks/ViewStackPresentation.java 21 Jul 2009 14:13:16 -0000 >@@ -14,6 +14,7 @@ > import java.util.List; > import java.util.Map; > >+import org.eclipse.jface.preference.IPreferenceStore; > import org.eclipse.rap.internal.design.example.business.builder.BusinessStackBuider; > import org.eclipse.rap.internal.design.example.business.layoutsets.StackInitializer; > import org.eclipse.rap.ui.interactiondesign.ConfigurableStack; >@@ -52,6 +53,7 @@ > import org.eclipse.ui.PlatformUI; > import org.eclipse.ui.internal.PartPane; > import org.eclipse.ui.internal.presentations.PresentablePart; >+import org.eclipse.ui.internal.util.PrefUtil; > import org.eclipse.ui.presentations.IPartMenu; > import org.eclipse.ui.presentations.IPresentablePart; > >@@ -515,8 +517,11 @@ > > private void createConfArea( final FormData fdTabBg ) { > final ConfigurationAction configAction = getConfigAction(); >+ IPreferenceStore prefStore = PrefUtil.getAPIPreferenceStore(); >+ final boolean showConfMenu >+ = !prefStore.getBoolean( ConfigurableStack.VIEW_ACTION_VISIBILITY ); > >- if( configAction != null ) { >+ if( configAction != null && showConfMenu ) { > confArea = new Composite( getTabBar(), SWT.NONE ); > Image confBg = stackBuilder.getImage( StackInitializer.CONF_BG_INACTIVE ); > confArea.setBackgroundImage( confBg ); >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.ui/org.eclipse.rap.design.example/plugin.xml,v >retrieving revision 1.3 >diff -u -r1.3 plugin.xml >--- plugin.xml 21 Jul 2009 12:49:39 -0000 1.3 >+++ plugin.xml 21 Jul 2009 14:13:16 -0000 >@@ -20,7 +20,8 @@ > <presentationFactory > defaultLayoutId="org.eclipse.rap.design.example.business.layout" > id="org.eclipse.rap.design.example.business.factory" >- name="Business Presentation Factory"> >+ name="Business Presentation Factory" >+ viewactionsVisibile="false"> > <defaultStackPresentation > id="org.eclipse.rap.design.example.business.stack.view"> > </defaultStackPresentation>
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 280299
:
142135
|
142136
|
161274
|
161275