use of com.sldeditor.datasource.extension.filesystem.node.database.DatabaseOverallNode in project sldeditor by robward-scisys.
the class DatabaseInput method populate.
/*
* (non-Javadoc)
*
* @see com.sldeditor.common.filesystem.FileSystemInterface#populate(com.sldeditor.datasource.extension.filesystem.node.FSTree,
* javax.swing.tree.DefaultTreeModel, javax.swing.tree.DefaultMutableTreeNode)
*/
@Override
public void populate(FSTree tree, DefaultTreeModel model, DefaultMutableTreeNode rootNode) {
progress.setTreeModel(tree, model);
if (rootNode != null) {
for (String key : getRootDatabaseNodes().keySet()) {
DatabaseOverallNode node = getRootDatabaseNodes().get(key);
rootNode.add(node);
}
}
for (DatabaseConnection connection : DatabaseConnectionManager.getInstance().getConnectionMap().keySet()) {
addConnectionNode(connection);
}
}
use of com.sldeditor.datasource.extension.filesystem.node.database.DatabaseOverallNode in project sldeditor by robward-scisys.
the class DatabaseInput method getRootDatabaseNodes.
/**
* Gets the root database nodes.
*
* @return the list of root database nodes
*/
private Map<String, DatabaseOverallNode> getRootDatabaseNodes() {
if (databaseRootNodeMap == null) {
databaseRootNodeMap = new LinkedHashMap<String, DatabaseOverallNode>();
List<DatabaseOverallNode> list = new ArrayList<DatabaseOverallNode>();
list.add(new DatabaseOverallNode(this, "PostGIS", "ui/filesystemicons/postgresql.png"));
list.add(new DatabaseOverallNode(this, "GeoPackage", "ui/filesystemicons/geopackage.png"));
list.add(new DatabaseOverallNode(this, "SpatiaLite", "ui/filesystemicons/spatialite.png"));
list.add(new DatabaseOverallNode(this, "DB2", "ui/filesystemicons/db2.png"));
list.add(new DatabaseOverallNode(this, "H2", "ui/filesystemicons/h2.png"));
list.add(new DatabaseOverallNode(this, "MySQL", "ui/filesystemicons/mysql.png"));
list.add(new DatabaseOverallNode(this, "Oracle", "ui/filesystemicons/oracle.png"));
list.add(new DatabaseOverallNode(this, "Microsoft SQL Server (JTDS Driver) (JNDI)", "ui/filesystemicons/sqlserver.png"));
list.add(new DatabaseOverallNode(this, "Teradata", "ui/filesystemicons/teradata.png"));
for (DatabaseOverallNode node : list) {
databaseRootNodeMap.put(node.toString(), node);
}
}
return databaseRootNodeMap;
}
use of com.sldeditor.datasource.extension.filesystem.node.database.DatabaseOverallNode in project sldeditor by robward-scisys.
the class DatabaseConnectionListTool 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();
selectedDatabaseType = null;
boolean databaseNodesSelected = false;
boolean canDuplicate = true;
for (NodeInterface nodeType : nodeTypeList) {
if (nodeType instanceof DatabaseNode) {
DatabaseNode databaseNode = (DatabaseNode) nodeType;
DatabaseConnection connection = databaseNode.getConnection();
connectionList.add(connection);
databaseNodesSelected = true;
if (!connection.isSupportsDuplication()) {
canDuplicate = false;
}
} else if (nodeType instanceof DatabaseOverallNode) {
DatabaseOverallNode databaseOverallNode = (DatabaseOverallNode) nodeType;
selectedDatabaseType = databaseOverallNode.toString();
canDuplicate = false;
}
}
btnDuplicate.setEnabled(canDuplicate && databaseNodesSelected && (connectionList.size() == 1));
btnEdit.setEnabled(databaseNodesSelected && (connectionList.size() == 1));
btnDelete.setEnabled(databaseNodesSelected);
}
Aggregations