Search in sources :

Example 1 with CTabFolder2Listener

use of org.eclipse.swt.custom.CTabFolder2Listener in project cubrid-manager by CUBRID.

the class CombinedQueryEditorComposite method createResultFolder.

/**
	 * Create the result folder including query result and query plan result
	 *
	 * @param topSash SashForm
	 * @param sqlEditorParentComp Composite
	 */
private void createResultFolder(final SashForm topSash, final Composite sqlEditorParentComp) {
    final Composite resultComp = new Composite(topSash, SWT.NONE);
    {
        GridLayout gridLayout = new GridLayout();
        gridLayout.horizontalSpacing = 0;
        gridLayout.verticalSpacing = 0;
        gridLayout.marginWidth = 0;
        gridLayout.marginHeight = 0;
        resultComp.setLayout(gridLayout);
        resultComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    }
    // result folder
    final CTabFolder resultTabFolder = new CTabFolder(resultComp, SWT.TOP);
    resultTabFolder.setLayout(new FillLayout());
    resultTabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    resultTabFolder.setSimple(false);
    resultTabFolder.setUnselectedImageVisible(true);
    resultTabFolder.setUnselectedCloseVisible(true);
    resultTabFolder.setSelectionBackground(BACK_COLOR);
    resultTabFolder.setSelectionForeground(ResourceManager.getColor(SWT.COLOR_BLACK));
    resultTabFolder.setMinimizeVisible(true);
    resultTabFolder.setMaximizeVisible(true);
    this.resultTabFolder = resultTabFolder;
    resultTabFolder.addCTabFolder2Listener(new CTabFolder2Listener() {

        public void close(CTabFolderEvent event) {
        }

        public void maximize(CTabFolderEvent event) {
            resultTabFolder.setMaximized(true);
            topSash.setMaximizedControl(resultComp);
            editor.getShowResultItem().setImage(CommonUIPlugin.getImage("icons/queryeditor/qe_panel_down.png"));
            topSash.layout(true);
        }

        public void minimize(CTabFolderEvent event) {
            resultTabFolder.setMinimized(true);
            topSash.setMaximizedControl(sqlEditorParentComp);
            editor.getShowResultItem().setImage(CommonUIPlugin.getImage("icons/queryeditor/qe_panel_up.png"));
            topSash.layout(true);
        }

        public void restore(CTabFolderEvent event) {
            resultTabFolder.setMinimized(false);
            resultTabFolder.setMaximized(false);
            topSash.setMaximizedControl(null);
            editor.getShowResultItem().setImage(CommonUIPlugin.getImage("icons/queryeditor/qe_panel_down.png"));
            topSash.layout(true);
        }

        public void showList(CTabFolderEvent event) {
        }
    });
    // query result tab area
    queryResultComp = new QueryResultComposite(resultTabFolder, SWT.NONE, editor);
    // query plan result tab area
    queryPlanResultComp = new QueryPlanCompositeWithHistory(resultTabFolder, SWT.NONE, editor);
    // recently Used SQL tab area
    recentlyUsedSQLComposite = new RecentlyUsedSQLComposite(resultTabFolder, SWT.NONE, editor);
    recentlyUsedSQLComposite.initialize();
    // create multiple query
    multiDBQueryComp = new MultiDBQueryComposite(resultTabFolder, SWT.NONE, editor);
    multiDBQueryComp.initialize();
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) CTabFolder(org.eclipse.swt.custom.CTabFolder) Composite(org.eclipse.swt.widgets.Composite) CTabFolder2Listener(org.eclipse.swt.custom.CTabFolder2Listener) GridData(org.eclipse.swt.layout.GridData) CTabFolderEvent(org.eclipse.swt.custom.CTabFolderEvent) FillLayout(org.eclipse.swt.layout.FillLayout)

Aggregations

CTabFolder (org.eclipse.swt.custom.CTabFolder)1 CTabFolder2Listener (org.eclipse.swt.custom.CTabFolder2Listener)1 CTabFolderEvent (org.eclipse.swt.custom.CTabFolderEvent)1 FillLayout (org.eclipse.swt.layout.FillLayout)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1