use of org.talend.dataprofiler.core.ui.views.DQRespositoryView in project tdq-studio-se by Talend.
the class JoinConditionTableViewer method showSelectedElements.
/**
* DOC xqliu Comment method "showSelectedElements".
*
* @param table
* @param ab
*/
protected void showSelectedElements(Table table, String ab) {
TableItem[] selection = table.getSelection();
if (selection.length > 0) {
JoinElement join = (JoinElement) selection[0].getData();
ModelElement column = join.getColA();
if (COLUMN_B.equals(ab)) {
column = join.getColB();
}
DQRespositoryView dqview = CorePlugin.getDefault().findAndOpenRepositoryView();
// if DqRepository view is not openning will don'st should show the element immediately
if (dqview != null) {
RepositoryNode recursiveFind = RepositoryNodeHelper.recursiveFind(column);
if (recursiveFind == null) {
recursiveFind = RepositoryNodeHelper.createRepositoryNode(column);
}
dqview.showSelectedElements(recursiveFind);
}
}
}
use of org.talend.dataprofiler.core.ui.views.DQRespositoryView in project tdq-studio-se by Talend.
the class ModelElementTreeMenuProvider method showSelectedElements.
/**
* DOC Zqin Comment method "showSelectedElements".MOD 2009-01-07 mzhao.
*
* @param newTree
*/
private void showSelectedElements(Tree newTree) {
TreeItem[] selection = newTree.getSelection();
if (selection.length > 0) {
DQRespositoryView dqview = CorePlugin.getDefault().findAndOpenRepositoryView();
// if DqRepository view is not openning we will not do anything
if (dqview == null) {
return;
}
RepositoryNode node = getSelectedNode(selection);
dqview.showSelectedElements(node);
}
}
use of org.talend.dataprofiler.core.ui.views.DQRespositoryView in project tdq-studio-se by Talend.
the class LocalRepositoryObjectCRUD method getUISelection.
/*
* (non-Javadoc)
*
* @see org.talend.dataprofiler.core.ui.views.resources.IRepositoryObjectCRUD#getUISelection()
*/
@Override
public ISelection getUISelection() {
ISelection sel = null;
IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (activeWorkbenchWindow != null) {
IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
if (activePage != null) {
IWorkbenchPart activePart = activePage.getActivePart();
if (activePart != null) {
if (activePart instanceof DQRespositoryView) {
sel = ((DQRespositoryView) activePart).getCommonViewer().getSelection();
}
}
}
}
return sel;
}
use of org.talend.dataprofiler.core.ui.views.DQRespositoryView in project tdq-studio-se by Talend.
the class WorkbenchUtils method closeAndOpenEditor.
/**
* close and open the editors same method {@link CorePlugin}.getDefault().itemIsOpening() MOD TDQ-8360 20140410
* yyin: will only operate the analysis who is related and has opened (by its observer --added when opening)
*
* @param iEditorReference
*/
private static void closeAndOpenEditor(List<IEditorReference> iEditorReference) {
// Refresh current opened editors.
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPartReference activePartReference = activePage.getActivePartReference();
// MOD qiongli 2011-9-8 TDQ-3317.when focucs on DI perspective,don't refresh the open editors
DQRespositoryView findView = (DQRespositoryView) activePage.findView(DQRespositoryView.ID);
if (findView == null) {
return;
}
if (iEditorReference.size() > 0) {
try {
for (IEditorReference editorRef : iEditorReference) {
IEditorInput editorInput = editorRef.getEditorInput();
if (editorInput instanceof AbstractItemEditorInput) {
AbstractItemEditorInput anaItemEditorInput = (AbstractItemEditorInput) editorInput;
// close the editor
activePage.closeEditor(editorRef.getEditor(false), false);
// reopen the analysis
new OpenItemEditorAction(new IRepositoryNode[] { anaItemEditorInput.getRepNode() }).run();
}
}
} catch (PartInitException e) {
log.error(e);
}
}
activePage.activate(activePartReference.getPart(false));
}
use of org.talend.dataprofiler.core.ui.views.DQRespositoryView in project tdq-studio-se by Talend.
the class FolderWizard method performFinish.
/**
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
@Override
public boolean performFinish() {
final ReturnCode returncode = new ReturnCode(true);
RepositoryWorkUnit<Object> workUnit = new RepositoryWorkUnit<Object>(// $NON-NLS-1$
DefaultMessagesImpl.getString("FolderWizard.newFolder")) {
@Override
protected void run() throws LoginException, PersistenceException {
String folderName = mainPage.getName();
if (defaultLabel == null) {
IRepositoryNode currentSelectionNode = CorePlugin.getDefault().getCurrentSelectionNode();
IFolder folder = ResourcesPlugin.getWorkspace().getRoot().getFolder(path);
IFolder newFolder = folder.getFolder(folderName);
try {
if (ResourceManager.getConnectionFolder().getFullPath().isPrefixOf(folder.getFullPath())) {
// when create folder under dbconnections
ProxyRepositoryFactory.getInstance().createFolder(ERepositoryObjectType.METADATA_CONNECTIONS, path.makeRelativeTo(ResourceManager.getConnectionFolder().getFullPath()), folderName);
} else {
// when create folder under other nodes
newFolder.create(false, true, null);
}
// do refresh
folder.refreshLocal(IResource.DEPTH_INFINITE, null);
DQRespositoryView findView = CorePlugin.getDefault().getRepositoryView();
if (findView != null) {
findView.getCommonViewer().setExpandedState(newFolder, true);
findView.getCommonViewer().refresh(currentSelectionNode);
}
// list .
if (DQRepositoryNode.isOnFilterring()) {
RepositoryNodeHelper.fillTreeList(null);
RepositoryNodeHelper.setFilteredNode(RepositoryNodeHelper.getRootNode(ERepositoryObjectType.TDQ_DATA_PROFILING, true));
}
} catch (CoreException e) {
// $NON-NLS-1$
MessageDialog.openError(// $NON-NLS-1$
getShell(), // $NON-NLS-1$
DefaultMessagesImpl.getString("FolderWizard.error"), // $NON-NLS-1$
DefaultMessagesImpl.getString("FolderWizard.folderCreatedError"));
ExceptionHandler.process(e);
returncode.setOk(false);
return;
}
}
}
};
workUnit.setAvoidUnloadResources(true);
ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(workUnit);
return returncode.isOk();
}
Aggregations