Search in sources :

Example 1 with KeyboardOperationMoveRight

use of org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveRight in project drools-wb by kiegroup.

the class ScenarioGridPanelProducer method initializeGrid.

protected void initializeGrid(ScenarioGridLayer scenarioGridLayer, ScenarioGridPanel scenarioGridPanel, AbstractScesimGridModel abstractScesimGridModel, ScenarioSimulationContext scenarioSimulationContext, int defaultDataCellX, int defaultDataCellY) {
    final ScenarioGrid scenarioGrid = new ScenarioGrid(abstractScesimGridModel, scenarioGridLayer, new ScenarioGridRenderer(false), scenarioContextMenuRegistry);
    scenarioGridLayer.addScenarioGrid(scenarioGrid);
    scenarioGridPanel.add(scenarioGridLayer);
    scenarioGrid.setScenarioSimulationContext(scenarioSimulationContext);
    scenarioGrid.setDefaultSelectedDataCell(defaultDataCellX, defaultDataCellY);
    abstractScesimGridModel.setCollectionEditorSingletonDOMElementFactory(new CollectionEditorSingletonDOMElementFactory(scenarioGridPanel, scenarioGridLayer, scenarioGridLayer.getScenarioGrid(), scenarioSimulationContext, viewsProvider));
    abstractScesimGridModel.setScenarioCellTextAreaSingletonDOMElementFactory(new ScenarioCellTextAreaSingletonDOMElementFactory(scenarioGridPanel, scenarioGridLayer, scenarioGridLayer.getScenarioGrid()));
    abstractScesimGridModel.setScenarioHeaderTextBoxSingletonDOMElementFactory(new ScenarioHeaderTextBoxSingletonDOMElementFactory(scenarioGridPanel, scenarioGridLayer, scenarioGridLayer.getScenarioGrid()));
    abstractScesimGridModel.setScenarioExpressionCellTextAreaSingletonDOMElementFactory(new ScenarioExpressionCellTextAreaSingletonDOMElementFactory(scenarioGridPanel, scenarioGridLayer, scenarioGridLayer.getScenarioGrid()));
    final ScenarioSimulationKeyboardEditHandler scenarioSimulationKeyboardEditHandler = new ScenarioSimulationKeyboardEditHandler(scenarioGridLayer);
    final ScenarioInvokeContextMenuForSelectedCell invokeContextMenuKeyboardOperation = new ScenarioInvokeContextMenuForSelectedCell(scenarioGridLayer, scenarioContextMenuRegistry);
    final BaseGridWidgetKeyboardHandler handler = new BaseGridWidgetKeyboardHandler(scenarioGridLayer);
    handler.addOperation(scenarioSimulationKeyboardEditHandler, new KeyboardOperationSelectTopLeftCell(scenarioGridLayer), new KeyboardOperationMoveLeft(scenarioGridLayer), new KeyboardOperationMoveRight(scenarioGridLayer), new KeyboardOperationMoveUp(scenarioGridLayer), new KeyboardOperationMoveDown(scenarioGridLayer), new KeyboardOperationSelectBottomRightCell(scenarioGridLayer), invokeContextMenuKeyboardOperation);
    scenarioGridPanel.addKeyDownHandler(handler);
    // Hack to enable PINNED MODE i.e. not draggable
    scenarioGridLayer.enterPinnedMode(scenarioGrid, () -> {
    });
}
Also used : ScenarioGridRenderer(org.drools.workbench.screens.scenariosimulation.client.renderers.ScenarioGridRenderer) KeyboardOperationMoveUp(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveUp) BaseGridWidgetKeyboardHandler(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidgetKeyboardHandler) KeyboardOperationMoveDown(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveDown) ScenarioCellTextAreaSingletonDOMElementFactory(org.drools.workbench.screens.scenariosimulation.client.factories.ScenarioCellTextAreaSingletonDOMElementFactory) ScenarioSimulationKeyboardEditHandler(org.drools.workbench.screens.scenariosimulation.client.handlers.ScenarioSimulationKeyboardEditHandler) ScenarioExpressionCellTextAreaSingletonDOMElementFactory(org.drools.workbench.screens.scenariosimulation.client.factories.ScenarioExpressionCellTextAreaSingletonDOMElementFactory) KeyboardOperationMoveRight(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveRight) ScenarioGrid(org.drools.workbench.screens.scenariosimulation.client.widgets.ScenarioGrid) KeyboardOperationSelectBottomRightCell(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationSelectBottomRightCell) KeyboardOperationSelectTopLeftCell(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationSelectTopLeftCell) ScenarioInvokeContextMenuForSelectedCell(org.drools.workbench.screens.scenariosimulation.client.handlers.ScenarioInvokeContextMenuForSelectedCell) ScenarioHeaderTextBoxSingletonDOMElementFactory(org.drools.workbench.screens.scenariosimulation.client.factories.ScenarioHeaderTextBoxSingletonDOMElementFactory) CollectionEditorSingletonDOMElementFactory(org.drools.workbench.screens.scenariosimulation.client.factories.CollectionEditorSingletonDOMElementFactory) KeyboardOperationMoveLeft(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveLeft)

