use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.
the class AbstractRecordLayer method toMap.
@Override
public MapEx toMap() {
final MapEx map = super.toMap();
if (!super.isReadOnly()) {
addToMap(map, "canAddRecords", this.canAddRecords);
addToMap(map, "canDeleteRecords", this.canDeleteRecords);
addToMap(map, "canEditRecords", this.canEditRecords);
addToMap(map, "canPasteRecords", this.canPasteRecords);
addToMap(map, "snapToAllLayers", this.snapToAllLayers);
}
addToMap(map, "fieldNamesSetName", this.fieldNamesSetName, ALL);
addToMap(map, "fieldNamesSets", getFieldNamesSets());
addToMap(map, "fieldColumnWidths", getFieldColumnWidths());
addToMap(map, "useFieldTitles", this.useFieldTitles);
map.remove("filter");
String where;
if (Property.isEmpty(this.filter)) {
where = this.where;
} else {
where = this.filter.toFormattedString();
}
if (Property.hasValue(where)) {
final RecordDefinitionSqlFilter filter = new RecordDefinitionSqlFilter(this, where);
addToMap(map, "filter", filter);
}
return map;
}
use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.
the class AbstractTiledLayer method toMap.
@Override
public MapEx toMap() {
final MapEx map = super.toMap();
map.keySet().removeAll(Arrays.asList("readOnly", "querySupported", "selectSupported"));
return map;
}
use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.
the class TextStyle method toMap.
@Override
public MapEx toMap() {
final MapEx map = new LinkedHashMapEx();
for (final String name : PROPERTY_NAMES) {
Object value = Property.get(this, name);
if (value instanceof Color) {
final Color color = (Color) value;
value = WebColors.newAlpha(color, 255);
}
boolean defaultEqual = false;
if (DEFAULT_VALUES.containsKey(name)) {
final Object defaultValue = DEFAULT_VALUES.get(name);
defaultEqual = DataType.equal(defaultValue, value);
}
if (!defaultEqual) {
addToMap(map, name, value);
}
}
return map;
}
use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.
the class TextMarker method toMap.
@Override
public MapEx toMap() {
final MapEx map = super.toMap();
addTypeToMap(map, "markerText");
addToMap(map, "textFaceName", this.textFaceName);
addToMap(map, "text", this.text);
return map;
}
use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.
the class WebServiceConnectionTrees method editConnection.
@SuppressWarnings("deprecation")
private static void editConnection(final WebServiceConnection connection) {
final WebServiceConnectionRegistry registry = connection.getRegistry();
final ValueField panel = new ValueField();
panel.setTitle("Edit Web Service Connection");
Borders.titled(panel, "Web Service Connection");
SwingUtil.addLabel(panel, "Name");
final MapEx config = connection.getConfig();
final String oldName = connection.getName();
final TextField nameField = new TextField("name", oldName, 20);
panel.add(nameField);
SwingUtil.addLabel(panel, "Service URL");
String serviceUrl = config.getString("serviceUrl");
final TextField urlField = new TextField("serviceUrl", serviceUrl, 50);
panel.add(urlField);
SwingUtil.addLabel(panel, "Username");
String username = config.getString("username");
final TextField usernameField = new TextField("username", username, 30);
panel.add(usernameField);
SwingUtil.addLabel(panel, "Password");
String password = PasswordUtil.decrypt(config.getString("password"));
final PasswordField passwordField = new PasswordField("password", password, 30);
panel.add(passwordField);
GroupLayouts.makeColumns(panel, 2, true);
panel.showDialog();
if (panel.isSaved()) {
serviceUrl = urlField.getText();
if (serviceUrl != null) {
final String name = nameField.getText();
username = usernameField.getText();
password = passwordField.getText();
config.put("name", name);
config.put("serviceUrl", serviceUrl);
config.put("username", username);
config.put("password", PasswordUtil.encrypt(password));
if (Strings.equals(oldName, name)) {
connection.setProperties(config);
} else {
registry.removeConnection(connection);
registry.newConnection(config);
}
}
}
}
Aggregations