本文整理汇总了Java中org.dashbuilder.dataset.def.DataSetDef.isAllColumnsEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java DataSetDef.isAllColumnsEnabled方法的具体用法?Java DataSetDef.isAllColumnsEnabled怎么用?Java DataSetDef.isAllColumnsEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.dashbuilder.dataset.def.DataSetDef
的用法示例。
在下文中一共展示了DataSetDef.isAllColumnsEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: load
import org.dashbuilder.dataset.def.DataSetDef; //导入方法依赖的package包/类
@Override
public EditDataSetDef load(Path path) {
try {
DataSetDef def = dataSetDefRegistry.loadDataSetDef(path);
if (def == null) {
return null;
}
// Clone the definition
DataSetDef cloned = def.clone();
// Enable all columns and set columns to null, force to obtain metadata with all original columns
// and all original column types.
boolean clonedAllColumns = cloned.isAllColumnsEnabled();
List<DataColumnDef> clonedColumns = cloned.getColumns();
cloned.setAllColumnsEnabled(true);
cloned.setColumns(null);
// Obtain all original columns and all original column types.
DataSetMetadata _cd = dataSetManager.resolveProvider(cloned)
.getDataSetMetadata(cloned);
// Return the list of original columns and its types.
List<DataColumnDef> columns = new ArrayList<DataColumnDef>();
if (_cd.getNumberOfColumns() > 0) {
for (int x = 0; x < _cd.getNumberOfColumns(); x++) {
String cId = _cd.getColumnId(x);
ColumnType cType = _cd.getColumnType(x);
DataColumnDef cdef = new DataColumnDef(cId, cType);
columns.add(cdef);
}
}
// Set columns attributes as initially were.
cloned.setAllColumnsEnabled(clonedAllColumns);
cloned.setColumns(clonedColumns);
return new EditDataSetDef(cloned, columns);
} catch (Exception e) {
throw exceptionManager.handleException(e);
}
}