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

Collapse All | Expand All

(-)plugin.xml (-26 / +87 lines)
Lines 113-144 Link Here
113
            label="%JDTDebugActionSet.label"
113
            label="%JDTDebugActionSet.label"
114
            visible="false"
114
            visible="false"
115
            id="org.eclipse.jdt.debug.ui.JDTDebugActionSet">
115
            id="org.eclipse.jdt.debug.ui.JDTDebugActionSet">
116
         <menu
117
               label="%RunMenu.label"
118
               path="additions"
119
               id="org.eclipse.ui.run">
120
            <separator
121
                  name="jdtGroup">
122
            </separator>
123
         </menu>
124
         <action
125
	           definitionId="org.eclipse.jdt.debug.ui.commands.AddClassPrepareBreakpoint"
126
               label="%classPrepareAction.label"
127
               icon="$nl$/icons/full/obj16/class_obj.gif"
128
               helpContextId="add_class_prepare_action_context"
129
               class="org.eclipse.jdt.internal.debug.ui.breakpoints.AddClassPrepareBreakpointAction"
130
               menubarPath="org.eclipse.ui.run/breakpointGroup"
131
               id="org.eclipse.jdt.debug.ui.actions.AddClassPrepareBreakpoint">
132
         </action>         
133
         <action
134
               definitionId="org.eclipse.jdt.debug.ui.commands.AddExceptionBreakpoint"
135
               label="%exceptionAction.accel.label"
136
               icon="$nl$/icons/full/elcl16/exc_catch.gif"
137
               helpContextId="add_exception_action_context"
138
               class="org.eclipse.jdt.internal.debug.ui.breakpoints.AddExceptionAction"
139
               menubarPath="org.eclipse.ui.run/breakpointGroup"
140
               id="org.eclipse.jdt.debug.ui.actions.AddExceptionBreakpoint">
141
         </action>
142
         <action
116
         <action
143
               definitionId="org.eclipse.jdt.debug.ui.commands.StepIntoSelection"
117
               definitionId="org.eclipse.jdt.debug.ui.commands.StepIntoSelection"
144
               label="%stepIntoSelectionAction.label"
118
               label="%stepIntoSelectionAction.label"
Lines 158-163 Link Here
158
                  </objectClass>
132
                  </objectClass>
159
               </and>
133
               </and>
160
            </enablement>
134
            </enablement>
135
         </action>            
136
         <action
137
	           definitionId="org.eclipse.jdt.debug.ui.commands.AddClassPrepareBreakpoint"
138
               label="%classPrepareAction.label"
139
               icon="$nl$/icons/full/obj16/class_obj.gif"
140
               helpContextId="add_class_prepare_action_context"
141
               class="org.eclipse.jdt.internal.debug.ui.breakpoints.AddClassPrepareBreakpointAction"
142
               menubarPath="org.eclipse.ui.run/breakpointGroup"
143
               id="org.eclipse.jdt.debug.ui.actions.AddClassPrepareBreakpoint">
144
         </action>         
145
         <action
146
               definitionId="org.eclipse.jdt.debug.ui.commands.AddExceptionBreakpoint"
147
               label="%exceptionAction.accel.label"
148
               icon="$nl$/icons/full/elcl16/exc_catch.gif"
149
               helpContextId="add_exception_action_context"
150
               class="org.eclipse.jdt.internal.debug.ui.breakpoints.AddExceptionAction"
151
               menubarPath="org.eclipse.ui.run/breakpointGroup"
152
               id="org.eclipse.jdt.debug.ui.actions.AddExceptionBreakpoint">
161
         </action>
153
         </action>
162
         <action
154
         <action
163
               id="org.eclipse.jdt.debug.ui.actions.Execute"
155
               id="org.eclipse.jdt.debug.ui.actions.Execute"
Lines 2268-2273 Link Here
2268
            description="%ActionDefinition.breakpointproperties.description"
2260
            description="%ActionDefinition.breakpointproperties.description"
2269
            id="org.eclipse.jdt.debug.ui.breakpoint.properties"
2261
            id="org.eclipse.jdt.debug.ui.breakpoint.properties"
2270
            name="%CommandDefinition.breakpointproperties.name">
2262
            name="%CommandDefinition.breakpointproperties.name">
