本文整理匯總了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);
}
}