Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 280299 | Differences between
and this patch

Collapse All | Expand All

(-)schema/rap/branding.exsd (+7 lines)
Lines 294-299 Link Here
294
               </documentation>
294
               </documentation>
295
            </annotation>
295
            </annotation>
296
         </attribute>
296
         </attribute>
297
         <attribute name="viewactionsVisibile" type="boolean">
298
            <annotation>
299
               <documentation>
300
                  Sets the default vibility value for a view&apos;s action/command. When checked, all actions are visible. When unchecked all actions are invisible and can be configured via the configuration menu.
301
               </documentation>
302
            </annotation>
303
         </attribute>
297
      </complexType>
304
      </complexType>
298
   </element>
305
   </element>
299
306
(-)Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java (+10 lines)
Lines 27-32 Link Here
27
import org.eclipse.jface.action.IToolBarManager;
27
import org.eclipse.jface.action.IToolBarManager;
28
import org.eclipse.jface.internal.provisional.action.ICoolBarManager2;
28
import org.eclipse.jface.internal.provisional.action.ICoolBarManager2;
29
import org.eclipse.jface.internal.provisional.action.IToolBarContributionItem;
29
import org.eclipse.jface.internal.provisional.action.IToolBarContributionItem;
30
import org.eclipse.jface.preference.IPreferenceStore;
30
import org.eclipse.jface.window.Window;
31
import org.eclipse.jface.window.Window;
31
import org.eclipse.osgi.util.TextProcessor;
32
import org.eclipse.osgi.util.TextProcessor;
32
import org.eclipse.rwt.branding.AbstractBranding;
33
import org.eclipse.rwt.branding.AbstractBranding;
Lines 648-653 Link Here
648
        = element.getChildren( "presentationFactory" );
649
        = element.getChildren( "presentationFactory" );
649
      if( factory.length > 0 ) {
650
      if( factory.length > 0 ) {
650
        result = factory[ 0 ].getAttribute( "id" );
651
        result = factory[ 0 ].getAttribute( "id" );
652
        String visibility = factory[ 0 ].getAttribute( "viewactionsVisibile" );
653
        boolean actionsVisible = false;
654
        if( visibility != null 
655
            && Boolean.valueOf( visibility ).booleanValue() ) 
656
        {
657
          actionsVisible = true;
658
        }
659
        IPreferenceStore apiPreferenceStore = PrefUtil.getAPIPreferenceStore();
660
        apiPreferenceStore.setValue( "viewActionVisibility", actionsVisible );
651
      }
661
      }
652
      return result;
662
      return result;
653
    }
663
    }
(-)Eclipse UI/org/eclipse/rap/ui/interactiondesign/ConfigurableStack.java (-23 / +36 lines)
Lines 60-65 Link Here
60
 */
60
 */
61
public abstract class ConfigurableStack extends StackPresentation {
61
public abstract class ConfigurableStack extends StackPresentation {
62
62
63
  public static final String VIEW_ACTION_VISIBILITY = "viewActionVisibility";
64
63
  private static final String CONFIG_ACTION_NAME = "actionClass";
65
  private static final String CONFIG_ACTION_NAME = "actionClass";
64
  
66
  
65
  private static IStackPresentationSite siteDummy 
67
  private static IStackPresentationSite siteDummy 
Lines 235-264 Link Here
235
        PresentablePart part = ( PresentablePart ) selectedPart;
237
        PresentablePart part = ( PresentablePart ) selectedPart;
236
        result = part.getPane().getToolBar();
238
        result = part.getPane().getToolBar();
237
      }  
239
      }  
238
      // set the correct visibility
240
      
239
      for( int i = 0; i < items.length; i++ ) {
241
      // check if all actions are visible or not
240
        if( items[ i ] instanceof ActionContributionItem ) {
242
      IPreferenceStore apiPreferenceStore = PrefUtil.getAPIPreferenceStore();
241
          // actions
243
      boolean actionsVisible 
242
          ActionContributionItem actionItem 
244
        = apiPreferenceStore.getBoolean( VIEW_ACTION_VISIBILITY );
243
            = ( ActionContributionItem ) items[ i ];
245
      if( !actionsVisible ) {
244
          String actionId = actionItem.getAction().getId();
246
        // set the correct visibility
245
          boolean isVisible 
247
        for( int i = 0; i < items.length; i++ ) {
246
            = action.isViewActionVisibile( paneId, actionId );
248
          if( items[ i ] instanceof ActionContributionItem ) {
247
          actionItem.setVisible( isVisible );
249
            // actions
248
          if( isVisible ) {     
250
            ActionContributionItem actionItem 
249
            actionCount++;
251
              = ( ActionContributionItem ) items[ i ];
252
            String actionId = actionItem.getAction().getId();
253
            boolean isVisible 
254
              = action.isViewActionVisibile( paneId, actionId );
255
            actionItem.setVisible( isVisible );
256
            if( isVisible ) {     
257
              actionCount++;
258
            }
259
          } else if( items[ i ] instanceof CommandContributionItem ) {
260
            // commands
261
            CommandContributionItem commandItem 
262
              = ( CommandContributionItem ) items[ i ];
263
            boolean isVisible 
264
              = action.isViewActionVisibile( paneId, commandItem.getId() );
265
            commandItem.setVisible( isVisible );
266
            if( isVisible ) {     
267
              actionCount++;
268
            } 
250
          }
269
          }
251
        } else if( items[ i ] instanceof CommandContributionItem ) {
252
          // commands
253
          CommandContributionItem commandItem 
254
            = ( CommandContributionItem ) items[ i ];
255
          boolean isVisible 
256
            = action.isViewActionVisibile( paneId, commandItem.getId() );
257
          commandItem.setVisible( isVisible );
258
          if( isVisible ) {     
259
            actionCount++;
260
          } 
261
        }
270
        }
271
      } else {
272
        actionCount = 1;
262
      }
273
      }