2263
      </command>
2264
      <command
2265
            categoryId="org.eclipse.debug.ui.category.run"
2266
            description="%Command.description.ForceReturn"
2267
            id="org.eclipse.jdt.debug.ui.commands.ForceReturn"
2268
            name="%Command.name.ForceReturn">
2271
      </command> 
2269
      </command> 
2272
   </extension>
2270
   </extension>
2273
   <extension point="org.eclipse.ui.bindings">
2271
   <extension point="org.eclipse.ui.bindings">
Lines 2633-2638 Link Here
2633
            name="%ActionContext.breakpointsview.name"
2631
            name="%ActionContext.breakpointsview.name"
2634
            parentId="org.eclipse.ui.contexts.window">
2632
            parentId="org.eclipse.ui.contexts.window">
2635
      </context>
2633
      </context>
2634
      <context
2635
            id="org.eclipse.jdt.debug.ui.evaluation"
2636
            name="Java Debug Expression Evaluation"
2637
            >
2638
      </context>
2636
   </extension>
2639
   </extension>
2637
   <extension
2640
   <extension
2638
         point="org.eclipse.debug.ui.debugModelContextBindings">
2641
         point="org.eclipse.debug.ui.debugModelContextBindings">
Lines 2945-2950 Link Here
2945
    </updater>
2948
    </updater>
2946
 </extension>
2949
 </extension>
2947
 <extension
2950
 <extension
2951
       point="org.eclipse.ui.menus">
2952
    <menuContribution
2953
          locationURI="menu:org.eclipse.ui.run?after=profileGroup">
2954
       <separator
2955
             name="jdtGroup"
2956
             visible="true">
2957
       </separator>
2958
    </menuContribution>
2959
    <menuContribution
2960
          locationURI="menu:org.eclipse.debug.ui.DebugView?after=basic">
2961
       <separator
2962
             name="javaActions"
2963
             visible="true">
2964
       </separator>
2965
    </menuContribution>
2966
    <menuContribution
2967
          locationURI="menu:org.eclipse.ui.run?after=jdtGroup">
2968
       <command
2969
             commandId="org.eclipse.jdt.debug.ui.commands.ForceReturn"
2970
             style="push">
2971
       </command>
2972
    </menuContribution>
2973
 </extension>	
2974
 <extension
2948
       point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
2975
       point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
2949
    <hyperlinkDetector
2976
    <hyperlinkDetector
2950
          activate="true"
2977
          activate="true"
Lines 2955-2959 Link Here
2955
          targetId="org.eclipse.jdt.ui.javaCode">
2982
          targetId="org.eclipse.jdt.ui.javaCode">
2956
    </hyperlinkDetector>
2983
    </hyperlinkDetector>
2957
 </extension>
2984
 </extension>
2985
 <extension
2986
       point="org.eclipse.ui.handlers">
2987
    <handler
2988
          class="org.eclipse.jdt.internal.debug.ui.evaluation.ForceReturnHandler"
2989
          commandId="org.eclipse.jdt.debug.ui.commands.ForceReturn">
2990
       <activeWhen>
2991
          <with
2992
                variable="activePartId">
2993
             <equals
2994
                   value="org.eclipse.jdt.debug.ui.DisplayView">
2995
             </equals>
2996
          </with>
2997
       </activeWhen>
2998
       <enabledWhen>
2999
          <with
3000
                variable="activeContexts">
3001
             <test
3002
                   property="org.eclipse.jdt.debug.ui.contains"
3003
                   value="org.eclipse.jdt.debug.ui.evaluation">
3004
             </test>
3005
          </with>
3006
       </enabledWhen>
3007
    </handler>
3008
 </extension>
3009
 <extension
3010
       point="org.eclipse.core.expressions.propertyTesters">
3011
    <propertyTester
3012
          class="org.eclipse.jdt.internal.debug.ui.evaluation.EvaluationPropertyTester"
3013
          id="org.eclipse.jdt.debug.ui.evaluationPropertyTester"
3014
          namespace="org.eclipse.jdt.debug.ui"
3015
          properties="contains"
3016
          type="java.lang.Object">
3017
    </propertyTester>
3018
 </extension>
2958
    
3019
    
