Search in sources :

Example 1 with SetComponentWidthCommand

use of org.kie.workbench.common.dmn.client.commands.factory.canvas.SetComponentWidthCommand in project kie-wb-common by kiegroup.

the class BaseGrid method registerColumnResizeCompleted.

/**
 * The width of a column is updated dynamically during a resize operation. This registers a {@link Command} on
 * the {@link SessionCommandManager} at the point the column resize operation completed to support "undo'ing"
 * column resize operations.
 * @param uiColumn The column being resized.
 * @param uiColumnInitialWidth The column's initial width when the resize operation started.
 */
public void registerColumnResizeCompleted(final DMNGridColumn uiColumn, final double uiColumnInitialWidth) {
    getCanvasHandler().ifPresent(canvasHandler -> {
        final AbstractCanvasHandler abstractCanvasHandler = (AbstractCanvasHandler) canvasHandler;
        final CanvasCommand<AbstractCanvasHandler> command = new SetComponentWidthCommand(uiColumn, uiColumnInitialWidth, uiColumn.getWidth());
        sessionCommandManager.execute(abstractCanvasHandler, command);
    });
}
Also used : AbstractCanvasHandler(org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler) SetComponentWidthCommand(org.kie.workbench.common.dmn.client.commands.factory.canvas.SetComponentWidthCommand)

Aggregations

SetComponentWidthCommand (org.kie.workbench.common.dmn.client.commands.factory.canvas.SetComponentWidthCommand)1 AbstractCanvasHandler (org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler)1