本文整理了Java中com.bc.ceres.binding.Property.getValueAsText()
方法的一些代码示例,展示了Property.getValueAsText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Property.getValueAsText()
方法的具体详情如下:
包路径:com.bc.ceres.binding.Property
类名称:Property
方法名:getValueAsText
暂无
代码示例来源:origin: bcdev/beam
private static void buildStyleCss(Property strokeProperty, StringBuilder styleCss) {
if (strokeProperty.getValue() != null) {
if (styleCss.length() > 0) {
styleCss.append(";");
}
styleCss.append(strokeProperty.getName()).append(":").append(strokeProperty.getValueAsText());
}
}
代码示例来源:origin: bcdev/beam
private String getParametersText(AggregatorItem ac) {
PropertySet container = ac.aggregatorConfig.asPropertySet();
StringBuilder sb = new StringBuilder();
for (Property property : container.getProperties()) {
String propertyName = property.getName();
if (!(isSourcePropertyName(propertyName) || propertyName.equals("type"))) {
if (sb.length() > 0) {
sb.append("<br/>");
}
sb.append(String.format("%s = %s", propertyName, property.getValueAsText()));
}
}
return "<html>" + sb.toString();
}
}
代码示例来源:origin: senbox-org/snap-desktop
private String getParametersText(AggregatorItem ac) {
PropertySet container = ac.aggregatorConfig.asPropertySet();
StringBuilder sb = new StringBuilder();
for (Property property : container.getProperties()) {
String propertyName = property.getName();
if (!(isSourcePropertyName(propertyName) || propertyName.equals("type"))) {
if (sb.length() > 0) {
sb.append("<br/>");
}
sb.append(String.format("%s = %s", propertyName, property.getValueAsText()));
}
}
return "<html>" + sb.toString();
}
}
代码示例来源:origin: bcdev/beam
private static void validateRoiMaskExpr(Property roiMaskExprProp) throws ValidationException {
final Property roiMaskNameProp = roiMaskExprProp.getContainer().getProperty("roiMaskName");
if (roiMaskNameProp != null && !roiMaskNameProp.getValueAsText().equals("")) {
throw new ValidationException("You cannot specify a ROI-mask expression,\nbecause a ROI-mask is given by its name.\n" +
"Deselect the mask name, if you want to provide your own mask expression.");
}
}
代码示例来源:origin: senbox-org/s2tbx
private boolean isResampleNeeded(Product product) {
boolean needsResampling = false;
if (product != null) {
int sceneWidth = 0;
PropertySet propertySet = this.bindingContext.getPropertySet();
Set<String> setBandNames = this.bandFields.stream()
.map(f -> propertySet.getProperty(f.getName()))
.filter(p -> !StringUtils.isNullOrEmpty(p.getValueAsText()))
.map(Property::getValueAsText)
.collect(Collectors.toSet());
if (setBandNames.size() > 0) {
BitSet bitSet = new BitSet(setBandNames.size());
int idx = 0;
for (String bandName : setBandNames) {
Band band = product.getBand(bandName);
bitSet.set(idx++, sceneWidth != 0 && sceneWidth != band.getRasterWidth());
sceneWidth = band.getRasterWidth();
}
needsResampling = bitSet.nextSetBit(0) != -1;
}
}
return needsResampling;
}
代码示例来源:origin: senbox-org/s2tbx
private boolean isResampleNeeded(Product product) {
boolean needsResampling = false;
if (product != null) {
int sceneWidth = 0;
BindingContext bindingContext = getBindingContext();
PropertySet propertySet = bindingContext.getPropertySet();
Set<String> setBandNames = this.bandFields.stream()
.map(f -> propertySet.getProperty(f.getName()))
.filter(p -> !StringUtils.isNullOrEmpty(p.getValueAsText()))
.map(Property::getValueAsText)
.collect(Collectors.toSet());
if (setBandNames.size() > 0) {
BitSet bitSet = new BitSet(setBandNames.size());
int idx = 0;
for (String bandName : setBandNames) {
Band band = product.getBand(bandName);
bitSet.set(idx++, sceneWidth != 0 && sceneWidth != band.getRasterWidth());
if (band != null) {
sceneWidth = band.getRasterWidth();
}
}
needsResampling = bitSet.nextSetBit(0) != -1;
}
}
return needsResampling;
}
代码示例来源:origin: senbox-org/snap-desktop
@Override
public void update() {
Property property = context.getPropertySet().getProperty(PREFERENCE_KEY_VALIDATE_ON_SAVE);
if (property != null) {
preferences.put(PREFERENCE_KEY_VALIDATE_ON_SAVE, property.getValueAsText());
}
property = context.getPropertySet().getProperty(PREFERENCE_KEY_SHOW_EXECUTION_OUTPUT);
if (property != null) {
preferences.put(PREFERENCE_KEY_SHOW_EXECUTION_OUTPUT, property.getValueAsText());
}
property = context.getPropertySet().getProperty(PREFERENCE_KEY_AUTOCOMPLETE);
if (property != null) {
preferences.put(PREFERENCE_KEY_AUTOCOMPLETE, property.getValueAsText());
}
// decision preferences
property = context.getPropertySet().getProperty(PREFERENCE_KEY_SHOW_EMPTY_PRODUCT_WARNING);
if (property != null) {
if (Boolean.parseBoolean(property.getValueAsText())) {
preferences.remove(PREFERENCE_KEY_SHOW_EMPTY_PRODUCT_WARNING + DECISION_SUFFIX);
} else {
preferences.put(PREFERENCE_KEY_SHOW_EMPTY_PRODUCT_WARNING + DECISION_SUFFIX, "no");
}
}
try {
preferences.flush();
} catch (BackingStoreException ignored) {
}
}
代码示例来源:origin: senbox-org/snap-desktop
@Override
public void update() {
if (isInitialised()) {
for (Property property : bindingContext.getPropertySet().getProperties()) {
String key = property.getDescriptor().getAttribute("key").toString();
String preferencesValue = getPreferences(property.getDescriptor()).get(key, null);
if (preferencesValue != null) {
try {
property.setValueFromText(preferencesValue);
SystemUtils.LOG.fine(String.format("Bean property value change: %s = %s", property.getName(), property.getValueAsText()));
} catch (ValidationException e) {
SystemUtils.LOG.severe("Failed to set bean value from preferences: " + e.getMessage());
}
}
}
}
}
代码示例来源:origin: senbox-org/snap-desktop
@Override
public void applyChanges() {
if (isInitialised()) {
HashSet<Preferences> set = new HashSet<>();
for (Property property : bindingContext.getPropertySet().getProperties()) {
String key = property.getDescriptor().getAttribute("key").toString();
String value = property.getValueAsText();
Preferences preferences = getPreferences(property.getDescriptor());
preferences.put(key, value);
set.add(preferences);
SystemUtils.LOG.fine(String.format("Preferences value change: %s = %s", key, preferences.get(key, null)));
}
for (Preferences preferences : set) {
try {
preferences.flush();
} catch (BackingStoreException e) {
SnapApp.getDefault().handleError("Failed to store user preferences.", e);
}
}
setChanged(false);
}
}
代码示例来源:origin: bcdev/beam
private MetadataElement createMetadataElement(String name, String description, Property[] properties) {
MetadataElement element = new MetadataElement(name);
element.setDescription(description);
for (Property property : properties) {
element.addAttribute(new MetadataAttribute(property.getName(),
ProductData.createInstance(property.getValueAsText()), true));
}
return element;
}
代码示例来源:origin: senbox-org/snap-desktop
Object value = property.getValue();
if (value != null) {
File file = operatorDescriptor.resolveVariables(new File(property.getValueAsText()));
if (!file.isAbsolute()) {
file = new File(operatorDescriptor.getWorkingDir(), file.getAbsolutePath());
代码示例来源:origin: bcdev/beam
final Property[] properties = propertySet.getProperties();
for (final Property property : properties) {
String value = property.getValueAsText();
if (StringUtils.isNotNullAndNotEmpty(value)) {
metaProperties.put("aggregator_config." + Integer.toString(index) + ":" + property.getName(), value);
代码示例来源:origin: senbox-org/snap-desktop
@Override
public void applyChanges() {
if (isInitialised()) {
final BindingContext bindingContext = getBindingContext();
final Property showSuppressedProperty = bindingContext.getPropertySet().getProperty(PREFERENCE_KEY_SHOW_SUPPRESSED);
if (Boolean.parseBoolean(showSuppressedProperty.getValueAsText())) {
final Preferences preferences = SnapApp.getDefault().getPreferences();
try {
final String[] childrenNames = preferences.keys();
for (String childrenName : childrenNames) {
if (childrenName.endsWith(Dialogs.PREF_KEY_SUFFIX_DONTSHOW)) {
preferences.putBoolean(childrenName, false);
}
}
showSuppressedProperty.setValue(Boolean.FALSE);
} catch (BackingStoreException | ValidationException e) {
SnapApp.getDefault().handleError("Failure while resetting suppressed dialogs.", e);
}
}
}
super.applyChanges();
}
内容来源于网络,如有侵权,请联系作者删除!