1 11 package org.eclipse.pde.internal.ui.util; 12 13 import org.eclipse.jface.viewers.CellEditor; 14 import org.eclipse.jface.viewers.ComboBoxCellEditor; 15 import org.eclipse.swt.SWT; 16 import org.eclipse.swt.widgets.Composite; 17 import org.eclipse.ui.views.properties.PropertyDescriptor; 18 19 public class ChoicePropertyDescriptor extends PropertyDescriptor { 20 21 24 private String [] values; 25 33 public ChoicePropertyDescriptor(Object id, String displayName, String [] valuesArray) { 34 super(id, displayName); 35 values = valuesArray; 36 } 37 45 public CellEditor createPropertyEditor(Composite parent) { 46 CellEditor editor = new ComboBoxCellEditor(parent, values, SWT.READ_ONLY); 47 if (getValidator() != null) 48 editor.setValidator(getValidator()); 49 return editor; 50 } 51 } 52 | Popular Tags |