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);
}
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);
}
}
}
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();
}
}
Aggregations