Skip to content
Snippets Groups Projects
Commit 558f5388 authored by Xiuna Zhu's avatar Xiuna Zhu
Browse files

add a function "createFormEntryAndReturnLable" in the PropertySectionBase

refs 1613
parent cdf9e01e
No related branches found
No related tags found
No related merge requests found
......@@ -60,7 +60,7 @@ import org.fortiss.tooling.kernel.service.ILibraryService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 571F82FBEE5722F8709F96217548643C
* @ConQAT.Rating YELLOW Hash: 1E9B0FA0654151C10D99A9134D11D22C
*/
public abstract class PropertySectionBase extends AbstractPropertySection {
......@@ -243,6 +243,23 @@ public abstract class PropertySectionBase extends AbstractPropertySection {
control.setLayoutData(gd);
}
/** Creates a form entry and return the label */
protected Label createFormEntryAndReturnLable(Control control, String labelName) {
labelName = labelName.trim();
if(labelName.endsWith(":")) {
labelName = labelName.replaceAll(":$", "");
}
Label label = getWidgetFactory().createLabel(composite, labelName);
label.moveAbove(control);
GridDataFactory.defaultsFor(label).hint(PROPERTIES_LABEL_WIDTH, SWT.DEFAULT)
.align(SWT.BEGINNING, SWT.BEGINNING).applyTo(label);
GridData gd = GridDataFactory.defaultsFor(control).create();
gd.heightHint = Math.min(50, gd.heightHint);
control.setLayoutData(gd);
return label;
}
/**
* {@inheritDoc}
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment