use of org.talend.dq.nodes.DBCatalogRepNode in project tdq-studio-se by Talend.
the class SchemaAnalysisDPSelectionPage method addListeners.
@Override
protected void addListeners() {
addListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
Object object = ((IStructuredSelection) event.getSelection()).getFirstElement();
if (object instanceof Schema) {
advanceToNextPageOrFinish();
}
}
});
addListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
Object object = ((IStructuredSelection) event.getSelection()).getFirstElement();
PackagesAnalyisParameter schemaPanameter = (PackagesAnalyisParameter) getConnectionParams();
List<IRepositoryNode> nodes = new ArrayList<IRepositoryNode>();
if (object instanceof DBSchemaRepNode) {
DBSchemaRepNode schemaNode = (DBSchemaRepNode) object;
Schema schema = ((MetadataSchemaRepositoryObject) schemaNode.getObject()).getSchema();
Connection tdProvider = ConnectionHelper.getTdDataProvider(SwitchHelpers.PACKAGE_SWITCH.doSwitch(schema));
RepositoryNode parent = schemaNode.getParent();
if (tdProvider != null && schemaPanameter != null) {
if (parent instanceof DBCatalogRepNode) {
schemaPanameter.setConnectionRepNode((DBConnectionRepNode) parent.getParent());
} else {
schemaPanameter.setConnectionRepNode((DBConnectionRepNode) parent);
}
schemaPanameter.setTdDataProvider(tdProvider);
}
nodes.add(schemaNode);
schemaPanameter.setPackages(nodes);
setPageComplete(true);
} else {
setPageComplete(false);
}
}
});
}
use of org.talend.dq.nodes.DBCatalogRepNode in project tdq-studio-se by Talend.
the class ColumnsSelectionDialog method handleTreeExpanded.
/**
* Added TDQ-8718 20140506 yyin: when expand the nodes in the column select dialog, should refresh the table/view
* folder. otherwise: if the parent catalog is checked before expanding, it may get no children(without connecting
* to db) If the user has checked some high level node, must refresh the table/view folder node. otherwise, it
* always return 0
*/
@Override
protected void handleTreeExpanded(TreeItem item) {
Object node = item.getData();
if (node instanceof DBCatalogRepNode || node instanceof DBSchemaRepNode) {
TreeItem[] children = item.getItems();
if (children != null) {
for (TreeItem child : children) {
Object data = child.getData();
if (data != null) {
if (!(data instanceof DQDBFolderRepositoryNode)) {
break;
} else {
getTreeViewer().refresh(data, true);
}
}
}
}
}
super.handleTreeExpanded(item);
}
Aggregations