当前位置: 首页>>代码示例>>Java>>正文


Java GridCellValue类代码示例

本文整理汇总了Java中org.uberfire.ext.wires.core.grids.client.model.GridCellValue的典型用法代码示例。如果您正苦于以下问题:Java GridCellValue类的具体用法?Java GridCellValue怎么用?Java GridCellValue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GridCellValue类属于org.uberfire.ext.wires.core.grids.client.model包,在下文中一共展示了GridCellValue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doEdit

import org.uberfire.ext.wires.core.grids.client.model.GridCellValue; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected void doEdit(final GridBodyCellRenderContext context) {
    final int uiRowIndex = context.getRowIndex();
    final int uiColumnIndex = context.getColumnIndex();

    final GridData gridModel = gridWidget.getModel();
    final GridColumn column = gridModel.getColumns().get(uiColumnIndex);
    final GridCell<?> cell = gridModel.getCell(uiRowIndex,
                                               uiColumnIndex);

    column.edit(cell,
                context,
                new Callback<GridCellValue<?>>() {

                    @Override
                    public void callback(final GridCellValue<?> value) {
                        gridModel.setCell(uiRowIndex,
                                          uiColumnIndex,
                                          value);
                        gridWidget.getLayer().batch();
                    }
                });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:BaseCellSelectionManager.java

示例2: setCell

import org.uberfire.ext.wires.core.grids.client.model.GridCellValue; //导入依赖的package包/类
@Override
public void setCell(final GridData.Range rowRange,
                    final int columnIndex,
                    final GridCellValue<?> value) {
    final int minRowIndex = rowRange.getMinRowIndex();
    final int maxRowIndex = rowRange.getMaxRowIndex();
    for (int rowIndex = minRowIndex; rowIndex <= maxRowIndex; rowIndex++) {
        final List<DTCellValue52> modelRow = model.getData().get(rowIndex);
        final DTCellValue52 modelCell = modelRow.get(columnIndex);
        if (value == null) {
            modelCell.clearValues();
        } else {
            modelRow.set(columnIndex,
                         new DTCellValue52(value.getValue()));
        }
    }
    final Set<Integer> columnRange = updateDependentEnumerationColumns(rowRange,
                                                                       columnIndex);
    fireValidateEvent(rowRange,
                      columnRange);
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:22,代码来源:ModelSynchronizerImpl.java

示例3: doEdit

import org.uberfire.ext.wires.core.grids.client.model.GridCellValue; //导入依赖的package包/类
@Override
public void doEdit( final GridCell<String> cell,
                    final GridBodyCellRenderContext context,
                    final Callback<GridCellValue<String>> callback ) {
    factory.attachDomElement( context,
                              new Callback<ListBoxDOMElement<String, ListBox>>() {
                                  @Override
                                  public void callback( final ListBoxDOMElement<String, ListBox> e ) {
                                      final ListBox widget = e.getWidget();
                                      widget.addItem( "java" );
                                      widget.addItem( "mvel" );
                                      factory.toWidget( cell,
                                                        e.getWidget() );
                                  }
                              },
                              CallbackFactory.makeOnDisplayListBoxCallback() );
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:18,代码来源:DialectUiColumn.java

示例4: doEdit

import org.uberfire.ext.wires.core.grids.client.model.GridCellValue; //导入依赖的package包/类
@Override
public void doEdit( final GridCell<String> cell,
                    final GridBodyCellRenderContext context,
                    final Callback<GridCellValue<String>> callback ) {
    factory.attachDomElement( context,
                              new Callback<ListBoxDOMElement<String, ListBox>>() {
                                  @Override
                                  public void callback( final ListBoxDOMElement<String, ListBox> e ) {
                                      final ListBox widget = e.getWidget();
                                      for ( String binding : presenter.getLHSBoundFacts() ) {
                                          widget.addItem( binding );
                                      }
                                      widget.setEnabled( widget.getItemCount() > 0 );
                                      if ( widget.getItemCount() == 0 ) {
                                          widget.addItem( GuidedDecisionTableConstants.INSTANCE.NoPatternBindingsAvailable() );
                                      } else {
                                          factory.toWidget( cell,
                                                            widget );
                                      }
                                  }
                              },
                              CallbackFactory.makeOnDisplayListBoxCallback() );
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:24,代码来源:BoundFactUiColumn.java

示例5: getMinimumWidthOfPeers

import org.uberfire.ext.wires.core.grids.client.model.GridCellValue; //导入依赖的package包/类
private double getMinimumWidthOfPeers() {
    final GridCellTuple parent = ((RelationGrid) gridWidget).getParentInformation();
    final GridData parentUiModel = parent.getGridData();
    final int parentUiRowIndex = parent.getRowIndex();
    final int parentUiColumnIndex = parent.getColumnIndex();

    double minimumWidth = super.getMinimumWidth();

    for (int uiRowIndex = 0; uiRowIndex < parentUiModel.getRowCount(); uiRowIndex++) {
        if (uiRowIndex != parentUiRowIndex) {
            final GridRow row = parentUiModel.getRow(uiRowIndex);
            final GridCell<?> cell = row.getCells().get(parentUiColumnIndex);
            if (cell != null) {
                final GridCellValue<?> value = cell.getValue();
                if (value instanceof ExpressionCellValue) {
                    final ExpressionCellValue ecv = (ExpressionCellValue) value;
                    minimumWidth = Math.max(minimumWidth,
                                            ecv.getMinimumWidth().orElse(0.0) + DMNGridColumn.PADDING * 2);
                }
            }
        }
    }

    return minimumWidth;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:26,代码来源:RelationColumn.java

示例6: toDMNModel

import org.uberfire.ext.wires.core.grids.client.model.GridCellValue; //导入依赖的package包/类
@Override
public void toDMNModel(final int rowIndex,
                       final int columnIndex,
                       final Supplier<Optional<GridCellValue<?>>> cell) {
    dmnModel.get().ifPresent(relation -> {
        final RelationUIModelMapperHelper.RelationSection section = RelationUIModelMapperHelper.getSection(relation, columnIndex);
        switch (section) {
            case ROW_INDEX:
                break;
            case INFORMATION_ITEM:
                final org.kie.workbench.common.dmn.api.definition.v1_1.List row = relation.getRow().get(rowIndex);
                final int iiIndex = RelationUIModelMapperHelper.getInformationItemIndex(relation, columnIndex);
                final Expression e = row.getExpression().get(iiIndex);
                final Optional<Expression> expression = Optional.ofNullable(e);

                expression.ifPresent(ex -> {
                    // Whilst the DMN 1.1 specification allows for ANY expression to be used we have made the simplification
                    // to limit ourselves to LiteralExpressions. Our Grid-system supports ANY (nested) expression too; however
                    // the simplification has been made for the benefit of USERS.
                    final LiteralExpression le = (LiteralExpression) ex;
                    le.setText(cell.get().orElse(new BaseGridCellValue<>("")).getValue().toString());
                });
        }
    });
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:26,代码来源:RelationUIModelMapper.java

示例7: toDMNModel

import org.uberfire.ext.wires.core.grids.client.model.GridCellValue; //导入依赖的package包/类
@Override
public void toDMNModel(final int rowIndex,
                       final int columnIndex,
                       final Supplier<Optional<GridCellValue<?>>> cell) {
    dmnModel.get().ifPresent(dtable -> {
        final DecisionRule rule = dtable.getRule().get(rowIndex);
        final DecisionTableSection section = DecisionTableUIModelMapperHelper.getSection(dtable, columnIndex);
        switch (section) {
            case ROW_INDEX:
                break;
            case INPUT_CLAUSES:
                final int iei = DecisionTableUIModelMapperHelper.getInputEntryIndex(dtable, columnIndex);
                rule.getInputEntry().get(iei).setText(cell.get().orElse(new BaseGridCellValue<>("")).getValue().toString());
                break;
            case OUTPUT_CLAUSES:
                final int oei = DecisionTableUIModelMapperHelper.getOutputEntryIndex(dtable, columnIndex);
                rule.getOutputEntry().get(oei).setText(cell.get().orElse(new BaseGridCellValue<>("")).getValue().toString());
                break;
            case DESCRIPTION:
                rule.getDescription().setValue(cell.get().orElse(new BaseGridCellValue<>("")).getValue().toString());
                break;
        }
    });
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:25,代码来源:DecisionTableUIModelMapper.java

示例8: getMinimumWidth

import org.uberfire.ext.wires.core.grids.client.model.GridCellValue; //导入依赖的package包/类
@Override
public Double getMinimumWidth() {
    double minimumWidth = super.getMinimumWidth();
    final GridData model = gridWidget.getModel();
    final int columnIndex = getLogicalColumnIndex(model);

    if (columnIndex != -1) {
        for (GridRow row : model.getRows()) {
            final GridCell<?> cell = row.getCells().get(columnIndex);
            if (cell != null) {
                final GridCellValue<?> value = cell.getValue();
                if (value instanceof ExpressionCellValue) {
                    final ExpressionCellValue ecv = (ExpressionCellValue) value;
                    minimumWidth = Math.max(minimumWidth,
                                            ecv.getMinimumWidth().orElse(0.0) + DMNGridColumn.PADDING * 2);
                }
            }
        }
    }
    return minimumWidth;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:22,代码来源:ExpressionEditorColumn.java

示例9: updateWidthOfChildren

import org.uberfire.ext.wires.core.grids.client.model.GridCellValue; //导入依赖的package包/类
protected void updateWidthOfChildren() {
    final double columnWidth = getWidth();
    final GridData model = gridWidget.getModel();
    final int columnIndex = getLogicalColumnIndex(model);

    if (columnIndex != -1) {
        for (GridRow row : model.getRows()) {
            final GridCell<?> cell = row.getCells().get(columnIndex);
            if (cell != null) {
                final GridCellValue<?> value = cell.getValue();
                if (value instanceof ExpressionCellValue) {
                    final ExpressionCellValue ecv = (ExpressionCellValue) value;
                    final Optional<BaseExpressionGrid> editor = ecv.getValue();
                    if (editor.isPresent()) {
                        final BaseExpressionGrid beg = editor.get();
                        updateWidthOfLastColumn(beg, columnWidth);
                    }
                }
            }
        }
    }
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:23,代码来源:ExpressionEditorColumn.java

示例10: getRequiredColumnWidth

import org.uberfire.ext.wires.core.grids.client.model.GridCellValue; //导入依赖的package包/类
private double getRequiredColumnWidth() {
    double requiredColumnWidth = DEFAULT_WIDTH;
    final GridData model = gridWidget.getModel();
    final int columnIndex = getLogicalColumnIndex(model);

    if (columnIndex != -1) {
        for (GridRow row : model.getRows()) {
            final GridCell<?> cell = row.getCells().get(columnIndex);
            if (cell != null) {
                final GridCellValue<?> value = cell.getValue();
                if (value instanceof ExpressionCellValue) {
                    final ExpressionCellValue ecv = (ExpressionCellValue) value;
                    final Optional<BaseExpressionGrid> editor = ecv.getValue();
                    if (editor.isPresent()) {
                        final BaseExpressionGrid beg = editor.get();
                        requiredColumnWidth = Math.max(requiredColumnWidth,
                                                       beg.getWidth() + DMNGridColumn.PADDING * 2);
                    }
                }
            }
        }
    }

    return requiredColumnWidth;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:26,代码来源:ExpressionEditorColumn.java

示例11: executeGraphCommand

import org.uberfire.ext.wires.core.grids.client.model.GridCellValue; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void executeGraphCommand() {
    assertEquals(GraphCommandResultBuilder.SUCCESS,
                 command.getGraphCommand(canvasHandler).execute(graphCommandExecutionContext));

    verify(uiModelMapper).toDMNModel(eq(ROW_INDEX),
                                     eq(COLUMN_INDEX),
                                     gridCellValueSupplierCaptor.capture());

    final Supplier<Optional<GridCellValue<?>>> gridCellValueSupplier = gridCellValueSupplierCaptor.getValue();
    assertNotNull(gridCellValueSupplier);

    final Optional<GridCellValue<?>> oGridCellValue = gridCellValueSupplier.get();
    assertFalse(oGridCellValue.isPresent());
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:17,代码来源:DeleteCellValueCommandTest.java

示例12: undoGraphCommand

import org.uberfire.ext.wires.core.grids.client.model.GridCellValue; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void undoGraphCommand() {
    assertEquals(GraphCommandResultBuilder.SUCCESS,
                 command.getGraphCommand(canvasHandler).undo(graphCommandExecutionContext));

    verify(uiModelMapper).toDMNModel(eq(ROW_INDEX),
                                     eq(COLUMN_INDEX),
                                     gridCellValueSupplierCaptor.capture());

    final Supplier<Optional<GridCellValue<?>>> gridCellValueSupplier = gridCellValueSupplierCaptor.getValue();
    assertNotNull(gridCellValueSupplier);

    final Optional<GridCellValue<?>> oGridCellValue = gridCellValueSupplier.get();
    assertTrue(oGridCellValue.isPresent());

    assertEquals(gridCellValue,
                 oGridCellValue.get());
    assertEquals(CELL_VALUE,
                 oGridCellValue.get().getValue());
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:22,代码来源:DeleteCellValueCommandTest.java

示例13: setup

import org.uberfire.ext.wires.core.grids.client.model.GridCellValue; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void setup(final GridCell oldGridCell,
                  final GridCellValue oldGridCellValue,
                  final String oldCellValue) {
    when(gridModel.getCell(ROW_INDEX,
                           COLUMN_INDEX)).thenReturn(oldGridCell);
    if (oldGridCell != null) {
        when(oldGridCell.getValue()).thenReturn(oldGridCellValue);
        if (oldGridCellValue != null) {
            when(oldGridCellValue.getValue()).thenReturn(oldCellValue);
        }
    }
    when(newGridCell.getValue()).thenReturn(newGridCellValue);
    when(newGridCellValue.getValue()).thenReturn(NEW_CELL_VALUE);

    this.command = new SetCellValueCommand(new GridCellValueTuple<>(ROW_INDEX,
                                                                    COLUMN_INDEX,
                                                                    gridModel,
                                                                    newGridCellValue),
                                           () -> uiModelMapper,
                                           gridLayer::batch);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:23,代码来源:SetCellValueCommandTest.java

示例14: assertGraphMutation

import org.uberfire.ext.wires.core.grids.client.model.GridCellValue; //导入依赖的package包/类
private void assertGraphMutation(final GridCellValue gridCellValue,
                                 final String value) {
    verify(uiModelMapper).toDMNModel(eq(ROW_INDEX),
                                     eq(COLUMN_INDEX),
                                     gridCellValueSupplierCaptor.capture());

    final Supplier<Optional<GridCellValue<?>>> gridCellValueSupplier = gridCellValueSupplierCaptor.getValue();
    assertNotNull(gridCellValueSupplier);

    final Optional<GridCellValue<?>> oGridCellValue = gridCellValueSupplier.get();
    assertTrue(oGridCellValue.isPresent());

    assertEquals(gridCellValue,
                 oGridCellValue.get());
    assertEquals(value,
                 oGridCellValue.get().getValue());
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:18,代码来源:SetCellValueCommandTest.java

示例15: checkFlushWithValue

import org.uberfire.ext.wires.core.grids.client.model.GridCellValue; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void checkFlushWithValue() {
    domElement.flush("value");

    verify(sessionCommandManager).execute(eq(canvasHandler),
                                          setCellValueCommandArgumentCaptor.capture());

    final SetCellValueCommand command = setCellValueCommandArgumentCaptor.getValue();
    command.getGraphCommand(canvasHandler).execute(graphCommandExecutionContext);

    verify(uiModelMapper).toDMNModel(eq(0),
                                     eq(1),
                                     valueSupplierArgumentCaptor.capture());

    final Supplier<Optional<GridCellValue<?>>> valueSupplier = valueSupplierArgumentCaptor.getValue();
    assertTrue(valueSupplier.get().isPresent());
    assertEquals("value",
                 valueSupplier.get().get().getValue().toString());
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:21,代码来源:BaseDOMElementTest.java


注:本文中的org.uberfire.ext.wires.core.grids.client.model.GridCellValue类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。