本文整理汇总了Java中org.dashbuilder.dataset.def.DataSetDef类的典型用法代码示例。如果您正苦于以下问题:Java DataSetDef类的具体用法?Java DataSetDef怎么用?Java DataSetDef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataSetDef类属于org.dashbuilder.dataset.def包,在下文中一共展示了DataSetDef类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDataSetPushOkEvent
import org.dashbuilder.dataset.def.DataSetDef; //导入依赖的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.def.DataSetDef; //导入依赖的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: showDataSetDefs
import org.dashbuilder.dataset.def.DataSetDef; //导入依赖的package包/类
public void showDataSetDefs(List<DataSetDef> ds) {
_dataSetDefList.clear();
view.clearDataSetSelector();
String selectedUUID = getDataSetUUID();
if (StringUtils.isBlank(selectedUUID)) {
view.enableDataSetSelectorHint();
}
boolean found = false;
for (int i = 0; i < ds.size(); i++) {
DataSetDef def = ds.get(i);
if (dataSetDefFilter.accept(def)) {
addDataSetDef(def);
if (selectedUUID != null && selectedUUID.equals(def.getUUID())) {
view.setSelectedDataSetIndex(i);
found = true;
}
}
}
if (!StringUtils.isBlank(selectedUUID) && !found) {
view.errorDataSetNotFound(selectedUUID);
}
}
示例4: edit
import org.dashbuilder.dataset.def.DataSetDef; //导入依赖的package包/类
private void edit(final DataSet dataset) {
if (dataset != null) {
final DataSetDef dataSetDef = workflow.getDataSetDef();
List<DataColumn> columns = dataset.getColumns();
if (columns != null && !columns.isEmpty()) {
// Obtain all data columns available from the resulting data set.
List<DataColumnDef> columnDefs = new ArrayList<>(columns.size());
for (final DataColumn column : columns) {
columnDefs.add(new DataColumnDef(column.getId(),
column.getColumnType()));
}
edit(dataSetDef,
columnDefs);
} else {
showError("Data set has no columns");
}
} else {
showError("Data set is empty.");
}
}
示例5: save
import org.dashbuilder.dataset.def.DataSetDef; //导入依赖的package包/类
@Override
protected void save() {
workflow.flush();
if (!workflow.hasErrors()) {
savePopUpPresenter.show(versionRecordManager.getCurrentPath(),
commitMessage -> {
final DataSetDef def = getDataSetDef();
services.call(new RemoteCallback<Path>() {
@Override
public void callback(final Path path) {
DataSetDefEditorPresenter.this.getSaveSuccessCallback(getCurrentModelHash()).callback(path);
placeManager.closePlace(DataSetDefEditorPresenter.this.place);
}
},
errorCallback)
.save(def,
commitMessage);
}
);
concurrentUpdateSessionInfo = null;
}
}
示例6: setup
import org.dashbuilder.dataset.def.DataSetDef; //导入依赖的package包/类
@Before
public void setup() throws Exception {
final List<DataSetDef> dataSetDefList = mock(List.class);
when(dataSetDefList.size()).thenReturn(5);
doAnswer(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocationOnMock) throws Throwable {
RemoteCallback<List<DataSetDef>> callback = (RemoteCallback<List<DataSetDef>>) invocationOnMock.getArguments()[0];
callback.callback(dataSetDefList);
return null;
}
}).when(dataSetClientServices).getPublicDataSetDefs(any(RemoteCallback.class));
// The presenter instance to test.
presenter = new DataSetAuthoringHomePresenter(view, placeManager, dataSetClientServices);
}
示例7: testOnErrorEvent
import org.dashbuilder.dataset.def.DataSetDef; //导入依赖的package包/类
@Test
public void testOnErrorEvent() {
ErrorEvent event = mock(ErrorEvent.class);
when(event.getClientRuntimeError()).thenReturn(null);
when(event.getMessage()).thenReturn("errorMessage");
presenter.currentWorkflow = dataSetBasicAttributesWorkflow;
presenter.onErrorEvent(event);
verify(dataSetBasicAttributesWorkflow, times(0)).clear();
verify(dataSetBasicAttributesWorkflow, times(0)).clearButtons();
verify(dataSetBasicAttributesWorkflow, times(0)).showTestButton();
verify(dataSetBasicAttributesWorkflow, times(0)).showNextButton();
verify(dataSetBasicAttributesWorkflow, times(0)).showBackButton();
verify(dataSetBasicAttributesWorkflow, times(0)).edit(any(DataSetDef.class));
verify(errorPopupPresenter, times(1)).showMessage(anyString());
verify(view, times(0)).setWidget(any(IsWidget.class));
}
示例8: setValue
import org.dashbuilder.dataset.def.DataSetDef; //导入依赖的package包/类
@Override
public void setValue(final DataSetDef value) {
checkAvailableColumns();
/*
This editor and sub-editors do not take care about 'allColumnsEnable' flag.
If all column flag is enabled, just add all the available column into the data set definition.
*/
if (value != null && value.isAllColumnsEnabled()) {
final List<DataColumnDef> columns = new ArrayList<DataColumnDef>(acceptableValues.size());
for (final DataColumnDef columnDef : acceptableValues) {
columns.add(columnDef.clone());
}
value.setColumns(columns);
value.setAllColumnsEnabled(false);
}
// Columns edition depends on the data set provider type.
columnListEditor.setProviderType( value != null ? value.getProvider() : null);
}
示例9: testOnDataSetDefRemovedEvent
import org.dashbuilder.dataset.def.DataSetDef; //导入依赖的package包/类
@Test
public void testOnDataSetDefRemovedEvent() {
final DataSetDef removedDataSetDef = mock(DataSetDef.class);
when(removedDataSetDef.getUUID()).thenReturn("removed");
when(removedDataSetDef.getName()).thenReturn("removedDef");
when(removedDataSetDef.isPublic()).thenReturn(true);
when(removedDataSetDef.getProvider()).thenReturn(DataSetProviderType.SQL);
final DataSetDefRemovedEvent event = mock(DataSetDefRemovedEvent.class);
when(event.getDataSetDef()).thenReturn(removedDataSetDef);
presenter.onDataSetDefRemovedEvent(event);
assertEquals(1, presenter.panels.size());
assertEquals(dataSetPanel, presenter.panels.get(0));
verify(view, times(1)).clear();
verify(view, times(1)).addPanel(any(DataSetPanel.View.class));
verify(dataSetPanel, times(1)).show(dataSetDef, "dataSetsExplorerPanelGroup");
}
示例10: testSetValueBeanType
import org.dashbuilder.dataset.def.DataSetDef; //导入依赖的package包/类
@Test
public void testSetValueBeanType() {
final DataSetDef dataSetDef = mock(DataSetDef.class);
when(dataSetDef.getUUID()).thenReturn("uuid1");
when(dataSetDef.getName()).thenReturn("name1");
when(dataSetDef.getProvider()).thenReturn(DataSetProviderType.BEAN);
when(dataSetDef.isAllColumnsEnabled()).thenReturn(false);
presenter.acceptableValues = buildAcceptableValues();
presenter.setValue(dataSetDef);
verify(dataSetDef, times(0)).setColumns(any(List.class));
verify(dataSetDef, times(0)).setAllColumnsEnabled(anyBoolean());
verify(columnListEditor, times(1)).setProviderType(DataSetProviderType.BEAN);
verify(columnListEditor, times(0)).onValueUnRestricted(anyString());
verify(columnListEditor, times(0)).onValueRestricted(anyString());
verify(columnListEditor, times(0)).setAcceptableValues(any(List.class));
}
示例11: testSetValueWithNotAllColumns
import org.dashbuilder.dataset.def.DataSetDef; //导入依赖的package包/类
@Test
public void testSetValueWithNotAllColumns() {
final DataSetDef dataSetDef = mock(DataSetDef.class);
when(dataSetDef.getUUID()).thenReturn("uuid1");
when(dataSetDef.getName()).thenReturn("name1");
when(dataSetDef.getProvider()).thenReturn(DataSetProviderType.SQL);
when(dataSetDef.isAllColumnsEnabled()).thenReturn(false);
presenter.acceptableValues = buildAcceptableValues();
presenter.setValue(dataSetDef);
verify(dataSetDef, times(0)).setColumns(any(List.class));
verify(dataSetDef, times(0)).setAllColumnsEnabled(anyBoolean());
verify(columnListEditor, times(1)).setProviderType(any(DataSetProviderType.class));
verify(columnListEditor, times(0)).onValueUnRestricted(anyString());
verify(columnListEditor, times(0)).onValueRestricted(anyString());
verify(columnListEditor, times(0)).setAcceptableValues(any(List.class));
}
示例12: testSetValueWithAllColumns
import org.dashbuilder.dataset.def.DataSetDef; //导入依赖的package包/类
@Test
public void testSetValueWithAllColumns() {
final DataSetDef dataSetDef = mock(DataSetDef.class);
when(dataSetDef.getUUID()).thenReturn("uuid1");
when(dataSetDef.getName()).thenReturn("name1");
when(dataSetDef.getProvider()).thenReturn(DataSetProviderType.SQL);
when(dataSetDef.isAllColumnsEnabled()).thenReturn(true);
presenter.acceptableValues = buildAcceptableValues();
presenter.setValue(dataSetDef);
verify(dataSetDef, times(1)).setColumns(any(List.class));
verify(dataSetDef, times(1)).setAllColumnsEnabled(false);
verify(columnListEditor, times(1)).setProviderType(any(DataSetProviderType.class));
verify(columnListEditor, times(0)).onValueUnRestricted(anyString());
verify(columnListEditor, times(0)).onValueRestricted(anyString());
verify(columnListEditor, times(0)).setAcceptableValues(any(List.class));
}
示例13: testSetValueEnabled
import org.dashbuilder.dataset.def.DataSetDef; //导入依赖的package包/类
@Test
public void testSetValueEnabled() {
final DataSetDef dataSetDef = mock(DataSetDef.class);
when(dataSetDef.getUUID()).thenReturn("uuid1");
when(dataSetDef.getName()).thenReturn("name1");
when(dataSetDef.getProvider()).thenReturn(DataSetProviderType.SQL);
when(dataSetDef.getRefreshTime()).thenReturn("1 second");
presenter.setValue(dataSetDef);
assertEquals(true, presenter.isRefreshEnabled());
verify(refreshTime, times(1)).setEnabled(true);
verify(refreshAlways, times(1)).setEnabled(true);
verify(view, times(1)).setEnabled(true);
verify(view, times(0)).init(presenter);
verify(view, times(0)).initWidgets(any(IsWidget.class), any(DataSetDefRefreshIntervalEditor.View.class));
verify(view, times(0)).addRefreshEnabledButtonHandler(any(Command.class));
}
示例14: testSetValueDisabled
import org.dashbuilder.dataset.def.DataSetDef; //导入依赖的package包/类
@Test
public void testSetValueDisabled() {
final DataSetDef dataSetDef = mock(DataSetDef.class);
when(dataSetDef.getUUID()).thenReturn("uuid1");
when(dataSetDef.getName()).thenReturn("name1");
when(dataSetDef.getProvider()).thenReturn(DataSetProviderType.SQL);
when(dataSetDef.getRefreshTime()).thenReturn(null);
presenter.setValue(dataSetDef);
assertEquals(false, presenter.isRefreshEnabled());
verify(refreshTime, times(1)).setEnabled(false);
verify(refreshAlways, times(1)).setEnabled(false);
verify(view, times(1)).setEnabled(false);
verify(view, times(0)).init(presenter);
verify(view, times(0)).initWidgets(any(IsWidget.class), any(DataSetDefRefreshIntervalEditor.View.class));
verify(view, times(0)).addRefreshEnabledButtonHandler(any(Command.class));
}
示例15: setup
import org.dashbuilder.dataset.def.DataSetDef; //导入依赖的package包/类
@Before
public void setup() throws Exception {
MockitoAnnotations.initMocks(this);
IsWidget attributesEditor = mock(IsWidget.class);
presenter = new DataSetEditor<DataSetDef>(basicAttributesEditor, attributesEditor, columnsAndFilterEditor,
previewTable, backendCacheAttributesEditor, clientCacheAttributesEditor, refreshEditor, clientServices,
loadingBox, errorEvent, tabChangedEvent, view) {
@Override
public void init() {
super.init();
}
};
when(dataSetDef.getUUID()).thenReturn("uuid1");
when(dataSetDef.getName()).thenReturn("name1");
when(dataSetDef.getProvider()).thenReturn(DataSetProviderType.BEAN);
when(columnsAndFilterEditor.dataSetFilter()).thenReturn(filterEditor);
when(columnsAndFilterEditor.columnListEditor()).thenReturn(columnsEditor);
when(columnsEditor.columns()).thenReturn(columnListEditor);
}