2959
</plugin>
3020
</plugin>
(-)plugin.properties (+3 lines)
Lines 21-26 Link Here
21
allinstances.label=All Ins&tances...
21
allinstances.label=All Ins&tances...
22
allinstances.tooltip=Displays a popup window showing all live instances of the selected object in the current running VM
22
allinstances.tooltip=Displays a popup window showing all live instances of the selected object in the current running VM
23
23
24
Command.name.ForceReturn=&Force Return
25
Command.description.ForceReturn=Returns the value of the selected expression from the current method
26
24
caughtAction.label=&Caught
27
caughtAction.label=&Caught
25
28
26
VariablesViewJavaSubmenu.label=&Java
29
VariablesViewJavaSubmenu.label=&Java
(-)ui/org/eclipse/jdt/internal/debug/ui/JDIDebugUIPlugin.java (+6 lines)
Lines 114-119 Link Here
114
	public static final String COMMAND_INSPECT = "org.eclipse.jdt.debug.ui.commands.Inspect"; //$NON-NLS-1$
114
	public static final String COMMAND_INSPECT = "org.eclipse.jdt.debug.ui.commands.Inspect"; //$NON-NLS-1$
115
	
115
	
116
	/**
116
	/**
117
	 * Whether this plug-in is in debug mode.
118
	 */
119
	public static boolean DEBUG = false;
120
	
121
	/**
117
	 * Java Debug UI plug-in instance
122
	 * Java Debug UI plug-in instance
118
	 */
123
	 */
119
	private static JDIDebugUIPlugin fgPlugin;
124
	private static JDIDebugUIPlugin fgPlugin;
Lines 333-338 Link Here
333
	 */
338
	 */
