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 372032 | Differences between
and this patch

Collapse All | Expand All

(-)a/org.eclipse.debug.ui/plugin.xml (-1 / +13 lines)
Lines 948-953 Link Here
948
               tooltip="%memoryViewPrefAction.label"/>
948
               tooltip="%memoryViewPrefAction.label"/>
949
      </viewContribution>
949
      </viewContribution>
950
   </extension>
950
   </extension>
951
   
952
   <extension
953
         point="org.eclipse.core.expressions.propertyTesters">
954
      <propertyTester
955
            class="org.eclipse.debug.internal.ui.views.launch.DebugViewToolbarVisibleTester"
956
            id="org.eclipse.debug.ui.debugViewToolbarVisibleTester"
957
            namespace="org.eclipse.debug.ui"
958
            properties="isDebugViewToolbarVisible"
959
            type="java.lang.Object">
960
      </propertyTester>
961
   </extension>
962
   
963
   
951
   <extension
964
   <extension
952
         point="org.eclipse.ui.popupMenus">
965
         point="org.eclipse.ui.popupMenus">
953
         
966
         
Lines 3138-3142 M4 = Platform-specific fourth key Link Here
3138
         </bundle>
3151
         </bundle>
3139
      </component>
3152
      </component>
3140
   </extension>
3153
   </extension>
3141
3142
</plugin>
3154
</plugin>
(-)a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewToolbarVisibleTester.java (+29 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2012 Wind River Systems and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     Wind River Systems - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.debug.internal.ui.views.launch;
12
13
import org.eclipse.core.expressions.PropertyTester;
14
import org.eclipse.debug.ui.IDebugUIConstants;
15
16
/**
17
 * 
18
 */
19
public class DebugViewToolbarVisibleTester extends PropertyTester {
20
21
    private static final String VISIBLE = "isDebugViewToolbarVisible"; //$NON-NLS-1$
22
23
    public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
24
        if (VISIBLE.equals(property)) {
25
            return "true".equals(System.getProperty(IDebugUIConstants.DEBUG_VIEW_TOOBAR_VISIBLE)); //$NON-NLS-1$
26
        }
27
        return false;
28
    }   
29
}
(-)a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java (-1 / +12 lines)
Lines 119-124 import org.eclipse.ui.IWorkbenchPart; Link Here
119
import org.eclipse.ui.IWorkbenchPartReference;
119
import org.eclipse.ui.IWorkbenchPartReference;
120
import org.eclipse.ui.IWorkbenchWindow;
120
import org.eclipse.ui.IWorkbenchWindow;
121
import org.eclipse.ui.PartInitException;
121
import org.eclipse.ui.PartInitException;
122
import org.eclipse.ui.PlatformUI;
122
import org.eclipse.ui.WorkbenchException;
123
import org.eclipse.ui.WorkbenchException;
123
import org.eclipse.ui.XMLMemento;
124
import org.eclipse.ui.XMLMemento;
124
import org.eclipse.ui.actions.SelectionListenerAction;
125
import org.eclipse.ui.actions.SelectionListenerAction;
Lines 133-138 import org.eclipse.ui.part.Page; Link Here
133
import org.eclipse.ui.part.ShowInContext;
134
import org.eclipse.ui.part.ShowInContext;
134
import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
135
import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
135
import org.eclipse.ui.progress.UIJob;
136
import org.eclipse.ui.progress.UIJob;
137
import org.eclipse.ui.services.IEvaluationService;
136
import org.eclipse.ui.texteditor.IUpdate;
138
import org.eclipse.ui.texteditor.IUpdate;
137
139
138
public class LaunchView extends AbstractDebugView 
140
public class LaunchView extends AbstractDebugView 
Lines 1062-1071 public class LaunchView extends AbstractDebugView Link Here
1062
       } else {
1064
       } else {
1063
           removeDebugToolbarActions(tbm);
1065
           removeDebugToolbarActions(tbm);
1064
       }
1066
       }
1065
       getViewSite().getActionBars().updateActionBars();
1066
       
1067
       
1067
       // Update system property used by contributed actions.
1068
       // Update system property used by contributed actions.
1068
       System.setProperty(IDebugUIConstants.DEBUG_VIEW_TOOBAR_VISIBLE, Boolean.toString(show));
1069
       System.setProperty(IDebugUIConstants.DEBUG_VIEW_TOOBAR_VISIBLE, Boolean.toString(show));
1070
1071
       // Request re-evaluation of property "org.eclipse.debug.ui.isDebugViewToolbarVisible" 
1072
       // to update contributed toolbar commands.
1073
       IEvaluationService exprService = (IEvaluationService) PlatformUI.getWorkbench().getService(IEvaluationService.class);
1074
       if (exprService != null) {
1075
           exprService.requestEvaluation("org.eclipse.debug.ui.isDebugViewToolbarVisible"); //$NON-NLS-1$
1076
       }
1077
1078
       
1079
       getViewSite().getActionBars().updateActionBars();       
1069
   }
1080
   }
1070
   
1081
   
1071
   
1082
   
(-)a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java (-4 / +13 lines)
Lines 629-637 public interface IDebugUIConstants { Link Here
629
    /**
629
    /**
630
     * System property which indicates whether the common debugging actions 
630
     * System property which indicates whether the common debugging actions 
631
     * should be shown in the Debug view, as opposed to the top level 
631
     * should be shown in the Debug view, as opposed to the top level 
632
     * toolbar.  Actions contributing to the debug view can use this property
632
     * toolbar.  
633
     * to control their visibility.
633
     * <p>
634
     * 
634
     * This system property can be used to control the visibility of menu contributions.
635
     * Clients should use the <code>org.eclipse.debug.ui.isDebugViewToolbarVisible</code>
636
     * property to do this instead of using the system property, because the expression
637
     * service notifies listeners as soon as the property is updated.  The example below
638
     * will cause a toolbar contribution to appear/disappear as the toolbar visibility 
639
     * is toggled. 
640
     * <pre>
641
     * &lt;visibleWhen checkEnabled="false"&gt;
642
     *    &lt;test property="org.eclipse.debug.ui.isDebugViewToolbarVisible"/&gt;
643
     * &lt;/visibleWhen&gt;
644
     * </pre>
635
     * @since 3.8
645
     * @since 3.8
636
     */
646
     */
637
    public static final String DEBUG_VIEW_TOOBAR_VISIBLE = PLUGIN_ID + ".debugViewToolbarVisible"; //$NON-NLS-1$
647
    public static final String DEBUG_VIEW_TOOBAR_VISIBLE = PLUGIN_ID + ".debugViewToolbarVisible"; //$NON-NLS-1$
638
- 

Return to bug 372032