1 11 package org.eclipse.jdt.internal.debug.ui.variables; 12 13 import org.eclipse.debug.internal.ui.elements.adapters.VariableColumnEditor; 14 import org.eclipse.debug.internal.ui.elements.adapters.VariableColumnPresentation; 15 import org.eclipse.jdt.debug.core.IJavaVariable; 16 import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin; 17 import org.eclipse.jface.viewers.CellEditor; 18 import org.eclipse.jface.viewers.ComboBoxCellEditor; 19 import org.eclipse.jface.viewers.ICellModifier; 20 import org.eclipse.swt.widgets.Composite; 21 22 28 public class JavaVariableColumnEditor extends VariableColumnEditor { 29 30 public static final String JAVA_VARIABLE_COLUMN_EDITOR = JDIDebugUIPlugin.getUniqueIdentifier() + ".JAVA_VARIABLE_COLUMN_EDITOR"; 32 private ICellModifier fModifier; 33 34 37 public ICellModifier getCellModifier() { 38 if (fModifier == null) { 39 fModifier = new JavaVariableCellModifier(getPresentationContext()); 40 } 41 return fModifier; 42 } 43 44 47 public String getId() { 48 return JAVA_VARIABLE_COLUMN_EDITOR; 49 } 50 51 54 public CellEditor getCellEditor(String id, Object element, Composite parent) { 55 if (VariableColumnPresentation.COLUMN_VARIABLE_VALUE.equals(id)) { 56 if (element instanceof IJavaVariable) { 57 IJavaVariable var = (IJavaVariable) element; 58 if (JavaVariableCellModifier.isBoolean(var)) { 59 return new ComboBoxCellEditor(parent, new String []{Boolean.toString(true), Boolean.toString(false)}); 60 } 61 } 62 } 63 return super.getCellEditor(id, element, parent); 64 } 65 66 67 68 } 69 | Popular Tags |