當前位置: 首頁>>代碼示例>>Java>>正文


Java DataSetDef類代碼示例

本文整理匯總了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));
    }
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:18,代碼來源:GalleryWidgetPresenter.java

示例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();
                                  }
                              });
            }
        }
    });
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:20,代碼來源:DataSetLookupEditor.java

示例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);
    }
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:26,代碼來源:DataSetLookupEditor.java

示例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.");
    }
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:23,代碼來源:DataSetDefEditorPresenter.java

示例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;
    }
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:23,代碼來源:DataSetDefEditorPresenter.java

示例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);

}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:19,代碼來源:DataSetAuthoringHomePresenterTest.java

示例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));
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:17,代碼來源:DataSetDefWizardScreenTest.java

示例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);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:21,代碼來源:DataSetDefColumnsEditor.java

示例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");
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:17,代碼來源:DataSetExplorerTest.java

示例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));
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:17,代碼來源:DataSetDefColumnsEditorTest.java

示例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));
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:17,代碼來源:DataSetDefColumnsEditorTest.java

示例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));
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:17,代碼來源:DataSetDefColumnsEditorTest.java

示例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));
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:17,代碼來源:DataSetDefRefreshAttributesEditorTest.java

示例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));
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:17,代碼來源:DataSetDefRefreshAttributesEditorTest.java

示例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);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:22,代碼來源:DataSetEditorTest.java


注:本文中的org.dashbuilder.dataset.def.DataSetDef類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。