本文整理匯總了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();
}
}
}
}