protected Text addTextField(Composite parent, String label, Key key, int indent, int widthHint) { Label labelControl= new Label(parent, SWT.WRAP); labelControl.setText(label); labelControl.setFont(JFaceResources.getDialogFont()); GridData gd= new GridData(); gd.horizontalIndent= indent; labelControl.setLayoutData(gd); Text textBox= new Text(parent, SWT.BORDER | SWT.SINGLE); textBox.setData(key); makeScrollableCompositeAware(textBox); fLabels.put(textBox, labelControl); updateText(textBox); textBox.addModifyListener(getTextModifyListener()); GridData data= new GridData(GridData.HORIZONTAL_ALIGN_FILL); if (widthHint != 0) { data.widthHint= widthHint; } data.horizontalSpan= 2; textBox.setLayoutData(data); fTextBoxes.add(textBox); return textBox; }
protected Text addTextField(Composite parent, String label, Key key, int indent, int widthHint) { Label labelControl= new Label(parent, SWT.WRAP); labelControl.setText(label); labelControl.setFont(JFaceResources.getDialogFont()); labelControl.setLayoutData(new GridData()); Text textBox= new Text(parent, SWT.BORDER | SWT.SINGLE); textBox.setData(key); textBox.setLayoutData(new GridData()); makeScrollableCompositeAware(textBox); fLabels.put(textBox, labelControl); String currValue= getValue(key); if (currValue != null) { textBox.setText(currValue); } textBox.addModifyListener(getTextModifyListener()); GridData data= new GridData(GridData.HORIZONTAL_ALIGN_FILL); if (widthHint != 0) { data.widthHint= widthHint; } data.horizontalIndent= indent; data.horizontalSpan= 2; textBox.setLayoutData(data); fTextBoxes.add(textBox); return textBox; }
protected Text addTextField(Composite parent, String label, Key key, int indent, int widthHint) { Label labelControl= new Label(parent, SWT.WRAP); labelControl.setText(label); labelControl.setFont(JFaceResources.getDialogFont()); GridData gd= new GridData(); gd.horizontalIndent= indent; labelControl.setLayoutData(gd); Text textBox= new Text(parent, SWT.BORDER | SWT.SINGLE); textBox.setData(key); makeScrollableCompositeAware(textBox); fLabels.put(textBox, labelControl); updateText(textBox); textBox.addModifyListener(getTextModifyListener()); GridData data= new GridData(GridData.HORIZONTAL_ALIGN_FILL); if (widthHint != 0) { data.widthHint= widthHint; } data.horizontalSpan= 2; textBox.setLayoutData(data); fTextBoxes.add(textBox); return textBox; }