|
Lines 41-52
Link Here
|
| 41 |
import org.eclipse.dd.dsf.ui.viewmodel.dm.AbstractDMVMProvider; |
41 |
import org.eclipse.dd.dsf.ui.viewmodel.dm.AbstractDMVMProvider; |
| 42 |
import org.eclipse.dd.dsf.ui.viewmodel.dm.CompositeDMVMContext; |
42 |
import org.eclipse.dd.dsf.ui.viewmodel.dm.CompositeDMVMContext; |
| 43 |
import org.eclipse.dd.dsf.ui.viewmodel.dm.IDMVMContext; |
43 |
import org.eclipse.dd.dsf.ui.viewmodel.dm.IDMVMContext; |
| 44 |
import org.eclipse.debug.core.DebugException; |
|
|
| 45 |
import org.eclipse.debug.core.ILaunch; |
| 46 |
import org.eclipse.debug.core.model.IDebugTarget; |
| 47 |
import org.eclipse.debug.core.model.IExpression; |
44 |
import org.eclipse.debug.core.model.IExpression; |
| 48 |
import org.eclipse.debug.core.model.IValue; |
|
|
| 49 |
import org.eclipse.debug.core.model.IVariable; |
| 50 |
import org.eclipse.debug.internal.ui.DebugPluginImages; |
45 |
import org.eclipse.debug.internal.ui.DebugPluginImages; |
| 51 |
import org.eclipse.debug.internal.ui.DebugUIPlugin; |
46 |
import org.eclipse.debug.internal.ui.DebugUIPlugin; |
| 52 |
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants; |
47 |
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants; |
|
Lines 57-63
Link Here
|
| 57 |
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta; |
52 |
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta; |
| 58 |
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; |
53 |
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; |
| 59 |
import org.eclipse.debug.ui.IDebugUIConstants; |
54 |
import org.eclipse.debug.ui.IDebugUIConstants; |
| 60 |
import org.eclipse.debug.ui.actions.IWatchExpressionFactoryAdapterExtension; |
55 |
import org.eclipse.debug.ui.actions.IWatchExpressionFactoryAdapter2; |
| 61 |
import org.eclipse.jface.util.PropertyChangeEvent; |
56 |
import org.eclipse.jface.util.PropertyChangeEvent; |
| 62 |
import org.eclipse.jface.viewers.CellEditor; |
57 |
import org.eclipse.jface.viewers.CellEditor; |
| 63 |
import org.eclipse.jface.viewers.ICellModifier; |
58 |
import org.eclipse.jface.viewers.ICellModifier; |
|
Lines 70-76
Link Here
|
| 70 |
implements IElementEditor, IElementLabelProvider |
65 |
implements IElementEditor, IElementLabelProvider |
| 71 |
{ |
66 |
{ |
| 72 |
protected class RegisterVMC extends DMVMContext |
67 |
protected class RegisterVMC extends DMVMContext |
| 73 |
implements IVariable, IFormattedValueVMContext |
68 |
implements IFormattedValueVMContext |
| 74 |
{ |
69 |
{ |
| 75 |
private IExpression fExpression; |
70 |
private IExpression fExpression; |
| 76 |
public RegisterVMC(IDMContext dmc) { |
71 |
public RegisterVMC(IDMContext dmc) { |
|
Lines 86-92
Link Here
|
| 86 |
public Object getAdapter(Class adapter) { |
81 |
public Object getAdapter(Class adapter) { |
| 87 |
if (fExpression != null && adapter.isAssignableFrom(fExpression.getClass())) { |
82 |
if (fExpression != null && adapter.isAssignableFrom(fExpression.getClass())) { |
| 88 |
return fExpression; |
83 |
return fExpression; |
| 89 |
} else if (adapter.isAssignableFrom(IWatchExpressionFactoryAdapterExtension.class)) { |
84 |
} else if (adapter.isAssignableFrom(IWatchExpressionFactoryAdapter2.class)) { |
| 90 |
return fRegisterExpressionFactory; |
85 |
return fRegisterExpressionFactory; |
| 91 |
} else { |
86 |
} else { |
| 92 |
return super.getAdapter(adapter); |
87 |
return super.getAdapter(adapter); |
|
Lines 111-139
Link Here
|
| 111 |
public IFormattedValuePreferenceStore getPreferenceStore() { |
106 |
public IFormattedValuePreferenceStore getPreferenceStore() { |
| 112 |
return fFormattedPrefStore; |
107 |
return fFormattedPrefStore; |
| 113 |
} |
108 |
} |
| 114 |
|
|
|
| 115 |
public String getName() throws DebugException { return toString(); } |
| 116 |
public String getReferenceTypeName() throws DebugException { return ""; } //$NON-NLS-1$ |
| 117 |
public IValue getValue() throws DebugException { return null; } |
| 118 |
public boolean hasValueChanged() throws DebugException { return false; } |
| 119 |
public void setValue(IValue value) throws DebugException {} |
| 120 |
public void setValue(String expression) throws DebugException {} |
| 121 |
public boolean supportsValueModification() { return false; } |
| 122 |
public boolean verifyValue(IValue value) throws DebugException { return false; } |
| 123 |
public boolean verifyValue(String expression) throws DebugException { return false; } |
| 124 |
public IDebugTarget getDebugTarget() { return null;} |
| 125 |
public ILaunch getLaunch() { return null; } |
| 126 |
public String getModelIdentifier() { return DsfDebugUIPlugin.PLUGIN_ID; } |
| 127 |
} |
109 |
} |
| 128 |
|
110 |
|
| 129 |
protected class RegisterExpressionFactory implements IWatchExpressionFactoryAdapterExtension { |
111 |
protected class RegisterExpressionFactory implements IWatchExpressionFactoryAdapter2 { |
| 130 |
|
112 |
|
| 131 |
public boolean canCreateWatchExpression(IVariable variable) { |
113 |
public boolean canCreateWatchExpression(Object element) { |
| 132 |
return variable instanceof RegisterVMC; |
114 |
return element instanceof RegisterVMC; |
| 133 |
} |
115 |
} |
| 134 |
|
116 |
|
| 135 |
public String createWatchExpression(IVariable variable) throws CoreException { |
117 |
public String createWatchExpression(Object element) throws CoreException { |
| 136 |
RegisterVMC registerVmc = ((RegisterVMC)variable); |
118 |
RegisterVMC registerVmc = ((RegisterVMC)element); |
| 137 |
|
119 |
|
| 138 |
StringBuffer exprBuf = new StringBuffer(); |
120 |
StringBuffer exprBuf = new StringBuffer(); |
| 139 |
IRegisterGroupDMContext groupDmc = |
121 |
IRegisterGroupDMContext groupDmc = |