334
	public void start(BundleContext context) throws Exception {
339
	public void start(BundleContext context) throws Exception {
335
		super.start(context);
340
		super.start(context);
341
		DEBUG = "true".equals(Platform.getDebugOption("org.eclipse.jdt.debug.ui/debug"));  //$NON-NLS-1$//$NON-NLS-2$
336
		JavaDebugOptionsManager.getDefault().startup();
342
		JavaDebugOptionsManager.getDefault().startup();
337
		ResourcesPlugin.getWorkspace().addSaveParticipant(this, new ISaveParticipant() {
343
		ResourcesPlugin.getWorkspace().addSaveParticipant(this, new ISaveParticipant() {
338
			public void doneSaving(ISaveContext context) {}
344
			public void doneSaving(ISaveContext context) {}
(-)ui/org/eclipse/jdt/internal/debug/ui/JavaDebugOptionsManager.java (-1 / +3 lines)
Lines 11-17 Link Here
11
package org.eclipse.jdt.internal.debug.ui;
11
package org.eclipse.jdt.internal.debug.ui;
12
12
13
 
13
 
14
import com.ibm.icu.text.MessageFormat;
15
import java.util.ArrayList;
14
import java.util.ArrayList;
16
import java.util.List;
15
import java.util.List;
17
import java.util.StringTokenizer;
16
import java.util.StringTokenizer;
Lines 58-63 Link Here
58
import org.eclipse.jdt.internal.debug.core.logicalstructures.IJavaStructuresListener;
57
import org.eclipse.jdt.internal.debug.core.logicalstructures.IJavaStructuresListener;
59
import org.eclipse.jdt.internal.debug.core.logicalstructures.JavaLogicalStructures;
58
import org.eclipse.jdt.internal.debug.core.logicalstructures.JavaLogicalStructures;
60
import org.eclipse.jdt.internal.debug.ui.actions.JavaBreakpointPropertiesAction;
59
import org.eclipse.jdt.internal.debug.ui.actions.JavaBreakpointPropertiesAction;
60
import org.eclipse.jdt.internal.debug.ui.evaluation.EvaluationContextManager2;
61
import org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookLauncher;
61
import org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookLauncher;
62
import org.eclipse.jface.preference.IPreferenceStore;
62
import org.eclipse.jface.preference.IPreferenceStore;
63
import org.eclipse.jface.util.IPropertyChangeListener;
63
import org.eclipse.jface.util.IPropertyChangeListener;
Lines 68-73 Link Here
68
import org.eclipse.swt.widgets.Display;
68
import org.eclipse.swt.widgets.Display;
69
import org.eclipse.swt.widgets.Shell;
69
import org.eclipse.swt.widgets.Shell;
70
70
71
import com.ibm.icu.text.MessageFormat;
71
import com.sun.jdi.InvocationException;
72
import com.sun.jdi.InvocationException;
72
import com.sun.jdi.ObjectReference;
73
import com.sun.jdi.ObjectReference;
73
74
Lines 182-187 Link Here
182
		debugPlugin.getLaunchManager().addLaunchListener(this);
183
		debugPlugin.getLaunchManager().addLaunchListener(this);
183
		debugPlugin.getBreakpointManager().addBreakpointListener(this);
184
		debugPlugin.getBreakpointManager().addBreakpointListener(this);
184
		EvaluationContextManager.startup();
185
		EvaluationContextManager.startup();
186
		EvaluationContextManager2.startup();
185
	}
187
	}
186
	
188
	
187
	/**
189
	/**
(-)META-INF/MANIFEST.MF (+1 lines)
Lines 17-22 Link Here
17
 org.eclipse.jdt.internal.debug.ui.console;x-internal:=true,
17
 org.eclipse.jdt.internal.debug.ui.console;x-internal:=true,
18
 org.eclipse.jdt.internal.debug.ui.contentassist;x-internal:=true,
18
 org.eclipse.jdt.internal.debug.ui.contentassist;x-internal:=true,
19
 org.eclipse.jdt.internal.debug.ui.display;x-internal:=true,
19
 org.eclipse.jdt.internal.debug.ui.display;x-internal:=true,
20
 org.eclipse.jdt.internal.debug.ui.evaluation;x-internal:=true,
20
 org.eclipse.jdt.internal.debug.ui.heapwalking;x-internal:=true,
21
 org.eclipse.jdt.internal.debug.ui.heapwalking;x-internal:=true,
21
 org.eclipse.jdt.internal.debug.ui.jres;x-internal:=true,
22
 org.eclipse.jdt.internal.debug.ui.jres;x-internal:=true,
22
 org.eclipse.jdt.internal.debug.ui.launcher;x-internal:=true,
23
 org.eclipse.jdt.internal.debug.ui.launcher;x-internal:=true,
(-).options (+2 lines)
Added Link Here
1
org.eclipse.jdt.debug.ui/debug=false
2
org.eclipse.jdt.debug.ui/debug/evaluation/contextManager=false
(-)ui/org/eclipse/jdt/internal/debug/ui/evaluation/EvaluationContextManager2.java (+232 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 IBM Corporation 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
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.jdt.internal.debug.ui.evaluation;
12
13
import java.util.HashMap;
14
import java.util.Map;
15
16
import org.eclipse.core.runtime.IAdaptable;
17
import org.eclipse.core.runtime.IProgressMonitor;
18
import org.eclipse.core.runtime.IStatus;
19
import org.eclipse.core.runtime.Platform;
20
import org.eclipse.core.runtime.Status;
21
import org.eclipse.core.runtime.jobs.Job;
22
import org.eclipse.debug.ui.DebugUITools;
23
import org.eclipse.debug.ui.contexts.DebugContextEvent;
24
import org.eclipse.debug.ui.contexts.IDebugContextListener;
25
import org.eclipse.debug.ui.contexts.IDebugContextProvider;
26
import org.eclipse.jdt.debug.core.IJavaStackFrame;
27
import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
28
import org.eclipse.jface.viewers.ISelection;
29
import org.eclipse.jface.viewers.IStructuredSelection;
30
import org.eclipse.ui.IWorkbenchPart;
31
import org.eclipse.ui.IWorkbenchPartSite;
32
import org.eclipse.ui.IWorkbenchWindow;
33
import org.eclipse.ui.contexts.IContextActivation;
34
import org.eclipse.ui.contexts.IContextService;
35
import org.eclipse.ui.progress.UIJob;
36
37
/**
38
 * @since 3.3
39
 */
40
public class EvaluationContextManager2 implements IDebugContextListener {
41
	
42
	/**
43
	 * Context that is enabled when there is a valid context for performing
44
	 * an expression evaluation.
45
	 */
46
	private static final String EVALUATION_CONTEXT_ID = "org.eclipse.jdt.debug.ui.evaluation"; //$NON-NLS-1$
47
	
48
	/**
49
	 * Debug flag for tracing information
50
	 */
51
	private static boolean DEBUG_EVALUATION_CONTEXT_MANAGER = false;
52
	
53
	static {
54
		DEBUG_EVALUATION_CONTEXT_MANAGER = JDIDebugUIPlugin.DEBUG && "true".equals( //$NON-NLS-1$
55
		 Platform.getDebugOption("org.eclipse.jdt.debug.ui/debug/evaluation/contextManager")); //$NON-NLS-1$
56
	}
57
58
	class UpdateJobFamily {
59
		public UpdateJobFamily(IWorkbenchWindow window) {
60
			fWindow = window;
61
		}
62
		public IWorkbenchWindow fWindow;
63
	}
64
	
65
	class UpdateContextJob extends Job {
66
67
		private DebugContextEvent fEvent;
68
		private IWorkbenchWindow fWindow;
69
		
70
		/**
71
		 * @param name
72
		 */
73
		public UpdateContextJob(DebugContextEvent event, IWorkbenchWindow window) {
74
			super("Update expression evaluation context"); //$NON-NLS-1$
75
			fEvent = event;
76
			fWindow = window;
77
			setSystem(true);
78
		}
79
		
80
		/* (non-Javadoc)
81
		 * @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object)
82
		 */
83
		public boolean belongsTo(Object family) {
84
			if (family instanceof UpdateJobFamily) {
85
				UpdateJobFamily ujf = (UpdateJobFamily) family;
86
				return ujf.fWindow.equals(fWindow);
87
			}
88
			return false;
89
		}
90
91
		/* (non-Javadoc)
92
		 * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
93
		 */
94
		protected IStatus run(IProgressMonitor monitor) {
95
			if (DEBUG_EVALUATION_CONTEXT_MANAGER) {
96
				System.out.println("[Evaluation] Updating enablement"); //$NON-NLS-1$
97
			}
98
			boolean activate = false;
99
			if (!monitor.isCanceled()) {
100
				ISelection context = fEvent.getContext();
101
				if (context instanceof IStructuredSelection) {
102
					IStructuredSelection ss = (IStructuredSelection) context;
103
					Object firstElement = ss.getFirstElement();
104
					if (firstElement instanceof IAdaptable) {
105
						IAdaptable adaptable = (IAdaptable) firstElement;
106
						Object adapter = adaptable.getAdapter(IJavaStackFrame.class);
107
						if (adapter != null) {
108
							// TODO: scrap book
109
							activate = true;
110
						}
111
					}
112
				}
113
			}
114
			IContextService service = (IContextService) fWindow.getService(IContextService.class);
115
			if (service != null) {
116
				if (activate) {
117
					if (!service.getActiveContextIds().contains(EVALUATION_CONTEXT_ID)) {
118
						if (DEBUG_EVALUATION_CONTEXT_MANAGER) {
119
							System.out.println("[Evaluation]\tSchedule activation"); //$NON-NLS-1$
120
						}
121
						Job job = new PerformActivation(service);
122
						job.schedule();
123
					} else {
124
						if (DEBUG_EVALUATION_CONTEXT_MANAGER) {
125
							System.out.println("[Evaluation]\tStill enabled"); //$NON-NLS-1$
126
						}
127
					}
128
				} else {
129
					IContextActivation activation = (IContextActivation) fActivations.remove(service);
130
					if (activation != null) {
131
						if (DEBUG_EVALUATION_CONTEXT_MANAGER) {
132
							System.out.println("[Evaluation]\tSchedule deactivation"); //$NON-NLS-1$
133
						}
134
						Job job = new PerformDeactivation(activation);
135
						job.schedule();
136
					} else {
137
						if (DEBUG_EVALUATION_CONTEXT_MANAGER) {
138
							System.out.println("[Evaluation]\tStill deactivated"); //$NON-NLS-1$
139
						}
140
					}
141
				}
142
			}
143
			return Status.OK_STATUS;
144
		}
145
		
146
	}
147
	
148
	/**
149
	 * Map of context activations per service
150
	 */
151
	private Map fActivations = new HashMap();
152
	
153
	class PerformActivation extends UIJob {
154
155
		private IContextService fService;
156
		
157
		/**
158
		 * @param name
159
		 */
160
		public PerformActivation(IContextService service) {
161
			super("Activate evaluation context"); //$NON-NLS-1$
162
			fService = service;
163
			setSystem(true);
164
		}
165
166
		/* (non-Javadoc)
167
		 * @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor)
168
		 */
169
		public IStatus runInUIThread(IProgressMonitor monitor) {
170
			if (DEBUG_EVALUATION_CONTEXT_MANAGER) {
171
				System.out.println("[Evaluation] Activate " + EVALUATION_CONTEXT_ID); //$NON-NLS-1$
172
			}
173
			IContextActivation activation = fService.activateContext(EVALUATION_CONTEXT_ID);
174
			fActivations.put(fService, activation);
175
			return Status.OK_STATUS;
176
		}
177
		
178
	}
179
	
180
	class PerformDeactivation extends UIJob {
181
182
		private IContextActivation fActivation;
183
		
184
		/**
185
		 * @param name
186
		 */
187
		public PerformDeactivation(IContextActivation activation) {
188
			super("Deactivate evaluation context"); //$NON-NLS-1$
189
			fActivation = activation;
190
			setSystem(true);
191
		}
192
193
		/* (non-Javadoc)
194
		 * @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor)
195
		 */
196
		public IStatus runInUIThread(IProgressMonitor monitor) {
197
			if (DEBUG_EVALUATION_CONTEXT_MANAGER) {
198
				System.out.println("Evaluation] Deactivate " + EVALUATION_CONTEXT_ID); //$NON-NLS-1$
199
			}
200
			fActivation.getContextService().deactivateContext(fActivation);
201
			return Status.OK_STATUS;
202
		}
203
		
204
	}	
205
	
206
	/* (non-Javadoc)
207
	 * @see org.eclipse.debug.ui.contexts.IDebugContextListener#debugContextChanged(org.eclipse.debug.ui.contexts.DebugContextEvent)
208
	 */
209
	public void debugContextChanged(DebugContextEvent event) {
210
		if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
211
			IDebugContextProvider provider = (IDebugContextProvider) event.getSource();
212
			IWorkbenchPart part = provider.getPart();
213
			if (part != null) {
214
				IWorkbenchPartSite site = part.getSite();
215
				if (site != null) {
216
					IWorkbenchWindow window = site.getWorkbenchWindow();
217
					if (window != null) {
218
						Job.getJobManager().cancel(new UpdateJobFamily(window));
219
						Job job = new UpdateContextJob(event, window);
220
						job.schedule(100);
221
					}
222
				}
223
			}
224
		}
225
	}
226
	
227
	public static void startup() {
228
		EvaluationContextManager2 manager = new EvaluationContextManager2();
229
		DebugUITools.getDebugContextManager().addDebugContextListener(manager);
230
	}
231
232
}
(-)ui/org/eclipse/jdt/internal/debug/ui/evaluation/ForceReturnHandler.java (+43 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 IBM Corporation 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
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.jdt.internal.debug.ui.evaluation;
12
13
import org.eclipse.core.commands.AbstractHandler;
14
import org.eclipse.core.commands.ExecutionEvent;
15
import org.eclipse.core.commands.ExecutionException;
16
import org.eclipse.ui.PlatformUI;
17
18
/**
19
 * @since 3.3
20
 */
21
public class ForceReturnHandler extends AbstractHandler {
22
23
	public ForceReturnHandler() {
24
		System.out.println("CREATED");
25
		System.out.println(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
26
	}
27
	
28
	/* (non-Javadoc)
29
	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
30
	 */
31
	public Object execute(ExecutionEvent arg0) throws ExecutionException {
32
		// TODO Auto-generated method stub
33
		return null;
34
	}
35
36
	public void dispose() {
37
		System.out.println("DISPOSED");
38
		super.dispose();
39
	}
40
	
41
	
42
43
}
(-)ui/org/eclipse/jdt/internal/debug/ui/evaluation/EvaluationPropertyTester.java (+40 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 IBM Corporation 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
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.jdt.internal.debug.ui.evaluation;
12
13
import java.util.Collection;
14
15
import org.eclipse.core.expressions.PropertyTester;
16
17
/**
18
 * @since 3.3
19
 */
20
public class EvaluationPropertyTester extends PropertyTester {
21
	
22
	/**
23
	 * Tests for containment in a collection
24
	 */
25
	public static final String PROP_CONTAINS = "contains"; //$NON-NLS-1$
26
27
	public EvaluationPropertyTester() {
28
	}
29
30
	public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
31
		if (PROP_CONTAINS.equals(property)) {
32
			if (receiver instanceof Collection) {
33
				Collection collection = (Collection) receiver;
34
				return collection.contains(expectedValue);
35
			}
36
		}
37
		return false;
38
	}
39
40
}
(-)plugin.xml (-64 / +71 lines)
Lines 170-189 Link Here
170
            label="%BreakpointActionSet.label"
170
            label="%BreakpointActionSet.label"
171
            visible="false"
171
            visible="false"
172
            id="org.eclipse.debug.ui.breakpointActionSet">
172
            id="org.eclipse.debug.ui.breakpointActionSet">
173
         <menu
174
               label="%RunMenu.label"
175
               path="additions"
176
               id="org.eclipse.ui.run">
177
            <separator
178
                  name="breakpointGroup">
179
            </separator>
180
            <groupMarker
181
                  name="lineBreakpointGroup">
182
            </groupMarker>
183
            <groupMarker
184
                  name="emptyBreakpointGroup">
185
            </groupMarker>
186
         </menu>
187
         <action
173
         <action
188
               disabledIcon="$nl$/icons/full/dlcl16/rem_all_co.gif"
174
               disabledIcon="$nl$/icons/full/dlcl16/rem_all_co.gif"
189
               label="%RemoveAllBreakpointsAction.label"
175
               label="%RemoveAllBreakpointsAction.label"
Lines 248-273 Link Here
248
            label="%DebugActionSet.label"
234
            label="%DebugActionSet.label"
249
            visible="false"
235
            visible="false"
250
            id="org.eclipse.debug.ui.debugActionSet">
236
            id="org.eclipse.debug.ui.debugActionSet">
251
         <menu
252
               label="%RunMenu.label"
253
               path="additions"
254
               id="org.eclipse.ui.run">
255
            <separator
256
                  name="stepGroup">
257
            </separator>
258
            <groupMarker
259
                  name="stepIntoGroup">
260
            </groupMarker>
261
            <groupMarker
262
                  name="stepOverGroup">
263
            </groupMarker>
264
            <groupMarker
265
                  name="stepReturnGroup">
266
            </groupMarker>
267
            <groupMarker
268
                  name="emptyStepGroup">
269
            </groupMarker>
270
         </menu>
271
         <action
237
         <action
272
               id="org.eclipse.debug.ui.actions.ToggleStepFilters"
238
               id="org.eclipse.debug.ui.actions.ToggleStepFilters"
273
               hoverIcon="$nl$/icons/full/elcl16/stepbystep_co.gif"
239
               hoverIcon="$nl$/icons/full/elcl16/stepbystep_co.gif"
Lines 362-384 Link Here
362
            label="%LaunchActionSet.label"
328
            label="%LaunchActionSet.label"
363
            visible="false"
329
            visible="false"
364
            id="org.eclipse.debug.ui.launchActionSet">
330
            id="org.eclipse.debug.ui.launchActionSet">
365
         <menu
366
               label="%RunMenu.label"
367
               path="additions"
368
               id="org.eclipse.ui.run">
369
            <separator
370
                  name="relaunchGroup">
371
            </separator>
372
            <separator
373
                  name="runGroup">
374
            </separator>
375
            <separator
376
                  name="debugGroup">
377
            </separator>
378
            <separator
379
                  name="emptyLaunchGroup">
380
            </separator>
381
         </menu>
382
         <action
331
         <action
383
               class="org.eclipse.debug.internal.ui.actions.OpenRunConfigurations"
332
               class="org.eclipse.debug.internal.ui.actions.OpenRunConfigurations"
384
               definitionId="org.eclipse.debug.ui.commands.OpenRunConfigurations"
333
               definitionId="org.eclipse.debug.ui.commands.OpenRunConfigurations"
Lines 482-498 Link Here
482
            label="%ProfileActionSet.label"
431
            label="%ProfileActionSet.label"
483
            visible="false"
432
            visible="false"
484
            id="org.eclipse.debug.ui.profileActionSet">
433
            id="org.eclipse.debug.ui.profileActionSet">
485
         <menu
486
               label="%RunMenu.label"
487
               path="additions"
488
               id="org.eclipse.ui.run">
489
            <separator
490
                  name="relaunchGroup">
491
            </separator>
492
            <separator
493
                  name="profileGroup">
494
            </separator>
495
         </menu>
496
         <action
434
         <action
497
               id="org.eclipse.debug.internal.ui.actions.ProfileDropDownAction"
435
               id="org.eclipse.debug.internal.ui.actions.ProfileDropDownAction"
498
               toolbarPath="org.eclipse.debug.ui.launchActionSet/debug"
436
               toolbarPath="org.eclipse.debug.ui.launchActionSet/debug"
Lines 1501-1510 Link Here
1501
            id="org.eclipse.debug.ui.commands.OpenDebugConfigurations">
1439
            id="org.eclipse.debug.ui.commands.OpenDebugConfigurations">
1502
      </command>
1440
      </command>
1503
      <command
1441
      <command
1504
            name="%ActionDefinition.debugLast.name"
1505
            categoryId="org.eclipse.debug.ui.category.run"
1442
            categoryId="org.eclipse.debug.ui.category.run"
1506
            description="%ActionDefinition.debugLast.description"
1443
            description="%ActionDefinition.debugLast.description"
1507
            id="org.eclipse.debug.ui.commands.DebugLast">
1444
            helpContextId="debug_last_action_context"
1445
            id="org.eclipse.debug.ui.commands.DebugLast"
1446
            name="%ActionDefinition.debugLast.name">
1508
      </command>
1447
      </command>
1509
      <command
1448
      <command
1510
            name="%ActionDefinition.runLast.name"
1449
            name="%ActionDefinition.runLast.name"
Lines 2286-2291 Link Here
2286
       </wizard>
2225
       </wizard>
2287
    </extension>
2226
    </extension>
2288
    <extension
2227
    <extension
2228
          point="org.eclipse.ui.menus">
2229
       <menuContribution
2230
             locationURI="menu:org.eclipse.ui.main.menu">
2231
          <menu
2232
                id="org.eclipse.ui.run"
2233
                label="%RunMenu.label"
2234
                mnemonic="R"
2235
                tooltip="The main run menu">
2236
             <separator
2237
                   name="stepGroup"
2238
                   visible="true">
2239
             </separator>
2240
             <separator
2241
                   name="stepIntoGroup"
2242
                   visible="false">
2243
             </separator>
2244
             <separator
2245
                   name="stepOverGroup"
2246
                   visible="false">
2247
             </separator>
2248
             <separator
2249
                   name="stepReturnGroup"
2250
                   visible="false">
2251
             </separator>
2252
             <separator
2253
                   name="emptyStepGroup"
2254
                   visible="true">
2255
             </separator>
2256
             <separator
2257
                   name="relaunchGroup"
2258
                   visible="true">
2259
             </separator>
2260
             <separator
2261
                   name="debugGroup"
2262
                   visible="true">
2263
             </separator>
2264
             <separator
2265
                   name="runGroup"
2266
                   visible="true">
2267
             </separator>
2268
             <separator
2269
                   name="profileGroup"
2270
                   visible="true">
2271
             </separator>
2272
             <separator
2273
                   name="emptyLaunchGroup"
2274
                   visible="true">
2275
             </separator>
2276
             <separator
2277
                   name="breakpointGroup"
2278
                   visible="true">
2279
             </separator>
2280
             <separator
2281
                   name="lineBreakpointGroup"
2282
                   visible="true">
2283
             </separator>
2284
             <separator
2285
                   name="emptyBreakpointGroup"
2286
                   visible="true">
2287
             </separator>
2288
             <separator
2289
                   name="additions">
2290
             </separator>
2291
             
2292
          </menu>
2293
       </menuContribution>
2294
    </extension>
2295
    <extension
2289
          point="org.eclipse.ui.exportWizards">
2296
          point="org.eclipse.ui.exportWizards">
2290
       <wizard
2297
       <wizard
2291
             category="org.eclipse.ui.Basic"
2298
             category="org.eclipse.ui.Basic"

Return to bug 150652