263
      
274
      
264
      // update the toolbar manager with the new visibility
275
      // update the toolbar manager with the new visibility
Lines 552-558 Link Here
552
  
563
  
553
  private boolean isPartMenuVisisble() {
564
  private boolean isPartMenuVisisble() {
554
    boolean result = false;
565
    boolean result = false;
555
    if( configAction != null ) {
566
    IPreferenceStore apiPreferenceStore = PrefUtil.getAPIPreferenceStore();
567
    result = apiPreferenceStore.getBoolean( VIEW_ACTION_VISIBILITY );
568
    if( configAction != null && !result ) {
556
      result = configAction.isPartMenuVisible();
569
      result = configAction.isPartMenuVisible();
557
    }
570
    }
558
    
571
    
(-)src/org/eclipse/rap/internal/design/example/business/stacks/ViewStackPresentation.java (-1 / +6 lines)
Lines 14-19 Link Here
14
import java.util.List;
14
import java.util.List;
15
import java.util.Map;
15
import java.util.Map;
16
16
17
import org.eclipse.jface.preference.IPreferenceStore;
17
import org.eclipse.rap.internal.design.example.business.builder.BusinessStackBuider;
18
import org.eclipse.rap.internal.design.example.business.builder.BusinessStackBuider;
18
import org.eclipse.rap.internal.design.example.business.layoutsets.StackInitializer;
19
import org.eclipse.rap.internal.design.example.business.layoutsets.StackInitializer;
19
import org.eclipse.rap.ui.interactiondesign.ConfigurableStack;
20
import org.eclipse.rap.ui.interactiondesign.ConfigurableStack;
Lines 52-57 Link Here
52
import org.eclipse.ui.PlatformUI;
53
import org.eclipse.ui.PlatformUI;
53
import org.eclipse.ui.internal.PartPane;
54
import org.eclipse.ui.internal.PartPane;
54
import org.eclipse.ui.internal.presentations.PresentablePart;
55
import org.eclipse.ui.internal.presentations.PresentablePart;
56
import org.eclipse.ui.internal.util.PrefUtil;
55
import org.eclipse.ui.presentations.IPartMenu;
57
import org.eclipse.ui.presentations.IPartMenu;
56
import org.eclipse.ui.presentations.IPresentablePart;
58
import org.eclipse.ui.presentations.IPresentablePart;
57
59
Lines 515-522 Link Here
515
517
516
  private void createConfArea( final FormData fdTabBg ) {
518
  private void createConfArea( final FormData fdTabBg ) {
517
    final ConfigurationAction configAction = getConfigAction(); 
519
    final ConfigurationAction configAction = getConfigAction(); 
520
    IPreferenceStore prefStore = PrefUtil.getAPIPreferenceStore();
521
    final boolean showConfMenu 
522
      = !prefStore.getBoolean( ConfigurableStack.VIEW_ACTION_VISIBILITY );
518
    
523
    
519
    if( configAction != null ) {
524
    if( configAction != null && showConfMenu ) {
520
      confArea = new Composite( getTabBar(), SWT.NONE );
525
      confArea = new Composite( getTabBar(), SWT.NONE );
521
      Image confBg = stackBuilder.getImage( StackInitializer.CONF_BG_INACTIVE );
526
      Image confBg = stackBuilder.getImage( StackInitializer.CONF_BG_INACTIVE );
522
      confArea.setBackgroundImage( confBg );
527
      confArea.setBackgroundImage( confBg );
(-)plugin.xml (-1 / +2 lines)
Lines 20-26 Link Here
20
         <presentationFactory
20
         <presentationFactory
21
               defaultLayoutId="org.eclipse.rap.design.example.business.layout"
21
               defaultLayoutId="org.eclipse.rap.design.example.business.layout"
22
               id="org.eclipse.rap.design.example.business.factory"
22
               id="org.eclipse.rap.design.example.business.factory"
23
               name="Business Presentation Factory">
23
               name="Business Presentation Factory"
24
               viewactionsVisibile="false">
24
            <defaultStackPresentation
25
            <defaultStackPresentation
25
                  id="org.eclipse.rap.design.example.business.stack.view">
26
                  id="org.eclipse.rap.design.example.business.stack.view">
26
            </defaultStackPresentation>
27
            </defaultStackPresentation>

Return to bug 280299