/** * Adds the given data generator to this listing. If the generator was * already added, does nothing. * * @param generator * the data generator to add, not null */ protected void addDataGenerator(DataGenerator<T> generator) { getDataCommunicator().addDataGenerator(generator); }
/** * Extends a Grid and makes it's rows draggable. * * @param target * Grid to be extended. */ public GridDragSource(Grid<T> target) { super(target); // Create drag data generator dragDataGenerator = this::generateDragData; // Add drag data generator to Grid target.getDataCommunicator().addDataGenerator(dragDataGenerator); generatorFunctions = new HashMap<>(); // Set default generator function for "text" parameter generatorFunctions.put(DragSourceState.DATA_TYPE_TEXT, defaultGridGenerator); }
public DataCommunicator() { addDataGenerator(handler); rpc = getRpcProxy(DataCommunicatorClientRpc.class); registerRpc(createRpc()); keyMapper = createKeyMapper(dataProvider::getId); }