|
Added
Link Here
|
| 1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2008 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.examples.ui.pda.breakpoints; |
| 12 |
|
| 13 |
import java.util.Collections; |
| 14 |
import java.util.Map; |
| 15 |
import java.util.Set; |
| 16 |
import java.util.TreeMap; |
| 17 |
import java.util.TreeSet; |
| 18 |
|
| 19 |
import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget; |
| 20 |
import org.eclipse.debug.ui.actions.IToggleBreakpointsTargetFactory; |
| 21 |
import org.eclipse.jface.viewers.ISelection; |
| 22 |
import org.eclipse.ui.IWorkbenchPart; |
| 23 |
|
| 24 |
public class BadPDAToggleFactory implements IToggleBreakpointsTargetFactory { |
| 25 |
|
| 26 |
private static final String TOGGLE_BAD = "org.eclipse.debug.examples.ui.pda.bad"; |
| 27 |
|
| 28 |
private static Set TOGGLE_BAD_TARGETS = new TreeSet(); |
| 29 |
|
| 30 |
private Map fToggleWatchpointTargets = new TreeMap(); |
| 31 |
|
| 32 |
static { |
| 33 |
TOGGLE_BAD_TARGETS.add(TOGGLE_BAD); |
| 34 |
} |
| 35 |
|
| 36 |
public IToggleBreakpointsTarget createToggleTarget(String targetID) { |
| 37 |
return null; |
| 38 |
} |
| 39 |
|
| 40 |
public String getDefaultToggleTarget(IWorkbenchPart part, ISelection selection) { |
| 41 |
return TOGGLE_BAD; |
| 42 |
} |
| 43 |
|
| 44 |
public Set getToggleTargets(IWorkbenchPart part, ISelection selection) { |
| 45 |
return Collections.EMPTY_SET; |
| 46 |
} |
| 47 |
|
| 48 |
public String getToggleTargetName(String targetID) { |
| 49 |
if (TOGGLE_BAD.equals(targetID)) { |
| 50 |
return "Bad Toggle Target"; |
| 51 |
} else { |
| 52 |
return null; |
| 53 |
} |
| 54 |
} |
| 55 |
|
| 56 |
public String getToggleTargetDescription(String targetID) { |
| 57 |
return getToggleTargetName(targetID); |
| 58 |
} |
| 59 |
} |