예제 #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();
            }
          }
        });
  }
예제 #2
0
 /** Update the UI. */
 protected void update() {
   // Either the form content is available or it will be computed
   // asynchronously.
   if (isOverviewVisible) {
     // We already have the content to display.
     buildIframeAndInsertIt(myProcess.getApplicationUrl());
   } else {
     mySecondRowPanel.clear();
   }
 }