Examples of UILabel


Examples of org.apache.myfaces.tobago.component.UILabel

    super.prepareRender(facesContext, component);

    ComponentUtils.evaluateAutoFor(component);

    // adding the markups from the corresponding input component
    final UILabel label = (UILabel) component;
    final UIComponent corresponding = ComponentUtils.findFor(label);
    if (corresponding != null) {
      Markup markup = label.getCurrentMarkup();
      markup = ComponentUtils.updateMarkup(corresponding, markup);
      label.setCurrentMarkup(markup);
    }
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UILabel

    }
  }

  public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {

    UILabel label = (UILabel) component;
    TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    String forValue = ComponentUtils.findClientIdFor(label, facesContext);

    String clientId = label.getClientId(facesContext);
    writer.startElement(HtmlElements.LABEL, label);
    HtmlRendererUtils.renderDojoDndItem(label, writer, true);
    final Classes classes = Classes.create(label);
    writer.writeClassAttribute(classes);
    writer.writeStyleAttribute(new Style(facesContext, label));
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UILabel

  }

  @Override
  protected void setProperties(final UIComponent uiComponent) {
    super.setProperties(uiComponent);
    final UILabel component = (UILabel) uiComponent;
    final FacesContext context = FacesContext.getCurrentInstance();
    final Application application = context.getApplication();
    if (markup != null) {
      if (!markup.isLiteralText()) {
        component.setValueExpression("markup", markup);
      } else {
        component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
      }
    }
    if (accessKey != null) {
      if (!accessKey.isLiteralText()) {
        component.setValueExpression("accessKey", accessKey);
      } else {
        component.setAccessKey(accessKey.getExpressionString().charAt(0));
      }
    }
    if (forComponent != null) {
      component.setFor(forComponent);
    }

    if (tip != null) {
      component.setValueExpression("tip", tip);
    }

    if (value != null) {
      component.setValueExpression("value", value);
    }

  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UILabel

public class LabelWithAccessKeyUnitTest extends AbstractTobagoTestBase {

  @Test
  public void testSimple() {
    final UILabel component = new UILabel();
    component.setValue("Save");
    final LabelWithAccessKey label = new LabelWithAccessKey(component);
    Assert.assertEquals("Save", label.getLabel());
    Assert.assertEquals(-1, label.getPos());
    Assert.assertEquals(null, label.getAccessKey());
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UILabel

    Assert.assertEquals(null, label.getAccessKey());
  }

  @Test
  public void testWithKeyFirstLetter() {
    final UILabel component = new UILabel();
    component.setValue("Save_");
    final LabelWithAccessKey label = new LabelWithAccessKey(component);
    Assert.assertEquals("Save", label.getLabel());
    Assert.assertEquals(-1, label.getPos());
    Assert.assertNull(label.getAccessKey());
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UILabel

    Assert.assertNull(label.getAccessKey());
  }

  @Test
  public void testWithKeyLastLetter() {
    final UILabel component = new UILabel();
    component.setValue("A__n__a_ly__ze");
    final LabelWithAccessKey label = new LabelWithAccessKey(component);
    Assert.assertEquals("A_n_aly_ze", label.getLabel());
    Assert.assertEquals(5, label.getPos());
    Assert.assertEquals(Character.valueOf('l'), label.getAccessKey());
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UILabel

    Assert.assertEquals(Character.valueOf('l'), label.getAccessKey());
  }

  @Test
  public void testAmpersand() {
    final UILabel component = new UILabel();
    component.setValue("_Save");
    final LabelWithAccessKey label = new LabelWithAccessKey(component);
    Assert.assertEquals("Save", label.getLabel());
    Assert.assertEquals(0, label.getPos());
    Assert.assertEquals(Character.valueOf('s'), label.getAccessKey());
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UILabel

    Assert.assertEquals(Character.valueOf('s'), label.getAccessKey());
  }

  @Test
  public void testAmpersandAtEnd() {
    final UILabel component = new UILabel();
    component.setValue("Save_");
    final LabelWithAccessKey label = new LabelWithAccessKey(component);
    Assert.assertEquals("Save", label.getLabel());
    Assert.assertEquals(-1, label.getPos());
    Assert.assertEquals(null, label.getAccessKey());
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UILabel

  }

  @Test
  public void testUmlauts() {
    // Umlauts are not supported as accessKey
    final UILabel component = new UILabel();
    component.setValue("Löschen");
    final LabelWithAccessKey label = new LabelWithAccessKey(component);
    Assert.assertEquals("Löschen", label.getLabel());
    Assert.assertEquals(-1, label.getPos());
    Assert.assertEquals(null, label.getAccessKey());
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UILabel

  }

  @Test
  public void testUmlauts2() {
    // Umlauts are not supported as accessKey
    final UILabel component = new UILabel();
    component.setValue("L_öschen");
    final LabelWithAccessKey label = new LabelWithAccessKey(component);
    Assert.assertEquals("Löschen", label.getLabel());
    Assert.assertEquals(-1, label.getPos());
    Assert.assertEquals(null, label.getAccessKey());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.