Ejemplo n.º 1
0
 @Test
 public void testDefaultAlignment() {
   Label label = new Label("A label");
   TextField tf = new TextField("A TextField");
   gridLayout.addComponent(label);
   gridLayout.addComponent(tf);
   Assert.assertEquals(Alignment.TOP_LEFT, gridLayout.getComponentAlignment(label));
   Assert.assertEquals(Alignment.TOP_LEFT, gridLayout.getComponentAlignment(tf));
 }
Ejemplo n.º 2
0
 @Test
 public void testAlteredDefaultAlignment() {
   Label label = new Label("A label");
   TextField tf = new TextField("A TextField");
   gridLayout.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
   gridLayout.addComponent(label);
   gridLayout.addComponent(tf);
   Assert.assertEquals(Alignment.MIDDLE_CENTER, gridLayout.getComponentAlignment(label));
   Assert.assertEquals(Alignment.MIDDLE_CENTER, gridLayout.getComponentAlignment(tf));
 }