use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class AbstractLayer method toMap.
@SuppressWarnings("unchecked")
@Override
public MapEx toMap() {
final MapEx map = new LinkedHashMapEx();
addTypeToMap(map, this.type);
addToMap(map, "name", this.name);
addToMap(map, "visible", this.visible);
addToMap(map, "open", this.open);
addToMap(map, "querySupported", this.querySupported);
if (this.querySupported) {
addToMap(map, "queryable", this.queryable);
}
addToMap(map, "readOnly", this.readOnly);
if (!this.readOnly) {
addToMap(map, "editable", this.editable);
}
if (this.selectSupported) {
addToMap(map, "selectable", this.selectable);
}
addToMap(map, "selectSupported", this.selectSupported);
addToMap(map, "maximumScale", this.maximumScale);
addToMap(map, "minimumScale", this.minimumScale);
addToMap(map, "style", this.renderer);
addToMap(map, "pluginConfig", this.pluginConfigByName);
final Map<String, Object> properties = (Map<String, Object>) toMapValue(getProperties());
if (properties != null) {
for (final Entry<String, Object> entry : properties.entrySet()) {
final String name = entry.getKey();
if (!map.containsKey(name) && !name.startsWith("INTERNAL")) {
final Object value = entry.getValue();
if (!(value instanceof Component)) {
map.put(name, value);
}
}
}
}
map.remove("showTableView");
return map;
}
use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class RecordLayerTablePanel method toMap.
@Override
public MapEx toMap() {
final MapEx map = new LinkedHashMapEx();
final String tableRecordsMode = this.tableModel.getTableRecordsMode().getKey();
addToMap(map, "fieldFilterMode", tableRecordsMode);
final String geometryFilterMode = this.tableModel.getGeometryFilterMode();
addToMap(map, "geometryFilterMode", geometryFilterMode);
if (this.fieldFilterPanel != null) {
addToMap(map, "searchField", this.fieldFilterPanel.getSearchFieldName());
}
addToMap(map, "orderBy", this.tableModel.getOrderBy());
return map;
}
use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class UrlUtil method getQueryStringMap.
@SuppressWarnings("unchecked")
public static Map<String, Object> getQueryStringMap(final String queryString) {
final MapEx map = new LinkedHashMapEx();
if (Property.hasValue(queryString)) {
for (final String part : queryString.split("\\&")) {
final int equalsIndex = part.indexOf("=");
if (equalsIndex > -1) {
final String name = part.substring(0, equalsIndex);
final String value = percentDecode(part.substring(equalsIndex + 1).replaceAll("\\+", " "));
if (map.containsKey(name)) {
final Object existingValue = map.get(name);
if (existingValue instanceof List) {
final List<Object> list = (List<Object>) existingValue;
list.add(value);
} else {
final List<Object> list = new ArrayList<>();
list.add(existingValue);
list.add(value);
}
} else {
map.put(name, value);
}
}
}
}
return map;
}
use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class WebServiceConnectionTrees method addWebServiceConnection.
@SuppressWarnings("deprecation")
private static void addWebServiceConnection(final WebServiceConnectionRegistry registry, final String type) {
final ValueField panel = new ValueField();
panel.setTitle("Add Web Service Connection");
Borders.titled(panel, "Web Service Connection");
SwingUtil.addLabel(panel, "Name");
final TextField nameField = new TextField(20);
panel.add(nameField);
SwingUtil.addLabel(panel, "Service URL");
final TextField urlField = new TextField(50);
panel.add(urlField);
SwingUtil.addLabel(panel, "Username");
final TextField usernameField = new TextField(30);
panel.add(usernameField);
SwingUtil.addLabel(panel, "Password");
final PasswordField passwordField = new PasswordField(30);
panel.add(passwordField);
GroupLayouts.makeColumns(panel, 2, true);
panel.showDialog();
if (panel.isSaved()) {
final String url = urlField.getText();
if (url != null) {
final String name = nameField.getText();
final String username = usernameField.getText();
final String password = passwordField.getText();
final MapEx config = new LinkedHashMapEx();
config.put("j:type", type);
config.put("name", name);
config.put("serviceUrl", url);
config.put("username", username);
config.put("password", PasswordUtil.encrypt(password));
registry.newConnection(config);
}
}
}
Aggregations