Example usage for com.google.gwt.user.client.ui Label setDirection

List of usage examples for com.google.gwt.user.client.ui Label setDirection

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui Label setDirection.

Prototype

@Deprecated
public void setDirection(Direction direction) 

Source Link

Document

Sets the widget element's direction.

Usage

From source file:org.freemedsoftware.gwt.client.screen.patient.PrescriptionsScreen.java

License:Open Source License

public PrescriptionsScreen() {
    super(moduleName);
    final FlexTable flexTable = new FlexTable();
    initWidget(flexTable);/*from  w w w  . j a  va2s.  com*/

    final Label dateLabel = new Label(_("Starting Date"));
    flexTable.setWidget(0, 0, dateLabel);
    dateLabel.setDirection(Direction.RTL);

    final Label providerLabel = new Label(_("Provider"));
    flexTable.setWidget(1, 0, providerLabel);
    providerLabel.setDirection(Direction.RTL);

    final Label drugLabel = new Label(_("Drug"));
    flexTable.setWidget(2, 0, drugLabel);
    drugLabel.setDirection(Direction.RTL);

    final Label quantityLabel = new Label(_("Quantity"));
    flexTable.setWidget(3, 0, quantityLabel);
    quantityLabel.setDirection(Direction.RTL);

    final Label intervalLabel = new Label(_("Interval"));
    flexTable.setWidget(4, 0, intervalLabel);
    intervalLabel.setDirection(Direction.RTL);

    final Label substitutionsLabel = new Label(_("Substitutions"));
    flexTable.setWidget(5, 0, substitutionsLabel);
    substitutionsLabel.setDirection(Direction.RTL);

    final Label coverageStatusLabel = new Label(_("Coverage Status"));
    flexTable.setWidget(6, 0, coverageStatusLabel);
    coverageStatusLabel.setDirection(Direction.RTL);

    final Label refillsLabel = new Label(_("Refills"));
    flexTable.setWidget(7, 0, refillsLabel);
    refillsLabel.setDirection(Direction.RTL);

    final Label signatureLabel = new Label(_("Signature"));
    flexTable.setWidget(8, 0, signatureLabel);
    signatureLabel.setDirection(Direction.RTL);

    final Label noteLabel = new Label(_("Note"));
    flexTable.setWidget(9, 0, noteLabel);
    noteLabel.setDirection(Direction.RTL);

    final DateEditFieldWithPicker wDate = new DateEditFieldWithPicker();
    flexTable.setWidget(0, 1, wDate);
    flexTable.getFlexCellFormatter().setColSpan(0, 1, 2);

    flexTable.setWidget(1, 1, wProvider);
    flexTable.getFlexCellFormatter().setColSpan(1, 1, 2);

    flexTable.setWidget(2, 1, wDrug);
    flexTable.getFlexCellFormatter().setColSpan(2, 1, 2);

    flexTable.setWidget(3, 1, wQuantity);
    flexTable.getFlexCellFormatter().setColSpan(3, 1, 2);

    final TextBox wInterval = new TextBox();
    flexTable.setWidget(4, 1, wInterval);
    flexTable.getFlexCellFormatter().setColSpan(4, 1, 2);

    final TextBox wSubstitutions = new TextBox();
    flexTable.setWidget(5, 1, wSubstitutions);
    flexTable.getFlexCellFormatter().setColSpan(5, 1, 2);

    final TextBox wCoverageStatus = new TextBox();
    flexTable.setWidget(6, 1, wCoverageStatus);
    flexTable.getFlexCellFormatter().setColSpan(6, 1, 2);

    final TextBox wRefills = new TextBox();
    flexTable.setWidget(7, 1, wRefills);
    flexTable.getFlexCellFormatter().setColSpan(8, 1, 2);

    final TextBox tSignature = new TextBox();
    flexTable.setWidget(8, 1, tSignature);
    flexTable.getFlexCellFormatter().setColSpan(8, 1, 2);
    tSignature.setWidth("100%");
    flexTable.getFlexCellFormatter().setColSpan(9, 1, 2);

    final CustomButton saveButton = new CustomButton(_("Save"), AppConstants.ICON_ADD);
    flexTable.setWidget(10, 1, saveButton);
    saveButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent w) {
            savePrescription();
        }
    });

    final CustomButton resetButton = new CustomButton(_("Reset"), AppConstants.ICON_CLEAR);
    flexTable.setWidget(10, 2, resetButton);
    resetButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent w) {
            resetForm();
        }
    });
    Util.setFocus(wProvider);
}