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


Java BaseGridCell类代码示例

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


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

示例1: renderCellWhenCellValueIsInEnumData

import org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell; //导入依赖的package包/类
@Test
public void renderCellWhenCellValueIsInEnumData() {
    setupEnums( "A",
                "A" );
    when( access.isEditable() ).thenReturn( true );

    final GridCell<String> cell = new BaseGridCell<>( new GuidedDecisionTableUiCell<>( "A" ) );

    column.getColumnRenderer().renderCell( cell,
                                           context );

    verify( bodyText,
            times( 1 ) ).setText( eq( "A" ) );
    verify( uiModel,
            never() ).deleteCell( anyInt(),
                                  anyInt() );
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:18,代码来源:BaseEnumSingleSelectUiColumnTest.java

示例2: clearModelWhenCellValueIsNotInEnumData

import org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell; //导入依赖的package包/类
@Test
public void clearModelWhenCellValueIsNotInEnumData() {
    setupEnums( "B",
                "A" );
    when( access.isEditable() ).thenReturn( true );

    final GridCell<String> cell = new BaseGridCell<>( new GuidedDecisionTableUiCell<>( "B" ) );

    column.getColumnRenderer().renderCell( cell,
                                           context );

    verify( bodyText,
            times( 1 ) ).setText( eq( "" ) );
    verify( uiModel,
            times( 1 ) ).deleteCell( anyInt(),
                                     anyInt() );
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:18,代码来源:BaseEnumSingleSelectUiColumnTest.java

示例3: editTrueToFalse

import org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void editTrueToFalse() {
    when( access.isEditable() ).thenReturn( true );
    final GridCell<Boolean> cell = new BaseGridCell<>( new BaseGridCellValue<>( true ) );

    column.edit( cell,
                 context,
                 callback );

    verify( callback,
            times( 1 ) ).callback( callbackArgumentCaptor.capture() );

    final BaseGridCellValue<Boolean> callbackArgument = callbackArgumentCaptor.getValue();
    assertFalse( callbackArgument.getValue() );
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:17,代码来源:BooleanUiColumnTest.java

示例4: editFalseToTrue

import org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void editFalseToTrue() {
    when( access.isEditable() ).thenReturn( true );
    final GridCell<Boolean> cell = new BaseGridCell<>( new BaseGridCellValue<>( false ) );

    column.edit( cell,
                 context,
                 callback );

    verify( callback,
            times( 1 ) ).callback( callbackArgumentCaptor.capture() );

    final BaseGridCellValue<Boolean> callbackArgument = callbackArgumentCaptor.getValue();
    assertTrue( callbackArgument.getValue() );
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:17,代码来源:BooleanUiColumnTest.java

示例5: checkEdit

import org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void checkEdit() {
    final GridCell<String> cell = new BaseGridCell<>(new BaseGridCellValue<>("value"));

    column.edit(cell,
                context,
                result -> {/*Nothing*/});

    verify(factory).attachDomElement(eq(context),
                                     domElementOnCreationCallbackCaptor.capture(),
                                     domElementOnDisplayCallbackCaptor.capture());

    final Callback<D> domElementOnCreationCallback = domElementOnCreationCallbackCaptor.getValue();
    domElementOnCreationCallback.callback(domElement);
    verify(widget).setValue(eq("value"));

    final Callback<D> domElementOnDisplayCallback = domElementOnDisplayCallbackCaptor.getValue();
    domElementOnDisplayCallback.callback(domElement);
    verify(widget).setFocus(eq(true));
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:22,代码来源:BaseDOMElementSingletonColumnTest.java

示例6: checkEditLastRow

import org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void checkEditLastRow() {
    doReturn(0).when(context).getRowIndex();
    model.appendRow(new BaseGridRow());

    final GridCell<String> cell = new BaseGridCell<>(new BaseGridCellValue<>("value"));

    column.edit(cell,
                context,
                result -> {/*Nothing*/});

    verify(factory,
           never()).attachDomElement(any(GridBodyCellRenderContext.class),
                                     any(Callback.class),
                                     any(Callback.class));
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:18,代码来源:NameColumnTest.java

示例7: editTrueToFalse

import org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void editTrueToFalse() {
    final GridCell<Boolean> cell = new BaseGridCell<>(new BaseGridCellValue<>(true));
    column.edit(cell,
                context,
                callback);

    verify(callback,
           times(1)).callback(callbackArgumentCaptor.capture());

    final BaseGridCellValue<Boolean> callbackArgument = callbackArgumentCaptor.getValue();
    assertFalse(callbackArgument.getValue());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:15,代码来源:BooleanDOMElementColumnTest.java

示例8: editFalseToTrue

import org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void editFalseToTrue() {
    final GridCell<Boolean> cell = new BaseGridCell<>(new BaseGridCellValue<>(false));
    column.edit(cell,
                context,
                callback);

    verify(callback,
           times(1)).callback(callbackArgumentCaptor.capture());

    final BaseGridCellValue<Boolean> callbackArgument = callbackArgumentCaptor.getValue();
    assertTrue(callbackArgument.getValue());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:15,代码来源:BooleanDOMElementColumnTest.java

示例9: editReadOnly

import org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void editReadOnly() {
    when( access.isEditable() ).thenReturn( false );
    final GridCell<Boolean> cell = new BaseGridCell<>( new BaseGridCellValue<>( true ) );
    column.edit( cell,
                 context,
                 callback );

    verify( callback,
            never() ).callback( any( BaseGridCellValue.class ) );
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:13,代码来源:BooleanUiColumnTest.java

示例10: testRowNoHigherThanDefault

import org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell; //导入依赖的package包/类
@Test
public void testRowNoHigherThanDefault() throws Exception {
    final DMNGridRow row = Mockito.spy(DMNGridRow.class);
    final Map<Integer, GridCell> cells = new HashMap<Integer, GridCell>() {{
        Mockito.doReturn(DEFAULT_HEIGHT - 1).when(view).getHeight();
        put(0, new BaseGridCell<>(new ExpressionCellValue(Optional.of(view))));
    }};

    Mockito.doReturn(cells).when(row).getCells();
    Assertions.assertThat(row.getHeight()).isBetween(0D, DEFAULT_HEIGHT);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:12,代码来源:DMNGridRowTest.java

示例11: testRowHigherThanDefault

import org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell; //导入依赖的package包/类
@Test
public void testRowHigherThanDefault() throws Exception {
    final DMNGridRow row = Mockito.spy(DMNGridRow.class);
    final Map<Integer, GridCell> cells = new HashMap<Integer, GridCell>() {{
        Mockito.doReturn(DEFAULT_HEIGHT + 1).when(view).getHeight();
        put(0, new BaseGridCell<>(new ExpressionCellValue(Optional.of(view))));
    }};

    Mockito.doReturn(cells).when(row).getCells();
    Assertions.assertThat(row.getHeight()).isGreaterThan(DEFAULT_HEIGHT);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:12,代码来源:DMNGridRowTest.java

示例12: testEditEmptyCell

import org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void testEditEmptyCell() throws Exception {
    relationColumn.edit(new BaseGridCell<>(null), context, callback);
    verify(factory).attachDomElement(eq(context), textAreaDOMElementCallback.capture(), any(Callback.class));
    textAreaDOMElementCallback.getValue().callback(textAreaDOMElement);
    verify(textArea).setValue("");
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:9,代码来源:RelationColumnTest.java

示例13: testEditCell

import org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void testEditCell() throws Exception {
    final String cellValue = "abc";
    relationColumn.edit(new BaseGridCell<>(new BaseGridCellValue<>(cellValue)), context, callback);
    verify(factory).attachDomElement(eq(context), textAreaDOMElementCallback.capture(), any(Callback.class));
    textAreaDOMElementCallback.getValue().callback(textAreaDOMElement);
    verify(textArea).setValue(cellValue);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:10,代码来源:RelationColumnTest.java

示例14: testCenteredText

import org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell; //导入依赖的package包/类
@Test
public void testCenteredText() throws Exception {
    final BaseGridCell<String> cell = new BaseGridCell<>(new BaseGridCellValue<>(VALUE));

    RendererUtils.getCenteredCellText(context, cell);

    verify(text).setText(VALUE);
    verify(text).setListening(false);
    verify(text).setX(WIDTH / 2);
    verify(text).setY(HEIGHT / 2);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:12,代码来源:RendererUtilsTest.java

示例15: testLeftAlignTest

import org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell; //导入依赖的package包/类
@Test
public void testLeftAlignTest() throws Exception {
    final BaseGridCell<String> cell = new BaseGridCell<>(new BaseGridCellValue<>(VALUE));

    RendererUtils.getExpressionCellText(context, cell);

    verify(text).setText(VALUE);
    verify(text).setListening(false);
    verify(text).setX(5);
    verify(text).setY(5);
    verify(text).setFontFamily(BaseExpressionGridTheme.FONT_FAMILY_EXPRESSION);
    verify(text).setTextAlign(TextAlign.LEFT);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:14,代码来源:RendererUtilsTest.java


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