Search in sources :

Example 1 with OpenTriggerDetailInfoPartProgress

use of com.cubrid.common.ui.spi.progress.OpenTriggerDetailInfoPartProgress in project cubrid-manager by CUBRID.

the class OpenTargetAction method openTriggersDetailInfoEditor.

/**
	 * open trigger detail info part
	 * @param database
	 */
public void openTriggersDetailInfoEditor(CubridDatabase database) {
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (null == window) {
        return;
    }
    if (database == null) {
        return;
    }
    /*Check it open same editor*/
    IEditorPart editorPart = getOpenedEditorPart(database, TriggerDashboardEditorPart.ID);
    if (editorPart == null) {
        OpenTriggerDetailInfoPartProgress progress = new OpenTriggerDetailInfoPartProgress(database);
        progress.loadTriggerInfoList();
        if (progress.isSuccess()) {
            TriggerDashboardInput input = new TriggerDashboardInput(database, progress.getTriggerList());
            try {
                window.getActivePage().openEditor(input, TriggerDashboardEditorPart.ID);
            } catch (PartInitException e) {
                LOGGER.error("Can not initialize the trigger view list UI.", e);
            }
        }
    } else {
        TriggerDashboardEditorPart triggerDetailInfoPart = (TriggerDashboardEditorPart) editorPart;
        window.getActivePage().activate(triggerDetailInfoPart);
        triggerDetailInfoPart.refresh();
    }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) OpenTriggerDetailInfoPartProgress(com.cubrid.common.ui.spi.progress.OpenTriggerDetailInfoPartProgress) TriggerDashboardInput(com.cubrid.common.ui.cubrid.trigger.editor.TriggerDashboardInput) IEditorPart(org.eclipse.ui.IEditorPart) PartInitException(org.eclipse.ui.PartInitException) TriggerDashboardEditorPart(com.cubrid.common.ui.cubrid.trigger.editor.TriggerDashboardEditorPart)

Example 2 with OpenTriggerDetailInfoPartProgress

use of com.cubrid.common.ui.spi.progress.OpenTriggerDetailInfoPartProgress in project cubrid-manager by CUBRID.

the class TriggerDashboardEditorPart method refresh.

/**
	 * refresh data
	 */
public void refresh() {
    OpenTriggerDetailInfoPartProgress progress = new OpenTriggerDetailInfoPartProgress(database);
    progress.loadTriggerInfoList();
    if (progress.isSuccess()) {
        triggerList = progress.getTriggerList();
        setInputs();
    }
    triggerChangeFlag = false;
}
Also used : OpenTriggerDetailInfoPartProgress(com.cubrid.common.ui.spi.progress.OpenTriggerDetailInfoPartProgress)

Aggregations

OpenTriggerDetailInfoPartProgress (com.cubrid.common.ui.spi.progress.OpenTriggerDetailInfoPartProgress)2 TriggerDashboardEditorPart (com.cubrid.common.ui.cubrid.trigger.editor.TriggerDashboardEditorPart)1 TriggerDashboardInput (com.cubrid.common.ui.cubrid.trigger.editor.TriggerDashboardInput)1 IEditorPart (org.eclipse.ui.IEditorPart)1 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)1 PartInitException (org.eclipse.ui.PartInitException)1