GridData tabFolderLayout = new GridData(GridData.FILL_BOTH);
tabFolderLayout.horizontalSpan = 1;
_headerTabFolder.setLayoutData(tabFolderLayout);
for (String current : _headerFileMap.keySet()) {
String titel = _headerFileMap.get(current).getTitle();
TabItem tabItem = new TabItem(_headerTabFolder, SWT.FILL);
Composite tabItemContainer = new Composite(_headerTabFolder, SWT.NONE);
layout = new GridLayout();
layout.numColumns = 1;
layout.marginWidth = 0;
layout.marginHeight = 0;
layout.horizontalSpacing = 0;
layout.verticalSpacing = 0;
tabItemContainer.setLayout(layout);
tabItem.setText(titel);
Text headerTabText = new Text(tabItemContainer, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
headerTabText.setData(current);
if (Plugin.getDefault().getProjectPreferences(_selectedProject).getBoolean("useSpecificHeader", false)) {
headerTabText.setText(_headerFileMap.get(current).getSpecificHeader(_selectedProject));
headerTabText.setEnabled(true);
_importButton.setEnabled(true);
_exportButton.setEnabled(true);
}
else {
headerTabText.setText(_headerFileMap.get(current).getDefaultHeader());
headerTabText.setEnabled(false);
_importButton.setEnabled(false);
_exportButton.setEnabled(false);
}
headerTabText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
if (e.getSource() instanceof Text) {
Text source = (Text) e.getSource();
if (_specificHeaderCheckbox.getSelection()) {
_headerFileMap.get((String) source.getData()).setSpecificHeader(_selectedProject, source.getText());
}
}
}
});
GridData codeLayout = new GridData(GridData.FILL_BOTH);
codeLayout.minimumHeight = WidgetFactory.computeFontHeight(headerTabText) * 20;
headerTabText.setLayoutData(codeLayout);
_headerTabTextMap.put(current, headerTabText);
tabItem.setControl(tabItemContainer);
}