1 11 package org.eclipse.pde.internal.ui.editor.plugin.rows; 12 import org.eclipse.pde.internal.core.ischema.ISchemaAttribute; 13 import org.eclipse.pde.internal.ui.editor.IContextPart; 14 import org.eclipse.swt.widgets.Composite; 15 import org.eclipse.ui.forms.widgets.FormToolkit; 16 17 public class BooleanAttributeRow extends ChoiceAttributeRow { 18 21 public BooleanAttributeRow(IContextPart part, ISchemaAttribute att) { 22 super(part, att); 23 } 24 30 public void createContents(Composite parent, FormToolkit toolkit, int span) { 31 super.createContents(parent, toolkit, span); 32 if (getUse()!=ISchemaAttribute.REQUIRED) 33 combo.add(""); combo.add("true"); combo.add("false"); } 37 38 41 protected boolean isValid(String value) { 42 if (getUse() == ISchemaAttribute.REQUIRED) 43 return (value.equals("true") || value.equals("false")); return (value.equals("true") || value.equals("false") || value.equals("")); } 46 47 50 protected String getValidValue() { 51 return "true"; } 53 } 54 | Popular Tags |