本文整理汇总了Java中org.dashbuilder.dataset.DataSetMetadata类的典型用法代码示例。如果您正苦于以下问题:Java DataSetMetadata类的具体用法?Java DataSetMetadata怎么用?Java DataSetMetadata使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DataSetMetadata类属于org.dashbuilder.dataset包,在下文中一共展示了DataSetMetadata类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDataSetPushOkEvent
import org.dashbuilder.dataset.DataSetMetadata; //导入依赖的package包/类
private void onDataSetPushOkEvent(@Observes DataSetPushOkEvent event) {
checkNotNull("event",
event);
checkNotNull("event",
event.getDataSetMetadata());
DataSetMetadata metadata = event.getDataSetMetadata();
DataSetDef def = metadata.getDefinition();
TimeAmount timeFrame = def.getRefreshTimeAmount();
if (timeFrame == null || timeFrame.toMillis() > 60000) {
int estimazedSizeKbs = event.getDataSetMetadata().getEstimatedSize() / 1000;
workbenchNotification.fire(new NotificationEvent(
AppConstants.INSTANCE.gallerywidget_dataset_loaded(def.getProvider().toString(),
estimazedSizeKbs),
INFO));
}
}
示例2: init
import org.dashbuilder.dataset.DataSetMetadata; //导入依赖的package包/类
public void init(DataSetLookupConstraints lookupConstraints,
final DataSetLookup dataSetLookup) {
this.dataSetLookup = dataSetLookup;
this.lookupConstraints = lookupConstraints;
this.view.clearAll();
this.clientServices.getPublicDataSetDefs(new RemoteCallback<List<DataSetDef>>() {
public void callback(List<DataSetDef> dataSetDefs) {
showDataSetDefs(dataSetDefs);
if (dataSetLookup != null && dataSetLookup.getDataSetUUID() != null) {
fetchMetadata(dataSetLookup.getDataSetUUID(),
new RemoteCallback<DataSetMetadata>() {
public void callback(DataSetMetadata metadata) {
updateDataSetLookup();
}
});
}
}
});
}
示例3: fetchMetadata
import org.dashbuilder.dataset.DataSetMetadata; //导入依赖的package包/类
void fetchMetadata(final String uuid,
final RemoteCallback<DataSetMetadata> callback) {
try {
clientServices.fetchMetadata(uuid,
new DataSetMetadataCallback() {
public void callback(DataSetMetadata metadata) {
dataSetMetadata = metadata;
callback.callback(metadata);
}
public void notFound() {
view.errorDataSetNotFound(uuid);
}
public boolean onError(ClientRuntimeError error) {
view.error(error);
return false;
}
});
} catch (Exception e) {
view.error(new ClientRuntimeError(e));
}
}
示例4: onDataSetSelected
import org.dashbuilder.dataset.DataSetMetadata; //导入依赖的package包/类
void onDataSetSelected() {
String selectedUUID = view.getSelectedDataSetId();
for (DataSetDef dataSetDef : _dataSetDefList) {
if (dataSetDef.getUUID().equals(selectedUUID)) {
fetchMetadata(selectedUUID,
new RemoteCallback<DataSetMetadata>() {
public void callback(DataSetMetadata metadata) {
dataSetLookup = lookupConstraints.newDataSetLookup(metadata);
updateDataSetLookup();
changeEvent.fire(new DataSetLookupChangedEvent(dataSetLookup));
}
});
}
}
}
示例5: init
import org.dashbuilder.dataset.DataSetMetadata; //导入依赖的package包/类
public void init(DataSetMetadata metadata,
GroupFunction groupFunction,
ColumnType targetType,
String columnTitle,
boolean functionsEnabled,
boolean canDelete) {
this.groupFunction = groupFunction;
this.targetType = targetType;
this.metadata = metadata;
this.functionsEnabled = functionsEnabled;
columnDetailsEditor.init(metadata, this.groupFunction);
view.setColumnSelectorTitle(columnTitle);
view.setDeleteOptionEnabled(canDelete);
initColumnListBox();
if (functionsEnabled && (targetType == null || isColumnNumeric())) {
view.setFunctionSelectorEnabled(true);
initFunctionListBox();
} else {
view.setFunctionSelectorEnabled(false);
}
}
示例6: init
import org.dashbuilder.dataset.DataSetMetadata; //导入依赖的package包/类
public void init(DataSetFilter filter, DataSetMetadata metadata) {
this.filter = filter;
this.metadata = metadata;
view.showNewFilterHome();
view.clearColumnSelector();
if (metadata != null) {
for (int i = 0; i < metadata.getNumberOfColumns(); i++) {
view.addColumn(metadata.getColumnId(i));
}
}
view.clearColumnFilterEditors();
if (filter != null) {
for (ColumnFilter columnFilter : filter.getColumnFilterList()) {
ColumnFilterEditor columnFilterEditor = beanManager.lookupBean(ColumnFilterEditor.class).newInstance();
columnFilterEditor.init(metadata, columnFilter);
view.addColumnFilterEditor(columnFilterEditor);
}
}
}
示例7: makeDataSetMetadataCallback
import org.dashbuilder.dataset.DataSetMetadata; //导入依赖的package包/类
private DataSetMetadataCallback makeDataSetMetadataCallback() {
return new DataSetMetadataCallback() {
@Override
public void callback(final DataSetMetadata metadata) {
callbackCalled();
}
@Override
public void notFound() {
notFoundCalled();
}
@Override
public boolean onError(final ClientRuntimeError error) {
onErrorCalled();
return false;
}
};
}
示例8: displayerTypeChanged
import org.dashbuilder.dataset.DataSetMetadata; //导入依赖的package包/类
void displayerTypeChanged(DisplayerType type, DisplayerSubType displayerSubType) {
// Create new settings for the selected type
selectedTypeSettings = displayerPrototypes.getProto(type, displayerSubType);
DataSet oldDataSet = displayerSettings.getDataSet();
DataSetLookup oldDataLookup = displayerSettings.getDataSetLookup();
// Check if the current data lookup is compatible with the new displayer type
if (oldDataSet == null && oldDataLookup != null) {
Displayer displayer = displayerLocator.lookupDisplayer(selectedTypeSettings);
DisplayerConstraints displayerConstraints = displayer.getDisplayerConstraints();
DataSetLookupConstraints dataConstraints = displayerConstraints.getDataSetLookupConstraints();
DataSetMetadata metadata = clientServices.getMetadata(oldDataLookup.getDataSetUUID());
// Keep the current data settings provided it satisfies the data constraints
ValidationError validationError = dataConstraints.check(oldDataLookup, metadata);
if (validationError == null) {
selectedTypeSettings.setDataSet(null);
selectedTypeSettings.setDataSetLookup(oldDataLookup);
applySelectedType();
}
// If the data lookup is not compatible then ask the user what to do
else {
view.showTypeChangedWarning(this::applySelectedType, this::abortSelectedType);
}
}
// If the displayer is static (no data lookup) then just display the selected displayer prototype
else {
applySelectedType();
}
}
示例9: init
import org.dashbuilder.dataset.DataSetMetadata; //导入依赖的package包/类
public void init(DataSetMetadata metadata, GroupFunction groupFunction) {
this.column = groupFunction;
this.metadata = metadata;
if (StringUtils.isBlank(column.getColumnId())) {
view.setColumnId(column.getSourceId());
}
else {
view.setColumnId(column.getColumnId());
}
}
示例10: fetchMetadata
import org.dashbuilder.dataset.DataSetMetadata; //导入依赖的package包/类
/**
* Fetch the metadata instance for the specified data set.
*
* @param uuid The UUID of the data set
* @throws Exception It there is an unexpected error trying to execute the lookup request.
*/
public void fetchMetadata(final String uuid,
final DataSetMetadataCallback listener) throws Exception {
final DataSetMetadata metadata = clientDataSetManager.getDataSetMetadata(uuid);
if (metadata != null) {
listener.callback(metadata);
} else if (dataSetLookupServices != null) {
if (remoteMetadataMap.containsKey(uuid)) {
listener.callback(remoteMetadataMap.get(uuid));
} else {
dataSetLookupServices.call((DataSetMetadata result) -> {
if (result == null) {
listener.notFound();
} else {
remoteMetadataMap.put(uuid,
result);
listener.callback(result);
}
},
(message, throwable) -> {
return listener.onError(new ClientRuntimeError(throwable));
}).lookupDataSetMetadata(uuid);
}
} else {
listener.notFound();
}
}
示例11: getMetadata
import org.dashbuilder.dataset.DataSetMetadata; //导入依赖的package包/类
/**
* Get the cached metadata instance for the specified data set.
*
* @param uuid The UUID of the data set. Null if the metadata is not stored on client yet.
*/
public DataSetMetadata getMetadata(String uuid) {
DataSetMetadata metadata = clientDataSetManager.getDataSetMetadata(uuid);
if (metadata != null) {
return metadata;
}
return remoteMetadataMap.get(uuid);
}
示例12: DataSetPushHandler
import org.dashbuilder.dataset.DataSetMetadata; //导入依赖的package包/类
private DataSetPushHandler(DataSetMetadata metadata) {
this.dataSetMetadata = metadata;
pushRequestMap.put(dataSetMetadata.getUUID(),
this);
dataSetPushingEvent.fire(new DataSetPushingEvent(dataSetMetadata));
}
示例13: getDataSetMetadata
import org.dashbuilder.dataset.DataSetMetadata; //导入依赖的package包/类
@Override
public DataSetMetadata getDataSetMetadata(String uuid) {
DataSetLookup lookup = new DataSetLookup(uuid);
DataSet dataSet = lookupDataSet(lookup);
if (dataSet == null) {
return null;
}
return dataSet.getMetadata();
}
示例14: show
import org.dashbuilder.dataset.DataSetMetadata; //导入依赖的package包/类
public void show(final DataSetDef def) {
if (def != null) {
// Cache status panel.
final boolean isShowBackendCache = def.getProvider() != null
&& ( !DataSetProviderType.BEAN.equals(def.getProvider())
&& !DataSetProviderType.CSV.equals(def.getProvider() ));
final Boolean isCacheEnabled = isShowBackendCache ? def.isCacheEnabled() : null;
final boolean isPushEnabled = def.isPushEnabled();
final boolean isRefreshEnabled = def.getRefreshTime() != null;
view.showStatusPanel(isCacheEnabled, isPushEnabled, isRefreshEnabled);
// Show loading icon on size panel while performing the backend request.
showLoadingIcon();
getMetadata(def, new DataSetMetadataCallback() {
@Override
public void callback(final DataSetMetadata metadata) {
final int estimatedSize = metadata.getEstimatedSize();
final int rowCount = metadata.getNumberOfRows();
view.showSizePanel(humanReadableRowCount(rowCount) + " " + DataSetExplorerConstants.INSTANCE.rows(),
humanReadableByteCount(estimatedSize));
}
@Override
public void notFound() {
showErrorIcon();
showError(def.getUUID(), DataSetExplorerConstants.INSTANCE.notFound());
}
@Override
public boolean onError(final ClientRuntimeError error) {
showErrorIcon();
showError(def.getUUID(), error);
return false;
}
});
}
}
示例15: testSetValue
import org.dashbuilder.dataset.DataSetMetadata; //导入依赖的package包/类
@Test
public void testSetValue() throws Exception {
tested.setValue(filter1);
assertEquals(filter2, tested.value);
verify(view, never()).setWidget(any(IsWidget.class));
verify(dataSetFilterEditor, never()).init(any(DataSetFilter.class), any(DataSetMetadata.class));
}