use of com.sldeditor.datasource.extension.filesystem.node.database.DatabaseNode in project sldeditor by robward-scisys.
the class DatabaseInput method addConnectionNode.
/**
* Adds the connection node.
*
* @param connection the connection
*/
private void addConnectionNode(DatabaseConnection connection) {
DatabaseNode node = new DatabaseNode(this, connection);
getRootDatabaseNode(connection).add(node);
progress.addNewConnectionNode(connection, node);
}
use of com.sldeditor.datasource.extension.filesystem.node.database.DatabaseNode in project sldeditor by robward-scisys.
the class DatabaseReadProgress method deleteConnection.
/**
* Delete connection.
*
* @param connection the connection
*/
public void deleteConnection(DatabaseConnection connection) {
DatabaseNode node = nodeMap.get(connection);
if (treeModel != null) {
treeModel.removeNodeFromParent(node);
}
nodeMap.remove(connection);
}
use of com.sldeditor.datasource.extension.filesystem.node.database.DatabaseNode in project sldeditor by robward-scisys.
the class DatabaseReadProgress method checkPopulateComplete.
/**
* Check populate complete.
*
* @param connection the connection
*/
private void checkPopulateComplete(DatabaseConnection connection) {
PopulateState state = populateStateMap.get(connection);
if (state != null) {
if (state.isComplete()) {
DatabaseNode databaseNode = nodeMap.get(connection);
if (databaseNode != null) {
removeNode(databaseNode, PROGRESS_NODE_TITLE);
populateFeatureClasses(connection, databaseNode);
if (treeModel != null) {
// this notifies the listeners and changes the GUI
treeModel.reload(databaseNode);
}
}
parseComplete.populateComplete(connection, databaseFeatureClassMap.get(connection));
}
}
}
use of com.sldeditor.datasource.extension.filesystem.node.database.DatabaseNode in project sldeditor by robward-scisys.
the class DatabaseConnectionTool method setSelectedItems.
/*
* (non-Javadoc)
*
* @see com.sldeditor.tool.ToolInterface#setSelectedItems(java.util.List, java.util.List)
*/
@Override
public void setSelectedItems(List<NodeInterface> nodeTypeList, List<SLDDataInterface> sldDataList) {
connectionList.clear();
if (nodeTypeList != null) {
for (NodeInterface node : nodeTypeList) {
if (node instanceof DatabaseNode) {
DatabaseNode databaseNode = (DatabaseNode) node;
connectionList.add(databaseNode.getConnection());
} else if (node instanceof FileTreeNode) {
FileTreeNode fileNode = (FileTreeNode) node;
if (fileNode.getFileCategory() == FileTreeNodeTypeEnum.DATABASE) {
DatabaseConnection databaseConnection = DatabaseConnectionFactory.getConnection(fileNode.getFile().getAbsolutePath());
connectionList.add(databaseConnection);
}
}
}
}
updateButtonState();
}
use of com.sldeditor.datasource.extension.filesystem.node.database.DatabaseNode in project sldeditor by robward-scisys.
the class DatabaseReadProgress method updateConnection.
/**
* Update connection.
*
* @param originalConnectionDetails the original connection details
* @param newConnectionDetails the new connection details
*/
public void updateConnection(DatabaseConnection originalConnectionDetails, DatabaseConnection newConnectionDetails) {
if (newConnectionDetails != null) {
DatabaseNode databaseNode = nodeMap.get(originalConnectionDetails);
originalConnectionDetails.update(newConnectionDetails);
if (databaseNode != null) {
databaseNode.setUserObject(newConnectionDetails.getConnectionName());
refreshNode(databaseNode);
setFolder(newConnectionDetails.getDatabaseTypeLabel(), newConnectionDetails, false);
}
}
}
Aggregations