use of com.cubrid.common.ui.spi.progress.OpenViewsDetailInfoPartProgress 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;
}
}
use of com.cubrid.common.ui.spi.progress.OpenViewsDetailInfoPartProgress in project cubrid-manager by CUBRID.
the class OpenTargetAction method openViewsDetailInfoEditor.
/**
* open view detail info part
* @param database
*/
public void openViewsDetailInfoEditor(CubridDatabase database) {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (null == window) {
return;
}
if (database == null) {
return;
}
/*Check it open same editor*/
IEditorPart editorPart = getOpenedEditorPart(database, ViewDashboardEditorPart.ID);
if (editorPart == null) {
OpenViewsDetailInfoPartProgress progress = new OpenViewsDetailInfoPartProgress(database);
progress.loadViewsInfo();
if (progress.isSuccess()) {
ViewDashboardInput input = new ViewDashboardInput(database, progress.getViewList());
try {
window.getActivePage().openEditor(input, ViewDashboardEditorPart.ID);
} catch (PartInitException e) {
LOGGER.error("Can not initialize the view view list UI.", e);
}
}
} else {
ViewDashboardEditorPart viewsDetailInfoPart = (ViewDashboardEditorPart) editorPart;
window.getActivePage().activate(viewsDetailInfoPart);
viewsDetailInfoPart.refresh();
}
}
Aggregations