Search in sources :

Example 1 with SearchTabBuilder

use of org.jboss.tools.hibernate.search.toolkit.search.SearchTabBuilder in project jbosstools-hibernate by jbosstools.

the class IndexToolkitView method createPartControl.

@Override
public void createPartControl(Composite parent) {
    parent.setLayout(new GridLayout(1, true));
    this.consoleConfigCombo = new ConfigurationCombo(parent, initialConsoleConfig == null ? null : initialConsoleConfig.getName());
    final CTabFolder folder = new CTabFolder(parent, SWT.TOP);
    folder.setLayoutData(new GridData(GridData.FILL, SWT.FILL, true, true));
    ConsoleConfiguration consoleConfig = KnownConfigurations.getInstance().find(this.consoleConfigCombo.getConsoleConfigSelected());
    final CTabItem analyzersTab = new CTabItem(folder, SWT.NONE);
    analyzersTab.setText(ANALYZERS_TAB_NAME);
    final AnalyzersTabBuilder analyzersBuilder = AnalyzersTabBuilder.getInstance();
    analyzersTab.setControl(analyzersBuilder.getTab(folder, consoleConfig));
    final CTabItem exploreDocsTab = new CTabItem(folder, SWT.NONE);
    exploreDocsTab.setText(EXPLORE_DOCS_TAB_NAME);
    final ExploreDocsTabBuilder exploreDocsBuilder = ExploreDocsTabBuilder.getInstance();
    exploreDocsTab.setControl(exploreDocsBuilder.getTab(folder, consoleConfig));
    final CTabItem searchTab = new CTabItem(folder, SWT.NONE);
    searchTab.setText(SEARCH_TAB_NAME);
    final SearchTabBuilder searchBuilder = SearchTabBuilder.getInstance();
    searchTab.setControl(searchBuilder.getTab(folder, consoleConfig));
    folder.setSelection(0);
    this.consoleConfigCombo.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            ConsoleConfiguration consoleConfig = KnownConfigurations.getInstance().find(((Combo) e.getSource()).getText());
            analyzersTab.setControl(analyzersBuilder.getTab(folder, consoleConfig));
            exploreDocsTab.setControl(exploreDocsBuilder.getTab(folder, consoleConfig));
            searchTab.setControl(searchBuilder.getTab(folder, consoleConfig));
        }
    });
}
Also used : CTabFolder(org.eclipse.swt.custom.CTabFolder) ConsoleConfiguration(org.hibernate.console.ConsoleConfiguration) ModifyListener(org.eclipse.swt.events.ModifyListener) Combo(org.eclipse.swt.widgets.Combo) CTabItem(org.eclipse.swt.custom.CTabItem) ExploreDocsTabBuilder(org.jboss.tools.hibernate.search.toolkit.docs.ExploreDocsTabBuilder) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) AnalyzersTabBuilder(org.jboss.tools.hibernate.search.toolkit.analyzers.AnalyzersTabBuilder) GridData(org.eclipse.swt.layout.GridData) SearchTabBuilder(org.jboss.tools.hibernate.search.toolkit.search.SearchTabBuilder)

Aggregations

CTabFolder (org.eclipse.swt.custom.CTabFolder)1 CTabItem (org.eclipse.swt.custom.CTabItem)1 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Combo (org.eclipse.swt.widgets.Combo)1 ConsoleConfiguration (org.hibernate.console.ConsoleConfiguration)1 AnalyzersTabBuilder (org.jboss.tools.hibernate.search.toolkit.analyzers.AnalyzersTabBuilder)1 ExploreDocsTabBuilder (org.jboss.tools.hibernate.search.toolkit.docs.ExploreDocsTabBuilder)1 SearchTabBuilder (org.jboss.tools.hibernate.search.toolkit.search.SearchTabBuilder)1