当前位置: 首页>>代码示例>>Java>>正文


Java DataSetMetadata类代码示例

本文整理汇总了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));
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:GalleryWidgetPresenter.java

示例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();
                                  }
                              });
            }
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:DataSetLookupEditor.java

示例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));
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:25,代码来源:DataSetLookupEditor.java

示例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));
                              }
                          });
        }
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:DataSetLookupEditor.java

示例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);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:25,代码来源:ColumnFunctionEditor.java

示例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);
        }
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:DataSetFilterEditor.java

示例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;
        }
    };
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:DataSetClientServicesTest.java

示例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();
        }
    }
 
开发者ID:kiegroup,项目名称:appformer,代码行数:32,代码来源:DisplayerEditor.java

示例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());
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:12,代码来源:ColumnDetailsEditor.java

示例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();
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:34,代码来源:DataSetClientServices.java

示例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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:14,代码来源:DataSetClientServices.java

示例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));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:9,代码来源:DataSetClientServices.java

示例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();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:10,代码来源:ClientDataSetManager.java

示例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;
            }
        });
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:41,代码来源:DataSetSummary.java

示例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));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:8,代码来源:DataSetDefFilterEditorTest.java


注:本文中的org.dashbuilder.dataset.DataSetMetadata类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。