in CasViewerEclipsePlugin/uimaj-ep-casviewer-core/src/main/java/org/apache/uima/casviewer/ui/internal/index/FSIndexSectionPart.java [281:354]
protected void createSectionToolbar (FormToolkit toolkit, Section section,
Composite toolbarComposite, final CheckboxTreeViewer treeViewer)
{
AbstractSectionPart.createExpandAllMenu (toolkit, section, toolbarComposite,
treeViewer);
AbstractSectionPart.createCollapseAllMenu(toolkit, section, toolbarComposite,
treeViewer);
// Create Menu
final Menu subMenu = new Menu (toolbarComposite);
MenuItem item = new MenuItem(subMenu, SWT.NONE);
item.setText("Deselect All");
item.addSelectionListener(new SelectionListener () {
public void widgetSelected (SelectionEvent event) {
// TODO Optimize by creating a list of "showed" AnnotationObjects
for (AnnotationObject annot: annotationObjectList) {
annot.show = false;
}
casViewControl.showAnnotationsForView(AbstractAnnotatedTextSectionPart.TAB_VIEW_INDEX_REPO/*, fsDocumentAnnotList*/);
treeViewer.setAllChecked(false);
}
public void widgetDefaultSelected(SelectionEvent e) {
}
});
new MenuItem(subMenu, SWT.SEPARATOR);
item = new MenuItem(subMenu, SWT.NONE);
item.setText("Show Flat Structure");
item.addSelectionListener(new SelectionListener () {
public void widgetSelected (SelectionEvent event) {
// Trace.trace("Show Input Types");
// _typeTreeViewerFiler.setFilterFlags(TypeSystemViewerFilter.FILTER_TYPE_SHOW_INPUT, true);
contentProvider.showOneLineView(true);
labelProvider.showOneLineView(true);
treeViewer.refresh(true);
treeViewer.expandToLevel(2);
}
public void widgetDefaultSelected(SelectionEvent e) {
// TODO Auto-generated method stub
}
});
item = new MenuItem(subMenu, SWT.NONE);
item.setText("Show Tree Structure");
item.setData(null);
item.addSelectionListener(new SelectionListener () {
public void widgetSelected (SelectionEvent event) {
// Trace.trace("Show Output Types");
// _typeTreeViewerFiler.setFilterFlags(TypeSystemViewerFilter.FILTER_TYPE_SHOW_OUTPUT, true);
contentProvider.showOneLineView(false);
labelProvider.showOneLineView(false);
// _typeTreeViewer.setInput(_typeHierarchy);
treeViewer.refresh(true);
treeViewer.expandToLevel(2);
}
public void widgetDefaultSelected(SelectionEvent e) {
}
});
ImageHyperlink info = new ImageHyperlink(toolbarComposite, SWT.NULL);
toolkit.adapt(info, true, true);
info.setImage(ImageLoader.getInstance().getImage(ImageLoader.ICON_UI_VIEW_MENU));
info.setToolTipText("Flat or Tree...");
info.setBackground(section.getTitleBarGradientBackground());
info.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
subMenu.setVisible(true);
}
});
}