1 11 package org.eclipse.jdt.internal.debug.ui.variables; 12 13 import org.eclipse.debug.internal.ui.model.elements.VariableEditor; 14 import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; 15 import org.eclipse.jdt.debug.core.IJavaVariable; 16 import org.eclipse.jface.viewers.CellEditor; 17 import org.eclipse.jface.viewers.ComboBoxCellEditor; 18 import org.eclipse.jface.viewers.ICellModifier; 19 import org.eclipse.swt.SWT; 20 import org.eclipse.swt.widgets.Composite; 21 22 28 public class JavaVariableEditor extends VariableEditor { 29 30 33 public ICellModifier getCellModifier(IPresentationContext context, Object element) { 34 return new JavaVariableCellModifier(); 35 } 36 37 40 public CellEditor getCellEditor(IPresentationContext context, String columnId, Object element, Composite parent) { 41 if (element instanceof IJavaVariable) { 42 IJavaVariable var = (IJavaVariable) element; 43 if (JavaVariableCellModifier.isBoolean(var)) { 44 return new ComboBoxCellEditor(parent, new String []{Boolean.toString(true), Boolean.toString(false)}, SWT.READ_ONLY); 45 } 46 } 47 return super.getCellEditor(context, columnId, element, parent); 48 } 49 50 } 51 | Popular Tags |