use of org.jkiss.dbeaver.model.struct.DBSDataContainer in project dbeaver by serge-rider.
the class DatabaseConsumerSettings method isCompleted.
public boolean isCompleted(Collection<DataTransferPipe> pipes) {
for (DataTransferPipe pipe : pipes) {
if (pipe.getProducer() != null) {
DBSDataContainer sourceObject = (DBSDataContainer) pipe.getProducer().getSourceObject();
DatabaseMappingContainer containerMapping = dataMappings.get(sourceObject);
if (containerMapping == null || containerMapping.getMappingType() == DatabaseMappingType.unspecified || !containerMapping.isCompleted()) {
return false;
}
}
}
return true;
}
use of org.jkiss.dbeaver.model.struct.DBSDataContainer in project dbeaver by serge-rider.
the class DataImportHandler method chooseProducer.
@Override
protected IDataTransferProducer chooseProducer(ExecutionEvent event, IDataTransferConsumer consumer) {
final DBNModel navigatorModel = DBeaverCore.getInstance().getNavigatorModel();
final DBNNode rootNode = DBeaverCore.getInstance().getLiveProjects().size() == 1 ? navigatorModel.getRoot().getProject(DBeaverCore.getInstance().getProjectRegistry().getActiveProject()) : navigatorModel.getRoot();
DBNNode node = BrowseObjectDialog.selectObject(HandlerUtil.getActiveShell(event), "Select source container for '" + consumer.getTargetName() + "'", rootNode, null, new Class[] { DBSObjectContainer.class, DBSDataContainer.class }, new Class[] { DBSDataContainer.class });
if (node instanceof DBNDatabaseNode) {
DBSObject object = ((DBNDatabaseNode) node).getObject();
if (object instanceof DBSDataContainer) {
return new DatabaseTransferProducer((DBSDataContainer) object);
}
}
return null;
}
use of org.jkiss.dbeaver.model.struct.DBSDataContainer in project dbeaver by serge-rider.
the class ResultSetFilterPanel method getActiveQueryText.
@NotNull
private String getActiveQueryText() {
DBCStatistics statistics = viewer.getModel().getStatistics();
String queryText = statistics == null ? null : statistics.getQueryText();
if (queryText == null || queryText.isEmpty()) {
DBSDataContainer dataContainer = viewer.getDataContainer();
if (dataContainer != null) {
return dataContainer.getName();
}
queryText = DEFAULT_QUERY_TEXT;
}
return queryText;
}
use of org.jkiss.dbeaver.model.struct.DBSDataContainer in project dbeaver by serge-rider.
the class ResultSetFilterPanel method openEditorForActiveQuery.
private void openEditorForActiveQuery() {
DBSDataContainer dataContainer = viewer.getDataContainer();
String editorName;
if (dataContainer instanceof DBSEntity) {
editorName = dataContainer.getName();
} else {
editorName = "Query";
}
OpenHandler.openSQLConsole(DBeaverUI.getActiveWorkbenchWindow(), dataContainer == null ? null : dataContainer.getDataSource().getContainer(), editorName, getActiveQueryText());
}
use of org.jkiss.dbeaver.model.struct.DBSDataContainer in project dbeaver by serge-rider.
the class ResultSetFilterPanel method getActiveSourceQuery.
@NotNull
private String getActiveSourceQuery() {
String displayName;
DBSDataContainer dataContainer = viewer.getDataContainer();
if (dataContainer != null) {
displayName = dataContainer.getName();
} else {
displayName = getActiveQueryText();
}
return displayName;
}
Aggregations