Exemple #1
0
  /** Build the static part of the UI. */
  protected void initContent() {

    // Case initiator will not change.
    final String theCaseInitiator = constants.caseStartedBy() + myCase.getStartedBy().getValue();
    final String theProcessDescription = myProcess.getProcessDescription();
    final String theShortDesc;
    if (theProcessDescription.length() > 50) {
      theShortDesc = theProcessDescription.substring(0, 47) + "...";
    } else {
      theShortDesc = theProcessDescription;
    }

    final Grid theWrapper = new Grid(1, 3);
    theWrapper.setHTML(0, 0, theCaseInitiator);
    theWrapper.setHTML(
        0,
        1,
        DateTimeFormat.getFormat(constants.dateShortFormat()).format(myCase.getLastUpdateDate()));
    theWrapper.setHTML(0, 2, theShortDesc);
    myFirstRowPanel.add(theWrapper);
    theWrapper.addStyleName("bos_step_descriptor");

    // Create click handler for user interaction.
    theWrapper.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent anEvent) {
            final Cell theCell = theWrapper.getCellForEvent(anEvent);
            if (theCell != null) {
              toggleOverviewVisibility();
            }
          }
        });
  }
  @Inject
  public TransUnitsTableView(
      FilterViewConfirmationDisplay filterViewConfirmationDisplay, LoadingPanel loadingPanel) {
    this.filterViewConfirmationDisplay = filterViewConfirmationDisplay;
    this.loadingPanel = loadingPanel;
    initWidget(uiBinder.createAndBindUi(this));
    noContentLabel.setText(messages.noContent());
    noContentLabel.setStyleName("gamma");

    transUnitTable.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            HTMLTable.Cell cellForEvent = transUnitTable.getCellForEvent(event);
            if (cellForEvent != null) {
              selectRow(cellForEvent.getRowIndex());
            }
          }
        });
    transUnitTable.resize(0, 2);
    transUnitTable.getColumnFormatter().setWidth(0, "49%");
    transUnitTable.getColumnFormatter().setWidth(1, "51%");
    Window.addResizeHandler(
        new ResizeHandler() {
          @Override
          public void onResize(ResizeEvent event) {
            listener.refreshView();
          }
        });

    transUnitTable.ensureDebugId("transUnitTable");
  }
Exemple #3
0
 /**
  * Creates a grid according to the current row and column count information.
  *
  * @return grid
  */
 private Grid createGrid() {
   grid = new Grid(rows, columns);
   grid.setWidth("100%");
   grid.setHeight("100%");
   grid.addClickHandler(this);
   return grid;
 }