public Composite createConfigSection(TreeItem treeItemParent,
String sNameID,
int position,
boolean bPrefix) {
ScrolledComposite sc = new ScrolledComposite(cConfigSection, SWT.H_SCROLL | SWT.V_SCROLL);
sc.setExpandHorizontal(true);
sc.setExpandVertical(true);
sc.setLayoutData(new GridData(GridData.FILL_BOTH));
sc.getVerticalBar().setIncrement(16);
sc.addListener(SWT.Resize, scResizeListener);
Composite cConfigSection = new Composite(sc, SWT.NULL);
String section_key = ((bPrefix) ? sSectionPrefix : "") + sNameID;
if (position == -2) { // Means "auto-order".
position = findInsertPointFor(MessageText.getString(section_key), (treeItemParent == null) ? (Object)tree : (Object)treeItemParent);
}
TreeItem treeItem;
if (treeItemParent == null) {
if (position >= 0)
treeItem = new TreeItem(tree, SWT.NULL, position);
else
treeItem = new TreeItem(tree, SWT.NULL);
} else {
if (position >= 0)
treeItem = new TreeItem(treeItemParent, SWT.NULL, position);
else
treeItem = new TreeItem(treeItemParent, SWT.NULL);
}
Messages.setLanguageText(treeItem, section_key);
treeItem.setData("Panel", sc);
treeItem.setData("ID", sNameID);
sc.setContent(cConfigSection);
return cConfigSection;
}