Search in sources :

Example 1 with ViewsDetailInfoCTabItem

use of com.cubrid.common.ui.cubrid.view.editor.ViewDashboardComposite.ViewsDetailInfoCTabItem in project cubrid-manager by CUBRID.

the class ViewDashboardEditorPart method refresh.

public void refresh() {
    OpenViewsDetailInfoPartProgress progress = new OpenViewsDetailInfoPartProgress(database);
    progress.loadViewsInfo();
    if (progress.isSuccess()) {
        viewList = progress.getViewList();
        viewsDetailInfoTable.setInput(viewList);
        viewsDetailInfoTable.refresh();
        List<CTabItem> closeTabItem = new ArrayList<CTabItem>();
        for (CTabItem cTabItem : tabFolder.getItems()) {
            ViewsDetailInfoCTabItem viewsDetailInfoCTabItem = (ViewsDetailInfoCTabItem) cTabItem;
            //refresh column data
            if (findItemName(viewsDetailInfoCTabItem.getText())) {
                SchemaInfo schemaInfo = database.getDatabaseInfo().getSchemaInfo(viewsDetailInfoCTabItem.getText());
                viewsDetailInfoCTabItem.getViewInfoComposite().setInput(schemaInfo);
            } else {
                //tag non-exist view tab
                closeTabItem.add(cTabItem);
            }
        }
        //dispose non-exist view tab
        for (CTabItem cTabItem : closeTabItem) {
            cTabItem.dispose();
        }
        //if the select item is disposed ,set the first on selection
        if (tabFolder.getItems().length > 0 && tabFolder.getSelection().isDisposed()) {
            tabFolder.setSelection(0);
        }
        viewChangeFlag = false;
    }
}
Also used : ViewsDetailInfoCTabItem(com.cubrid.common.ui.cubrid.view.editor.ViewDashboardComposite.ViewsDetailInfoCTabItem) OpenViewsDetailInfoPartProgress(com.cubrid.common.ui.spi.progress.OpenViewsDetailInfoPartProgress) ArrayList(java.util.ArrayList) ViewsDetailInfoCTabItem(com.cubrid.common.ui.cubrid.view.editor.ViewDashboardComposite.ViewsDetailInfoCTabItem) CTabItem(org.eclipse.swt.custom.CTabItem) SchemaInfo(com.cubrid.common.core.common.model.SchemaInfo)

Aggregations

SchemaInfo (com.cubrid.common.core.common.model.SchemaInfo)1 ViewsDetailInfoCTabItem (com.cubrid.common.ui.cubrid.view.editor.ViewDashboardComposite.ViewsDetailInfoCTabItem)1 OpenViewsDetailInfoPartProgress (com.cubrid.common.ui.spi.progress.OpenViewsDetailInfoPartProgress)1 ArrayList (java.util.ArrayList)1 CTabItem (org.eclipse.swt.custom.CTabItem)1