Search in sources :

Example 1 with SupportContextEditor

use of org.talend.dataprofiler.core.ui.editor.SupportContextEditor in project tdq-studio-se by Talend.

the class AbstractAnalysisMetadataPage method saveContext.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.dataprofiler.core.ui.editor.AbstractMetadataFormPage#saveContext()
     */
@Override
protected void saveContext() {
    // save contexts
    Analysis analysis = getCurrentModelElement();
    IContextManager contextManager = currentEditor.getContextManager();
    contextManager.saveToEmf(analysis.getContextType());
    analysis.setDefaultContext(getDefaultContextGroupName((SupportContextEditor) currentEditor));
    AnalysisHelper.setLastRunContext(currentEditor.getLastRunContextGroupName(), analysis);
}
Also used : SupportContextEditor(org.talend.dataprofiler.core.ui.editor.SupportContextEditor) Analysis(org.talend.dataquality.analysis.Analysis) IContextManager(org.talend.core.model.process.IContextManager)

Example 2 with SupportContextEditor

use of org.talend.dataprofiler.core.ui.editor.SupportContextEditor in project tdq-studio-se by Talend.

the class ContextViewHelper method hideContextView.

public static void hideContextView(IWorkbenchPart part) {
    boolean currentEditorOpened = false;
    IWorkbenchPage page = part.getSite().getWorkbenchWindow().getActivePage();
    if (page == null) {
        return;
    }
    IEditorReference[] editorReferences = page.getEditorReferences();
    for (IEditorReference editorRef : editorReferences) {
        if (editorRef != null && editorRef.getEditor(false) != null) {
            if (editorRef.getEditor(false) instanceof SupportContextEditor) {
                currentEditorOpened = true;
                break;
            }
        }
    }
    if (!currentEditorOpened) {
        IViewPart ctxViewer = page.findView(AbstractContextView.CTX_ID_TDQ);
        if (ctxViewer != null) {
            page.hideView(ctxViewer);
        }
    }
}
Also used : SupportContextEditor(org.talend.dataprofiler.core.ui.editor.SupportContextEditor) IViewPart(org.eclipse.ui.IViewPart) IEditorReference(org.eclipse.ui.IEditorReference) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage)

Example 3 with SupportContextEditor

use of org.talend.dataprofiler.core.ui.editor.SupportContextEditor in project tdq-studio-se by Talend.

the class ContextViewHelper method updateContextView.

public static void updateContextView(IWorkbenchPart part) {
    IWorkbenchPart testedPart = part;
    if (!(part instanceof SupportContextEditor)) {
        testedPart = part.getSite().getWorkbenchWindow().getActivePage().getActiveEditor();
    }
    // only for ReportEditror and AnalysisEditor
    if (testedPart instanceof SupportContextEditor) {
        SupportContextEditor currentEditor = (SupportContextEditor) testedPart;
        Contexts.setTitle(currentEditor.getTitle());
        currentEditor.updateContextView();
    }
}
Also used : SupportContextEditor(org.talend.dataprofiler.core.ui.editor.SupportContextEditor) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart)

Aggregations

SupportContextEditor (org.talend.dataprofiler.core.ui.editor.SupportContextEditor)3 IEditorReference (org.eclipse.ui.IEditorReference)1 IViewPart (org.eclipse.ui.IViewPart)1 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)1 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)1 IContextManager (org.talend.core.model.process.IContextManager)1 Analysis (org.talend.dataquality.analysis.Analysis)1