use of org.talend.dq.nodes.foldernode.IFolderNode in project tdq-studio-se by Talend.
the class ChangeConnectionAction method reloadByColumnFolderLevel.
private void reloadByColumnFolderLevel(List<SynTreeModel> treeModelLs, AnalyzedElementSynDialog anaEleSynDialog, Connection newDataProv) throws ReloadCompareException {
ModelElement newDataProviderModel = treeModelLs.get(0).getNewDataProvElement();
// If schema or catalog changed, we did not load anymore.
// Reload column folder
ColumnSet columnset = null;
if (newDataProviderModel instanceof ColumnSet) {
columnset = (ColumnSet) newDataProviderModel;
} else if (newDataProviderModel instanceof TdColumn) {
columnset = ColumnHelper.getColumnOwnerAsColumnSet(newDataProviderModel);
} else {
return;
}
// MOD mzhao bug 8567 2010-03-29
IFolderNode reloadFolder = FolderNodeHelper.getFolderNodes(columnset)[0];
if (reloadFolder != null) {
IComparisonLevel creatComparisonLevel = ComparisonLevelFactory.creatComparisonLevel(reloadFolder);
if (creatComparisonLevel != null) {
// FIXME newDataProv is never used in the following codes.
newDataProv = creatComparisonLevel.reloadCurrentLevelElement();
}
// Recompute after reload
// FIXME treeModelLs is never used in the following codes.
treeModelLs = anaEleSynDialog.getSynInputModel();
}
}
use of org.talend.dq.nodes.foldernode.IFolderNode in project tdq-studio-se by Talend.
the class RenameComparedElementAction method getRightResource.
private Resource getRightResource(ColumnSet selectedColumnSet) throws ReloadCompareException {
Connection tempReloadProvider = createTempConnectionFile();
Package matchedPackage = DQStructureComparer.findMatchedPackage((Package) originCompareElement, tempReloadProvider);
IFolderNode columnSetFolderNode = FolderNodeHelper.getFolderNode(matchedPackage, selectedColumnSet);
columnSetFolderNode.loadChildren();
ColumnSet findMatchedColumnSet = DQStructureComparer.findMatchedColumnSet(selectedColumnSet, tempReloadProvider);
List<TdColumn> columns = null;
try {
columns = DqRepositoryViewService.getColumns(tempReloadProvider, findMatchedColumnSet, null, true);
} catch (Exception e1) {
throw new ReloadCompareException(e1);
}
URI uri = tempReloadProvider.eResource().getURI();
Resource rightResource = null;
rightResource = EMFSharedResources.getInstance().getResource(uri, true);
if (rightResource == null) {
// $NON-NLS-1$
throw new ReloadCompareException("NoFactoryFoundForURI" + uri.toFileString());
}
rightResource.getContents().clear();
for (TdColumn column : columns) {
DQStructureComparer.clearSubNode(column);
rightResource.getContents().add(column);
}
EMFSharedResources.getInstance().saveResource(rightResource);
return rightResource;
}
use of org.talend.dq.nodes.foldernode.IFolderNode in project tdq-studio-se by Talend.
the class DBTablesViewLabelProvider method getText.
@Override
public String getText(Object element) {
if (element instanceof IContainer) {
return ((IContainer) element).getName();
} else if (element instanceof IFolderNode) {
return ((IFolderNode) element).getName();
} else if (element instanceof IRepositoryViewObject) {
IRepositoryViewObject reposViewObj = (IRepositoryViewObject) element;
ConnectionItem item = (ConnectionItem) reposViewObj.getProperty().getItem();
String decorateText = PluginConstant.EMPTY_STRING;
if (item.getConnection() != null) {
decorateText = item.getConnection().getName();
}
return decorateText;
}
return super.getText(element);
}
use of org.talend.dq.nodes.foldernode.IFolderNode in project tdq-studio-se by Talend.
the class FolderNodeHelper method getFolderNode.
/**
* MOD mzhao bug 8567, 2010-03-29 Alter the first parameter type from EObject to Package.
*
* @param eObject
* @param columnSet
* @return
*/
public static IFolderNode getFolderNode(orgomg.cwm.objectmodel.core.Package eObject, ColumnSet columnSet) {
IFolderNode[] folderNodes = catalogFolderNodeMap.get(eObject);
if (folderNodes == null) {
folderNodes = createTableViewNodes(eObject);
}
TdTable doSwitch = SwitchHelpers.TABLE_SWITCH.doSwitch(columnSet);
if (doSwitch != null) {
return folderNodes[0];
} else {
return folderNodes[1];
}
}
use of org.talend.dq.nodes.foldernode.IFolderNode in project tdq-studio-se by Talend.
the class DBPackagesViewLabelProvider method getText.
public String getText(Object element) {
if (element instanceof IContainer) {
return ((IContainer) element).getName();
} else if (element instanceof IFolderNode) {
return ((IFolderNode) element).getName();
} else if (element instanceof IRepositoryViewObject) {
IRepositoryViewObject reposViewObj = (IRepositoryViewObject) element;
ConnectionItem item = (ConnectionItem) reposViewObj.getProperty().getItem();
String decorateText = PluginConstant.EMPTY_STRING;
if (item.getConnection() != null) {
decorateText = item.getConnection().getName();
}
return decorateText;
}
return super.getText(element);
}
Aggregations