org.drools.guvnor.client.asseteditor.drools.modeldriven.ui.templates
Class TemplateDataCellValueFactory

java.lang.Object
  extended by org.drools.guvnor.client.widgets.drools.decoratedgrid.AbstractCellValueFactory<TemplateDataColumn,String>
      extended by org.drools.guvnor.client.asseteditor.drools.modeldriven.ui.templates.TemplateDataCellValueFactory

public class TemplateDataCellValueFactory
extends AbstractCellValueFactory<TemplateDataColumn,String>

A Factory to create CellValues applicable to given columns.


Field Summary
 
Fields inherited from class org.drools.guvnor.client.widgets.drools.decoratedgrid.AbstractCellValueFactory
DATE_CONVERTOR, sce
 
Constructor Summary
TemplateDataCellValueFactory(org.drools.ide.common.client.modeldriven.SuggestionCompletionEngine sce)
          Construct a Cell Value Factory for a specific Template data editor
 
Method Summary
 List<CellValue<? extends Comparable<?>>> convertColumnData(TemplateDataColumn column, List<String> columnData)
          Convert a column of domain data to that suitable for the UI
 CellValue<? extends Comparable<?>> convertModelCellValue(TemplateDataColumn column, String dcv)
          Convert a Model cell to one that can be used in the UI
 String convertToModelCell(TemplateDataColumn column, CellValue<?> cv)
          Convert a type-safe UI CellValue into a type-safe Model CellValue
protected  org.drools.ide.common.client.modeldriven.dt52.DTDataTypes52 getDataType(TemplateDataColumn column)
          Get the data-type for a column
 List<String> makeColumnData(TemplateDataColumn column)
          Construct a new column of data for the underlying model
 String makeModelCellValue(TemplateDataColumn column)
          Make a Model cell for the given column
 List<String> makeRowData()
          Construct a new row of data for the underlying model
 DynamicDataRow makeUIRowData()
          Construct a new row of data for the MergableGridWidget
 void setModel(org.drools.ide.common.client.modeldriven.brl.templates.TemplateModel model)
          Set the model for which CellValues will be created
 
Methods inherited from class org.drools.guvnor.client.widgets.drools.decoratedgrid.AbstractCellValueFactory
injectDateConvertor, makeNewBooleanCellValue, makeNewBooleanCellValue, makeNewDateCellValue, makeNewDateCellValue, makeNewDialectCellValue, makeNewDialectCellValue, makeNewNumericCellValue, makeNewNumericCellValue, makeNewStringCellValue, makeNewStringCellValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateDataCellValueFactory

public TemplateDataCellValueFactory(org.drools.ide.common.client.modeldriven.SuggestionCompletionEngine sce)
Construct a Cell Value Factory for a specific Template data editor

Parameters:
sce - SuggestionCompletionEngine to assist with drop-downs
Method Detail

setModel

public void setModel(org.drools.ide.common.client.modeldriven.brl.templates.TemplateModel model)
Set the model for which CellValues will be created

Parameters:
model -

makeRowData

public List<String> makeRowData()
Construct a new row of data for the underlying model

Specified by:
makeRowData in class AbstractCellValueFactory<TemplateDataColumn,String>
Returns:

makeUIRowData

public DynamicDataRow makeUIRowData()
Construct a new row of data for the MergableGridWidget

Specified by:
makeUIRowData in class AbstractCellValueFactory<TemplateDataColumn,String>
Parameters:
cell -
Returns:

makeColumnData

public List<String> makeColumnData(TemplateDataColumn column)
Construct a new column of data for the underlying model

Specified by:
makeColumnData in class AbstractCellValueFactory<TemplateDataColumn,String>
Returns:

convertColumnData

public List<CellValue<? extends Comparable<?>>> convertColumnData(TemplateDataColumn column,
                                                                  List<String> columnData)
Convert a column of domain data to that suitable for the UI

Specified by:
convertColumnData in class AbstractCellValueFactory<TemplateDataColumn,String>
Parameters:
column -
columnData -
Returns:

makeModelCellValue

public String makeModelCellValue(TemplateDataColumn column)
Make a Model cell for the given column

Specified by:
makeModelCellValue in class AbstractCellValueFactory<TemplateDataColumn,String>
Parameters:
column -
Returns:

convertModelCellValue

public CellValue<? extends Comparable<?>> convertModelCellValue(TemplateDataColumn column,
                                                                String dcv)
Convert a Model cell to one that can be used in the UI

Specified by:
convertModelCellValue in class AbstractCellValueFactory<TemplateDataColumn,String>
Parameters:
cell -
Returns:

getDataType

protected org.drools.ide.common.client.modeldriven.dt52.DTDataTypes52 getDataType(TemplateDataColumn column)
Description copied from class: AbstractCellValueFactory
Get the data-type for a column

Specified by:
getDataType in class AbstractCellValueFactory<TemplateDataColumn,String>
Returns:

convertToModelCell

public String convertToModelCell(TemplateDataColumn column,
                                 CellValue<?> cv)
Convert a type-safe UI CellValue into a type-safe Model CellValue

Specified by:
convertToModelCell in class AbstractCellValueFactory<TemplateDataColumn,String>
Parameters:
column - Model column from which data-type can be derived
cell - UI CellValue to convert into Model CellValue
Returns:


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.