@Test
  public void testRenderInitialShowFocusedControl() throws IOException {
    lca.render(sc);

    TestMessage message = Fixture.getProtocolMessage();
    CreateOperation operation = message.findCreateOperation(sc);
    assertFalse(operation.getProperties().names().contains("showFocusedControl"));
  }
Beispiel #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"));
  }
Beispiel #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);
  }
Beispiel #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);
  }
Beispiel #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"));
  }
Beispiel #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());
  }
Beispiel #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"));
  }
Beispiel #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"));
  }
Beispiel #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"));
  }
  @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"));
  }
Beispiel #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());
  }
Beispiel #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());
  }
Beispiel #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"));
  }
Beispiel #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"));
  }