in CasViewerEclipsePlugin/uimaj-ep-casviewer/src/main/java/org/apache/uima/uct/viewer/internal/page/CASViewControl.java [509:588]
private void createTabFolderForTypesAndIndexes(
final IManagedForm managedForm, Composite sashForm) {
final Composite compTop = FormSection.createGridLayoutContainer(
toolkit, sashForm, 1, 2, 2);
// ((GridLayout) compTop.getLayout()).makeColumnsEqualWidth = true;
// compTop.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL,
// GridData.VERTICAL_ALIGN_FILL, true, true));
compTop.setLayoutData(new GridData(GridData.FILL_BOTH));
toolkit.paintBordersFor(compTop);
final CTabFolder tabFolder = new CTabFolder(compTop, SWT.FLAT
| SWT.BORDER | SWT.TOP);
tabFolder.setUnselectedCloseVisible(false);
// tabFolder.setEnabled(false);
// tabFolder.setMaximizeVisible(true);
// tabFolder.setMinimizeVisible(true);
// tabFolder.marginHeight = 10;
tabFolder.setSimple(false);
toolkit.adapt(tabFolder, true, true);
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
tabFolder.setLayoutData(gd);
Display display = sashForm.getDisplay();
ITheme theme = PlatformUI.getWorkbench().getThemeManager()
.getCurrentTheme();
ColorRegistry colorRegistry = theme.getColorRegistry();
compTop.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
// tabFolder.setBackground(compTop.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
drawGradient(tabFolder, colorRegistry.get(IWorkbenchThemeConstants.ACTIVE_TAB_TEXT_COLOR),
new Color[] {colorRegistry.get(IWorkbenchThemeConstants.ACTIVE_TAB_BG_START),
colorRegistry.get(IWorkbenchThemeConstants.ACTIVE_TAB_BG_END) },
new int[] { theme.getInt(IWorkbenchThemeConstants.ACTIVE_TAB_PERCENT) },
theme.getBoolean(IWorkbenchThemeConstants.ACTIVE_TAB_VERTICAL));
tabFolder.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
int currentView = -1;
int index = tabFolder.getSelectionIndex();
if (index >= 0) {
if (index == 0) {
currentView = AnnotatedTextSectionPart.TAB_VIEW_ANNOTATIONS;
} else if (index == 1) {
currentView = AnnotatedTextSectionPart.TAB_VIEW_INDEX_REPO;
} else if (index == 2) {
currentView = AnnotatedTextSectionPart.TAB_VIEW_CASDIFF;
}
if (currentView != -1) {
docSection.switchViewForAnnotations(currentView);
}
}
}
public void widgetDefaultSelected(SelectionEvent e) {
}
});
compTop.addControlListener(new ControlAdapter() {
public void controlResized(ControlEvent e) {
// Trace.err("compTop");
// TODO Resize
// tabFolder.layout(true, true);
// managedForm.reflow(true);
// managedForm.refresh();
}
});
/** ****************************************************************** */
/* Create Tab Item for "Type System" */
/** ****************************************************************** */
createCASTypesTab(managedForm, tabFolder);
createIndexRepositoryTab(managedForm, tabFolder);
// if (testCASDiff) {
// createCASDiffTab(managedForm, tabFolder);
// }
tabFolder.setSelection(0);
}