use of org.talend.repository.nosql.ui.thread.RetrieveColumnRunnable in project tbd-studio-se by Talend.
the class AbstractNoSQLRetrieveSchemaForm method addTable.
private void addTable(TreeItem item) {
INoSQLSchemaNode node = (INoSQLSchemaNode) item.getData();
if (isExistTable(node, false)) {
MetadataTable table = getTable(node, false);
orgomg.cwm.objectmodel.core.Package pack = (orgomg.cwm.objectmodel.core.Package) table.eContainer();
boolean confirm = MessageDialog.openConfirm(Display.getDefault().getActiveShell(), // $NON-NLS-1$
Messages.getString("AbstractNoSQLRetrieveSchemaForm.confirm"), // $NON-NLS-1$
Messages.getString("AbstractNoSQLRetrieveSchemaForm.ConfirmMessage", pack.getName()));
if (confirm) {
TreeItem existItem = getExistItem(table);
if (existItem != null) {
existItem.setChecked(false);
deleteTable(existItem);
}
} else {
item.setChecked(false);
return;
}
}
if (!retrieveSchemaExecutor.isThreadRunning(node) && node.getSchemaType() == ENoSQLSchemaType.TABLE) {
RetrieveColumnRunnable runnable = new RetrieveColumnRunnable(metadataProvider, getConnection(), node, hitTablesMap) {
@Override
protected void refresh(INoSQLSchemaNode schemaNode) {
refreshTable(schemaNode);
}
};
retrieveSchemaExecutor.execute(runnable);
}
}
use of org.talend.repository.nosql.ui.thread.RetrieveColumnRunnable in project tbd-studio-se by Talend.
the class AbstractNoSQLRetrieveSchemaForm method deleteTable.
private void deleteTable(TreeItem item) {
INoSQLSchemaNode node = (INoSQLSchemaNode) item.getData();
if (node != null && node.getSchemaType() == ENoSQLSchemaType.TABLE) {
String tableName = MetadataToolHelper.validateTableName(node.getName());
NoSQLSchemaUtil.removeTableFromConnection(getConnection(), tableName, NoSQLRepositoryUtil.getDBName(node));
hitTablesMap.remove(tableName);
clearItemStatus(node);
RetrieveColumnRunnable runnable = retrieveSchemaExecutor.getRunnable(node);
if (runnable != null) {
runnable.setCanceled(true);
}
schemaViewer.refresh(node);
}
}
Aggregations