本文整理汇总了Java中org.dashbuilder.displayer.DisplayerSettings.getDataSetLookup方法的典型用法代码示例。如果您正苦于以下问题:Java DisplayerSettings.getDataSetLookup方法的具体用法?Java DisplayerSettings.getDataSetLookup怎么用?Java DisplayerSettings.getDataSetLookup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.dashbuilder.displayer.DisplayerSettings
的用法示例。
在下文中一共展示了DisplayerSettings.getDataSetLookup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toJsonObject
import org.dashbuilder.displayer.DisplayerSettings; //导入方法依赖的package包/类
public JsonObject toJsonObject( DisplayerSettings displayerSettings ) {
JsonObject json = Json.createObject();
// UUID
json.put(SETTINGS_UUID, displayerSettings.getUUID());
for (Map.Entry<String, String> entry : displayerSettings.getSettingsFlatMap().entrySet()) {
setNodeValue(json, entry.getKey(), entry.getValue());
}
// Data set
DataSetLookup dataSetLookup = displayerSettings.getDataSetLookup();
DataSet dataSet = displayerSettings.getDataSet();
if (dataSet != null) {
json.put(DATASET_PREFIX, dataSetJsonMarshaller.toJson(dataSet));
}
else if (dataSetLookup != null) {
json.put(DATASET_LOOKUP_PREFIX, dataSetLookupJsonMarshaller.toJson(dataSetLookup));
}
else {
throw new RuntimeException("Displayer settings dataset lookup not specified");
}
// Column settings
List<ColumnSettings> columnSettingsList = displayerSettings.getColumnSettingsList();
if (!columnSettingsList.isEmpty()) {
json.put(COLUMNS_PREFIX, formatColumnSettings(columnSettingsList));
}
return json;
}
示例2: onDataSetModifiedEvent
import org.dashbuilder.displayer.DisplayerSettings; //导入方法依赖的package包/类
/**
* Listen to modifications on any of the data set being used in this perspective.
*/
private void onDataSetModifiedEvent(@Observes DataSetModifiedEvent event) {
if (!editOn) {
String targetUUID = event.getDataSetDef().getUUID();
for (Displayer displayer : displayerCoordinator.getDisplayerList()) {
DisplayerSettings settings = displayer.getDisplayerSettings();
// Do nothing if the displayer:
// - Is not drawn
// - Is handling the refresh by itself
// - Is not configured to be updated on stale data
if (!displayer.isDrawn() || displayer.isRefreshOn() || !settings.isRefreshStaleData()) {
continue;
}
String uuid = null;
DataSet dataSet = settings.getDataSet();
if (dataSet != null) {
uuid = dataSet.getUUID();
}
DataSetLookup dataSetLookup = settings.getDataSetLookup();
if (uuid == null && dataSetLookup != null) {
uuid = dataSetLookup.getDataSetUUID();
}
if (uuid != null && targetUUID.equals(uuid)) {
displayer.redraw();
}
}
}
}