本文整理汇总了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() );
}
示例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() );
}
示例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() );
}
示例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() );
}
示例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));
}
示例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));
}
示例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());
}
示例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());
}
示例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 ) );
}
示例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);
}
示例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);
}
示例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("");
}
示例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);
}
示例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);
}
示例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);
}