Example 2 with KeyboardOperationMoveRight

use of org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveRight in project kie-wb-common by kiegroup.

the class ExpressionEditorViewImpl method setupGridPanel.

protected void setupGridPanel() {
    final Transform transform = new Transform().scale(VP_SCALE);
    gridPanel.getElement().setId("dmn_container_" + com.google.gwt.dom.client.Document.get().createUniqueId());
    gridPanel.getViewport().setTransform(transform);
    final BaseGridWidgetKeyboardHandler handler = new BaseGridWidgetKeyboardHandler(gridLayer);
    addKeyboardOperation(handler, new KeyboardOperationEditCell(gridLayer));
    addKeyboardOperation(handler, new KeyboardOperationEscapeGridCell(gridLayer));
    addKeyboardOperation(handler, new KeyboardOperationMoveLeft(gridLayer, gridPanel));
    addKeyboardOperation(handler, new KeyboardOperationMoveRight(gridLayer, gridPanel));
    addKeyboardOperation(handler, new KeyboardOperationMoveUp(gridLayer, gridPanel));
    addKeyboardOperation(handler, new KeyboardOperationMoveDown(gridLayer, gridPanel));
    addKeyboardOperation(handler, new KeyboardOperationInvokeContextMenuForSelectedCell(gridLayer));
    gridPanel.addKeyDownHandler(handler);
    gridPanelContainer.clear();
    gridPanelContainer.setWidget(gridPanel);
}
Also used : KeyboardOperationMoveDown(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveDown) KeyboardOperationEditCell(org.kie.workbench.common.dmn.client.widgets.grid.keyboard.KeyboardOperationEditCell) KeyboardOperationMoveRight(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveRight) KeyboardOperationMoveUp(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveUp) BaseGridWidgetKeyboardHandler(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidgetKeyboardHandler) KeyboardOperationInvokeContextMenuForSelectedCell(org.kie.workbench.common.dmn.client.widgets.grid.keyboard.KeyboardOperationInvokeContextMenuForSelectedCell) Transform(com.ait.lienzo.client.core.types.Transform) KeyboardOperationEscapeGridCell(org.kie.workbench.common.dmn.client.widgets.grid.keyboard.KeyboardOperationEscapeGridCell) KeyboardOperationMoveLeft(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveLeft)

Aggregations

BaseGridWidgetKeyboardHandler (org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidgetKeyboardHandler)2 KeyboardOperationMoveDown (org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveDown)2 KeyboardOperationMoveLeft (org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveLeft)2 KeyboardOperationMoveRight (org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveRight)2 KeyboardOperationMoveUp (org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveUp)2 Transform (com.ait.lienzo.client.core.types.Transform)1 CollectionEditorSingletonDOMElementFactory (org.drools.workbench.screens.scenariosimulation.client.factories.CollectionEditorSingletonDOMElementFactory)1 ScenarioCellTextAreaSingletonDOMElementFactory (org.drools.workbench.screens.scenariosimulation.client.factories.ScenarioCellTextAreaSingletonDOMElementFactory)1 ScenarioExpressionCellTextAreaSingletonDOMElementFactory (org.drools.workbench.screens.scenariosimulation.client.factories.ScenarioExpressionCellTextAreaSingletonDOMElementFactory)1 ScenarioHeaderTextBoxSingletonDOMElementFactory (org.drools.workbench.screens.scenariosimulation.client.factories.ScenarioHeaderTextBoxSingletonDOMElementFactory)1 ScenarioInvokeContextMenuForSelectedCell (org.drools.workbench.screens.scenariosimulation.client.handlers.ScenarioInvokeContextMenuForSelectedCell)1 ScenarioSimulationKeyboardEditHandler (org.drools.workbench.screens.scenariosimulation.client.handlers.ScenarioSimulationKeyboardEditHandler)1 ScenarioGridRenderer (org.drools.workbench.screens.scenariosimulation.client.renderers.ScenarioGridRenderer)1 ScenarioGrid (org.drools.workbench.screens.scenariosimulation.client.widgets.ScenarioGrid)1 KeyboardOperationEditCell (org.kie.workbench.common.dmn.client.widgets.grid.keyboard.KeyboardOperationEditCell)1 KeyboardOperationEscapeGridCell (org.kie.workbench.common.dmn.client.widgets.grid.keyboard.KeyboardOperationEscapeGridCell)1 KeyboardOperationInvokeContextMenuForSelectedCell (org.kie.workbench.common.dmn.client.widgets.grid.keyboard.KeyboardOperationInvokeContextMenuForSelectedCell)1 KeyboardOperationSelectBottomRightCell (org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationSelectBottomRightCell)1 KeyboardOperationSelectTopLeftCell (org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationSelectTopLeftCell)1