1 11 package org.eclipse.pde.ui.templates; 12 13 import org.eclipse.swt.layout.GridData; 14 import org.eclipse.swt.widgets.Composite; 15 import org.eclipse.swt.widgets.Label; 16 17 23 public class BlankField extends TemplateOption { 24 25 private final static int DEFAULT_HEIGHT = 20; 26 private final static String OPTION_NAME = "blankField"; private static int NUM_CREATED = 0; 28 29 private static String getUniqueName() { 30 return OPTION_NAME + Integer.toString(NUM_CREATED++); 31 } 32 33 private Label fblankLabel; 34 private int fheight; 35 36 42 public BlankField(BaseOptionTemplateSection section) { 43 super(section, getUniqueName(), ""); fheight = DEFAULT_HEIGHT; 45 } 46 47 55 public BlankField(BaseOptionTemplateSection section, int height) { 56 super(section, getUniqueName(), ""); fheight = height; 58 } 59 60 68 public void createControl(Composite parent, int span) { 69 fblankLabel = createLabel(parent,span); 70 GridData gd = new GridData(GridData.FILL_HORIZONTAL); 71 gd.heightHint = fheight; 72 gd.horizontalSpan = span; 73 fblankLabel.setLayoutData(gd); 74 } 75 76 } 77 | Popular Tags |