use of com.sldeditor.common.filesystem.FileSystemInterface in project sldeditor by robward-scisys.
the class GeoServerWorkspaceNodeTest method testGeoServerLayerNode.
/**
* Test method for
* {@link com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerWorkspaceNode#GeoServerStyleNode(com.sldeditor.common.filesystem.FileSystemInterface)}.
*/
@Test
public void testGeoServerLayerNode() {
FileSystemInterface fileHandler = new DummyFileSystemInput();
GeoServerConnection connection = new GeoServerConnection();
connection.setConnectionName("test connection");
connection.setUserName("test user name");
String workspaceName = "workspace";
GeoServerWorkspaceNode node = new GeoServerWorkspaceNode(fileHandler, connection, workspaceName, true);
assertEquals(fileHandler, node.getHandler());
assertEquals(connection, node.getConnection());
assertEquals(workspaceName, node.getWorkspaceName());
assertEquals(DataFlavourManager.GEOSERVER_WORKSPACE_DATAITEM_FLAVOUR, node.getDataFlavour());
assertNull(node.getDestinationText());
}
use of com.sldeditor.common.filesystem.FileSystemInterface in project sldeditor by robward-scisys.
the class GeoServerOverallNodeTest method testGeoServerLayerNode.
/**
* Test method for {@link com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerOverallNode#GeoServerOverallNode(com.sldeditor.common.filesystem.FileSystemInterface)}.
*/
@Test
public void testGeoServerLayerNode() {
FileSystemInterface fileHandler = new DummyFileSystemInput();
GeoServerOverallNode node = new GeoServerOverallNode(fileHandler);
assertEquals(fileHandler, node.getHandler());
assertEquals(BuiltInDataFlavour.GEOSERVER_OVERALL_DATAITEM_FLAVOUR, node.getDataFlavour());
assertNull(node.getDestinationText());
}
use of com.sldeditor.common.filesystem.FileSystemInterface in project sldeditor by robward-scisys.
the class FileSystemExtension method treeItemSelected.
/**
* Called to determine the selected items from the tree nodes selected.
*
* @return the selected files
*/
private SelectedFiles treeItemSelected() {
List<SLDDataInterface> sldDataList = new ArrayList<SLDDataInterface>();
List<NodeInterface> nodeList = new ArrayList<NodeInterface>();
SelectedFiles combinedFiles = new SelectedFiles();
TreePath[] selectedPaths = tree.getSelectionPaths();
if (selectedPaths != null) {
for (TreePath selectedPath : selectedPaths) {
Object o = selectedPath.getLastPathComponent();
if (o instanceof NodeInterface) {
NodeInterface handler = (NodeInterface) o;
FileSystemInterface input = handler.getHandler();
SelectedFiles selectedFiles = input.getSLDContents(handler);
if (selectedFiles != null) {
combinedFiles.setDataSource(selectedFiles.isDataSource());
combinedFiles.setFolderName(selectedFiles.getFolderName());
combinedFiles.setConnectionData(selectedFiles.getConnectionData());
combinedFiles.setIsFolder(combinedFiles.isFolder() | selectedFiles.isFolder());
List<SLDDataInterface> handlerDataList = selectedFiles.getSldData();
if (handlerDataList != null) {
combinedFiles.appendSLDData(handlerDataList);
sldDataList.addAll(handlerDataList);
}
}
nodeList.add(handler);
}
}
}
if (toolMgr != null) {
toolMgr.setSelectedItems(nodeList, sldDataList);
}
return combinedFiles;
}
use of com.sldeditor.common.filesystem.FileSystemInterface in project sldeditor by robward-scisys.
the class GeoServerLayerNodeTest method testGeoServerLayerNode.
/**
* Test method for {@link com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerLayerNode#GeoServerLayerNode(com.sldeditor.common.filesystem.FileSystemInterface, com.sldeditor.common.data.GeoServerLayer)}.
*/
@Test
public void testGeoServerLayerNode() {
FileSystemInterface fileHandler = new DummyFileSystemInput();
GeoServerLayer layer = new GeoServerLayer();
String expectedLayerName = "layer name";
layer.setLayerName(expectedLayerName);
GeoServerLayerNode node = new GeoServerLayerNode(fileHandler, layer);
assertEquals(layer, node.getLayer());
assertEquals(fileHandler, node.getHandler());
assertEquals(BuiltInDataFlavour.GEOSERVER_LAYER_DATAITEM_FLAVOUR, node.getDataFlavour());
assertNull(node.getDestinationText());
}
use of com.sldeditor.common.filesystem.FileSystemInterface in project sldeditor by robward-scisys.
the class GeoServerNodeTest method testGeoServerLayerNode.
/**
* Test method for {@link com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerLayerNode#GeoServerLayerNode(com.sldeditor.common.filesystem.FileSystemInterface, com.sldeditor.common.data.GeoServerLayer)}.
*/
@Test
public void testGeoServerLayerNode() {
FileSystemInterface fileHandler = new DummyFileSystemInput();
GeoServerConnection connection = new GeoServerConnection();
connection.setConnectionName("test connection");
connection.setUserName("test user name");
GeoServerNode node = new GeoServerNode(fileHandler, connection);
assertEquals(connection, node.getConnection());
assertEquals(fileHandler, node.getHandler());
assertEquals(BuiltInDataFlavour.GEOSERVER_DATAITEM_FLAVOUR, node.getDataFlavour());
assertNull(node.getDestinationText());
}
Aggregations