本文整理汇总了Java中org.dashbuilder.renderer.client.DefaultRenderer类的典型用法代码示例。如果您正苦于以下问题:Java DefaultRenderer类的具体用法?Java DefaultRenderer怎么用?Java DefaultRenderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultRenderer类属于org.dashbuilder.renderer.client包,在下文中一共展示了DefaultRenderer类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAllCommits
import org.dashbuilder.renderer.client.DefaultRenderer; //导入依赖的package包/类
public static DisplayerSettings getAllCommits(ContributorsI18n i18n) {
return DisplayerSettingsFactory.newTableSettings()
.dataset(GIT_CONTRIB)
.column(COLUMN_AUTHOR, i18n.author())
.column(COLUMN_REPO, i18n.repository())
.column(COLUMN_DATE, i18n.date())
.column(COLUMN_MSG, i18n.commit())
.title(i18n.commits())
.titleVisible(false)
.tablePageSize(5)
.tableWidth(950)
.tableOrderEnabled(true)
.renderer(DefaultRenderer.UUID)
.filterOn(true, true, true)
.buildSettings();
}
示例2: clear
import org.dashbuilder.renderer.client.DefaultRenderer; //导入依赖的package包/类
@Override
public void clear() {
super.clear();
htmlPanel = null;
container.clear();
DefaultRenderer.closeDisplayer(uniqueId);
}
示例3: init
import org.dashbuilder.renderer.client.DefaultRenderer; //导入依赖的package包/类
@PostConstruct
public void init() {
// Create the chart definitions
bubbleByCountry = displayerLocator.lookupDisplayer(
DisplayerSettingsFactory.newBubbleChartSettings()
.dataset(SALES_OPPS)
.group(COUNTRY)
.column(COUNTRY, "Country")
.column(COUNT, "count").format(AppConstants.INSTANCE.sales_bycountry_bubble_column1(), "#,##0")
.column(PROBABILITY, AVERAGE).format(AppConstants.INSTANCE.sales_bycountry_bubble_column2(), "#,##0")
.column(COUNTRY, "Country")
.column(EXPECTED_AMOUNT, SUM).expression("value/1000").format(AppConstants.INSTANCE.sales_bycountry_bubble_column3(), "$ #,##0 K")
.title(AppConstants.INSTANCE.sales_bycountry_bubble_title())
.width(450).height(300)
.margins(20, 50, 50, 0)
.filterOn(false, true, true)
.buildSettings());
mapByCountry = displayerLocator.lookupDisplayer(
DisplayerSettingsFactory.newMapChartSettings()
.dataset(SALES_OPPS)
.group(COUNTRY)
.column(COUNTRY, "Country")
.column(COUNT, "Number of opportunities")
.column(EXPECTED_AMOUNT, SUM).expression("value/1000").format(AppConstants.INSTANCE.sales_bycountry_map_column1(), "$ #,##0 K")
.title(AppConstants.INSTANCE.sales_bycountry_map_title())
.width(450).height(290)
.margins(10, 10, 10, 10)
.filterOn(false, true, true)
.buildSettings());
tableAll = displayerLocator.lookupDisplayer(
DisplayerSettingsFactory.newTableSettings()
.dataset(SALES_OPPS)
.title(AppConstants.INSTANCE.sales_bycountry_table_title())
.titleVisible(true)
.tablePageSize(8)
.tableOrderEnabled(true)
.tableOrderDefault(AMOUNT, DESCENDING)
.tableColumnPickerEnabled(false)
.column(COUNTRY, AppConstants.INSTANCE.sales_bycountry_table_column1())
.column(CUSTOMER, AppConstants.INSTANCE.sales_bycountry_table_column2())
.column(PRODUCT, AppConstants.INSTANCE.sales_bycountry_table_column3())
.column(SALES_PERSON, AppConstants.INSTANCE.sales_bycountry_table_column4())
.column(STATUS, AppConstants.INSTANCE.sales_bycountry_table_column5())
.column(CREATION_DATE, AppConstants.INSTANCE.sales_bycountry_table_column6())
.column(EXPECTED_AMOUNT, AppConstants.INSTANCE.sales_bycountry_table_column7())
.column(CLOSING_DATE, AppConstants.INSTANCE.sales_bycountry_table_column8())
.column(AMOUNT).expression("value/1000").format(AppConstants.INSTANCE.sales_bycountry_table_column9(), "$ #,##0 K")
.filterOn(true, true, true)
.tableWidth(900)
.renderer(DefaultRenderer.UUID)
.buildSettings());
// Make that charts interact among them
displayerCoordinator.addDisplayer(bubbleByCountry);
displayerCoordinator.addDisplayer(mapByCountry);
displayerCoordinator.addDisplayer(tableAll);
// Init the dashboard from the UI Binder template
initWidget(uiBinder.createAndBindUi(this));
// Draw the charts
displayerCoordinator.drawAll();
}
示例4: show
import org.dashbuilder.renderer.client.DefaultRenderer; //导入依赖的package包/类
public void show(final DataSetDef dataSetDef, final Collection<DataColumnDef> columns,
final DisplayerListener displayerListener) {
clear();
if (dataSetDef != null) {
// Build the table displayer settings.
final TableDisplayerSettingsBuilder settingsBuilder = DisplayerSettingsFactory.newTableSettings()
.dataset(dataSetDef.getUUID())
.renderer(DefaultRenderer.UUID)
.titleVisible(false)
.tablePageSize(6)
.tableOrderEnabled(true)
.filterOn(true, false, false);
// Make only the specified columns visible (if null then show all)
if (columns != null && !columns.isEmpty()) {
for (final DataColumnDef column : columns) {
settingsBuilder.column(column.getId());
}
}
// Disable backend cache for preview.
DataSetDef editCloneWithoutCacheSettings = dataSetDef.clone();
editCloneWithoutCacheSettings.setCacheEnabled(false);
// Close the current displayer (if any)
if (tableDisplayer != null) {
tableDisplayer.close();
}
// Configure the table displayer and the data set handler for edition.
DisplayerSettings settings = settingsBuilder.buildSettings();
tableDisplayer = displayerLocator.lookupDisplayer(settings);
tableDisplayer.setDataSetHandler(new DataSetEditHandler(clientServices, settings.getDataSetLookup(), editCloneWithoutCacheSettings));
// For CSV datasets, make sure dates & numbers are displayed as defined in the CSV configuration
if (dataSetDef instanceof CSVDataSetDef) {
CSVDataSetDef csvDataSetDef = (CSVDataSetDef) dataSetDef;
tableDisplayer.addListener(new AbstractDisplayerListener() {
// The column settings are set right after the data set load, once the dataset columns are known
@Override
public void onDataLoaded(Displayer displayer) {
configureColumnSettings(displayer, csvDataSetDef);
}
});
}
// Draw the table
draw(displayerListener);
}
}
示例5: getDisplayerSettings
import org.dashbuilder.renderer.client.DefaultRenderer; //导入依赖的package包/类
@Override
public DisplayerSettings getDisplayerSettings(String dataSourceUuid,
String schema,
String table) {
checkNotNull("dataSourceUuid",
dataSourceUuid);
checkNotNull("table",
table);
try {
DataSourceDeploymentInfo deploymentInfo = dataSourceRuntimeManager.getDataSourceDeploymentInfo(dataSourceUuid);
DataSetDef dataSetDef = DataSetDefBuilder.newBuilder()
.dataSetUuid(buildDataSetUuid(dataSourceUuid,
schema,
table))
.dataSetName(buildDataSetName(schema,
table))
.dataSourceUuid(deploymentInfo.getUuid())
.schema(schema)
.table(buildDataSetTableName(dataSourceUuid,
table))
.isPublic(false)
.build();
dataSetDefRegistry.registerDataSetDef(dataSetDef);
DataSetLookup lookup = new DataSetLookup();
lookup.setDataSetUUID(dataSetDef.getUUID());
DataSet dataSet = dataSetManager.lookupDataSet(lookup);
TableDisplayerSettingsBuilder settingsBuilder = DisplayerSettingsFactory.newTableSettings()
.dataset(dataSetDef.getUUID())
.title(table)
.titleVisible(true)
.tablePageSize(20)
.tableOrderEnabled(true);
List<DataColumn> columns = dataSet.getColumns();
for (DataColumn column : columns) {
settingsBuilder.column(column.getId());
}
int tableWith = columns.size() * COLUMN_WIDTH;
settingsBuilder.tableWidth(tableWith);
settingsBuilder.renderer(DefaultRenderer.UUID);
return settingsBuilder.buildSettings();
} catch (Exception e) {
throw new GenericPortableException(e.getMessage());
}
}