Exemplo n.º 1
0
  @Test
  public void testRenderInitialShowFocusedControl() throws IOException {
    lca.render(sc);

    TestMessage message = Fixture.getProtocolMessage();
    CreateOperation operation = message.findCreateOperation(sc);
    assertFalse(operation.getProperties().names().contains("showFocusedControl"));
  }
Exemplo n.º 2
0
  @Test
  public void testRenderInitialSortDirection() throws IOException {
    lca.render(table);

    TestMessage message = Fixture.getProtocolMessage();
    CreateOperation operation = message.findCreateOperation(table);
    assertFalse(operation.getProperties().names().contains("sortDirection"));
  }
Exemplo n.º 3
0
  @Test
  public void testRenderInitialHeaderWordWrap() throws IOException {
    lca.render(column);

    TestMessage message = Fixture.getProtocolMessage();
    CreateOperation operation = message.findCreateOperation(column);
    assertTrue(operation.getProperties().names().indexOf("headerWordWrap") == -1);
  }
Exemplo n.º 4
0
  @Test
  public void testRenderInitialColumnOrder() throws IOException {
    lca.render(table);

    TestMessage message = Fixture.getProtocolMessage();
    CreateOperation operation = message.findCreateOperation(table);
    assertTrue(operation.getProperties().names().indexOf("columnOrder") == -1);
  }
Exemplo n.º 5
0
  @Test
  public void testRenderInitialScrollLeft() throws IOException {
    getLCA(display).render(display);

    TestMessage message = Fixture.getProtocolMessage();
    CreateOperation operation = message.findCreateOperation(table);
    assertFalse(operation.getProperties().names().contains("scrollLeft"));
  }
Exemplo n.º 6
0
  @Test
  public void testRenderCreate() throws IOException {
    lca.renderInitialization(group);

    TestMessage message = Fixture.getProtocolMessage();
    CreateOperation operation = message.findCreateOperation(group);
    assertEquals("rwt.widgets.Group", operation.getType());
  }
Exemplo n.º 7
0
  @Test
  public void testRenderInitialText() throws IOException {
    lca.render(group);

    TestMessage message = Fixture.getProtocolMessage();
    CreateOperation operation = message.findCreateOperation(group);
    assertFalse(operation.getProperties().names().contains("text"));
  }
Exemplo n.º 8
0
  @Test
  public void testRenderCreate() throws IOException {
    lca.renderInitialization(column);

    TestMessage message = Fixture.getProtocolMessage();
    CreateOperation operation = message.findCreateOperation(column);
    assertEquals("rwt.widgets.GridColumn", operation.getType());
    assertFalse(operation.getProperties().names().contains("group"));
  }
Exemplo n.º 9
0
  @Test
  public void testRenderCreateWithFixedColumns() throws IOException {
    table.setData(RWT.FIXED_COLUMNS, Integer.valueOf(1));

    lca.renderInitialization(table);

    TestMessage message = Fixture.getProtocolMessage();
    CreateOperation operation = message.findCreateOperation(table);
    assertEquals(JsonValue.TRUE, operation.getProperties().get("splitContainer"));
  }
Exemplo n.º 10
0
  @Test
  public void testRenderCreate() throws IOException {
    lca.renderInitialization(sc);

    TestMessage message = Fixture.getProtocolMessage();
    CreateOperation operation = message.findCreateOperation(sc);
    assertEquals("rwt.widgets.ScrolledComposite", operation.getType());
    List<String> styles = getStyles(operation);
    assertTrue(styles.contains("H_SCROLL"));
    assertTrue(styles.contains("V_SCROLL"));
  }
Exemplo n.º 11
0
  @Test
  public void testRenderCreateWithAligment() throws IOException {
    column = new GridColumn(grid, SWT.RIGHT);

    lca.render(column);

    TestMessage message = Fixture.getProtocolMessage();
    CreateOperation operation = message.findCreateOperation(column);
    assertTrue(operation.getProperties().names().indexOf("style") == -1);
    assertEquals("right", message.findCreateProperty(column, "alignment").asString());
  }
Exemplo n.º 12
0
  @Test
  public void testRenderGroup() throws IOException {
    GridColumnGroup group = new GridColumnGroup(grid, SWT.NONE);
    column = new GridColumn(group, SWT.NONE);

    lca.renderInitialization(column);

    TestMessage message = Fixture.getProtocolMessage();
    CreateOperation operation = message.findCreateOperation(column);
    assertEquals(getId(group), operation.getProperties().get("group").asString());
  }
Exemplo n.º 13
0
  @Test
  public void testRenderCreateWithCheck() throws IOException {
    table = new Table(shell, SWT.CHECK);

    lca.renderInitialization(table);

    TestMessage message = Fixture.getProtocolMessage();
    CreateOperation operation = message.findCreateOperation(table);
    assertTrue(getStyles(operation).contains("CHECK"));
    JsonArray expected = JsonArray.readFrom("[4, 21]");
    assertEquals(expected, operation.getProperties().get("checkBoxMetrics"));
  }
Exemplo n.º 14
0
  @Test
  public void testRenderCreate() throws IOException {
    lca.renderInitialization(table);

    TestMessage message = Fixture.getProtocolMessage();
    CreateOperation operation = message.findCreateOperation(table);
    assertEquals("rwt.widgets.Grid", operation.getType());
    assertEquals("table", operation.getProperties().get("appearance").asString());
    assertEquals(0, operation.getProperties().get("indentionWidth").asInt());
    assertEquals(-1, operation.getProperties().get("treeColumn").asInt());
    assertFalse(operation.getProperties().names().contains("checkBoxMetrics"));
    assertEquals(JsonValue.FALSE, operation.getProperties().get("markupEnabled"));
  }