Beispiel #1
0
  /*
   * Creates the command bar.
   *
   * @return the command bar.
   */
  private HorizontalPanel createCommands() {
    final HorizontalPanel bar = new HorizontalPanel();
    bar.addStyleName(AbstractField.CSS.cbtAbstractCommand());
    bar.addStyleName(CSS.commandBar());

    LocalRequest cancelRequest =
        new LocalRequest() {
          protected void perform() {
            hide();
            ;
          }
        };

    // -----------------------------------------------
    // Save button
    // -----------------------------------------------
    final CommandButton saveButton =
        new CommandButton(this, AbstractField.CONSTANTS.allSave(), auditUpdate, tab++);
    saveButton.addStyleName(AbstractField.CSS.cbtGradientBlue());
    saveButton.setTitle(CONSTANTS.saveHelp());
    bar.add(saveButton);

    // -----------------------------------------------
    // Delete button
    // -----------------------------------------------
    final CommandButton deleteButton =
        new CommandButton(
            this,
            AccessControl.DELETE_PERMISSION,
            AbstractField.CONSTANTS.allDelete(),
            auditDelete,
            tab++);
    deleteButton.addStyleName(AbstractField.CSS.cbtGradientRed());
    deleteButton.setTitle(AbstractField.CONSTANTS.helpDelete());
    bar.add(deleteButton);

    // -----------------------------------------------
    // Cancel button
    // -----------------------------------------------
    final CommandButton cancelButton =
        new CommandButton(this, AbstractField.CONSTANTS.allCancel(), cancelRequest, tab++);
    cancelButton.addStyleName(AbstractField.CSS.cbtGradientRed());
    cancelButton.setTitle(CONSTANTS.cancelHelp());
    bar.add(cancelButton);

    // -----------------------------------------------
    // Transition array to define the finite state machine
    // -----------------------------------------------
    fsm = new ArrayList<Transition>();
    fsm.add(new Transition(Audit.INITIAL, saveButton, Audit.CREATED));
    fsm.add(new Transition(Audit.INITIAL, cancelButton, Audit.CREATED));

    fsm.add(new Transition(Audit.CREATED, saveButton, Audit.CREATED));
    fsm.add(new Transition(Audit.CREATED, deleteButton, Audit.FINAL));
    return bar;
  }
  public ActionRetractFactWidget(RuleModeller modeller, ActionRetractFact model, Boolean readOnly) {
    super(modeller);
    HorizontalPanel layout = new HorizontalPanel();
    layout.setWidth("100%");
    layout.setStyleName("model-builderInner-Background");

    if (readOnly == null) {
      this.readOnly =
          !modeller
              .getSuggestionCompletions()
              .containsFactType(modeller.getModel().getLHSBindingType(model.variableName));
    } else {
      this.readOnly = readOnly;
    }

    if (this.readOnly) {
      layout.addStyleName("editor-disabled-widget");
    }

    String desc =
        modeller.getModel().getLHSBindingType(model.variableName) + " [" + model.variableName + "]";
    layout.add(
        new SmallLabel(
            HumanReadable.getActionDisplayName("retract") + "&nbsp;<b>" + desc + "</b>"));

    // This widget couldn't be modified.
    this.setModified(false);

    initWidget(layout);
  }
    /*
     * (non-Javadoc)
     *
     * @seecom.google.gwt.widgetideas.table.client.filter.ColumnFilter#
     * createFilterWidget()
     */
    public Widget createFilterWidget() {
      filterTextBox = new TextBox();
      filterTextBox.addStyleName("textBox");
      filterTextBox.addKeyboardListener(
          new KeyboardListener() {
            public void onKeyDown(Widget sender, char keyCode, int modifiers) {}

            public void onKeyPress(Widget sender, char keyCode, int modifiers) {}

            public void onKeyUp(Widget sender, char keyCode, int modifiers) {
              fireColumnFilterChanged(
                  new TextColumnFilterInfo(getColumn(), filterTextBox.getText(), operator));
            }
          });
      if (supportedOperators.length > 1) {
        operatorButton = new PushButton();
        setButtonText(operatorButton, operator);
        operatorButton.addClickListener(clickListener);
        operatorButton.addStyleName("operatorButton");
        HorizontalPanel horizontalPanel = new HorizontalPanel();
        horizontalPanel.addStyleName("columnTextFilter");
        horizontalPanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
        horizontalPanel.add(operatorButton);
        horizontalPanel.add(filterTextBox);
        horizontalPanel.setCellWidth(operatorButton, "30px");
        horizontalPanel.setCellWidth(filterTextBox, "100%");
        horizontalPanel.setSpacing(2);
        return horizontalPanel;
      } else {
        return filterTextBox;
      }
    }
  public FolderSelectionWidget(
      final Map<String, String> batchClassesNameMap, final HandlerManager eventBus) {
    super();
    initWidget(BINDER.createAndBindUi(this));
    mainPanel.addStyleName(FolderManagementConstants.OPTIONS_BOX);
    batchClassSelectionListBox.setWidth(_150PX);
    batchClassSelectionListBox.addStyleName(FolderManagementConstants.CUSTOM_LIST_BOX);
    if (null != batchClassesNameMap && !batchClassesNameMap.isEmpty()) {
      Set<Entry<String, String>> entrySet = batchClassesNameMap.entrySet();
      for (Entry<String, String> entry : entrySet) {
        batchClassSelectionListBox.addItem(entry.getKey());
      }
      fireEventForFolderSelection(batchClassesNameMap, eventBus);
      batchClassSelectionListBox.addChangeHandler(
          new ChangeHandler() {

            @Override
            public void onChange(ChangeEvent event) {
              fireEventForFolderSelection(batchClassesNameMap, eventBus);
            }
          });
    } else {
      eventBus.fireEvent(new BatchClassChangeEvent());
    }
  }
  public SPDetailsReviewAnamnesisSubViewImpl() {

    spDetailsReviewAnamnesisSubViewImpl = this;
    initWidget(uiBinder.createAndBindUi(this));

    horizontalanamnesisPanel.addStyleName("horizontalPanelStyle");
    horizontalanamnesisPanel.add(anamnesisTabs);
  }
 private void showMailList(List<StickMail> mails) {
   resultsPanel.clear();
   if (mails == null || mails.size() == 0) {
     Label noMailsLbl = new Label("You have no scheduled mails.");
     noMailsLbl.addStyleName("ui-nomails");
     resultsPanel.add(noMailsLbl);
     return;
   }
   deleteBtn.setVisible(true);
   SimpleContainer list = new SimpleContainer();
   for (final StickMail mail : mails) {
     HorizontalPanel row = new HorizontalPanel();
     row.addStyleName("ui-row");
     list.add(row);
     PhCheckBox check = new PhCheckBox();
     check.addValueChangeHandler(
         new ValueChangeHandler<Boolean>() {
           public void onValueChange(ValueChangeEvent<Boolean> event) {
             if (!scrollInProgress) {
               if (event.getValue()) {
                 checkedMails.add(mail);
               } else {
                 checkedMails.remove(mail);
               }
             }
           }
         });
     row.add(check);
     TouchHTML mailHtml =
         new TouchHTML(
             "<p class='ui-row-subject'>"
                 + mail.getSubject()
                 + "</p><p class='ui-row-scheduled'>"
                 + GwtUtils.dateToString(mail.getScheduled(), "dd/MM/yyyy HH:mm")
                 + "</p>");
     row.add(mailHtml);
     mailHtml.addTouchEndHandler(
         new TouchEndHandler() {
           public void onTouchEnd(TouchEndEvent event) {
             if (!scrollInProgress) {
               //          PhonegapUtils.log("selected " + mail);
             }
           }
         });
   }
   resultsPanel.add(list);
   TouchUtils.applyFocusPatch();
   GwtUtils.deferredExecution(
       500,
       new Delegate<Void>() {
         public void execute(Void element) {
           resultsPanel.setHeight(
               "" + (Window.getClientHeight() - resultsPanel.getAbsoluteTop()) + "px");
         }
       });
 }
 public MenuSectionController() {
   super();
   List<View> list = new ArrayList<View>();
   menuViewMap.put("", list);
   menu.setStyleName("ks-menu-layout-menu");
   rightPanel.setStyleName("ks-menu-layout-rightColumn");
   collapsablePanel.addStyleName("ks-menu-layout-leftColumn");
   layout.addStyleName("ks-menu-layout");
   menu.setTopLevelItems(topLevelMenuItems);
   collapsablePanel.setContent(leftPanel);
   leftPanel.add(menu);
   leftPanel.add(sideBar);
   rightPanel.add(header);
   rightPanel.add(infoPanel);
   rightPanel.add(topButtonPanel);
   rightPanel.add(contentPanel);
   rightPanel.add(bottomButtonPanel);
   layout.add(collapsablePanel);
   layout.add(rightPanel);
   header.setVisible(false);
   this.showPrint(true);
   this.initWidget(layout);
 }
  private void createGUI() {

    setGlassEnabled(true);
    addStyleName("DialogBox");

    btnOK = new Button();
    btnOK.addClickHandler(this);

    btnCancel = new Button();
    btnCancel.addClickHandler(this);
    btnCancel.addStyleName("cancelBtn");

    buttonPanel = new FlowPanel();
    buttonPanel.addStyleName("DialogButtonPanel");

    messagePanel = new HorizontalPanel();
    messagePanel.addStyleName("Dialog-messagePanel");
    messagePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    messageTextPanel = new VerticalPanel();

    mainPanel = new FlowPanel();
    mainPanel.addStyleName("Dialog-content");
  }
Beispiel #9
0
  /**
   * Creates a header with the specified appearance.
   *
   * @param appearance the appearance of the header
   */
  public Header(HeaderAppearance appearance) {
    this.appearance = appearance;

    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    this.appearance.render(sb);

    setElement((Element) XDOM.create(sb.toSafeHtml()));

    addStyleName("x-small-editor");

    widgetPanel = new HorizontalPanel();
    widgetPanel.addStyleName("x-panel-toolbar");

    XElement barElem = appearance.getBarElem(getElement());
    barElem.appendChild(widgetPanel.getElement());

    if (tools.size() > 0) {
      for (int i = 0; i < tools.size(); i++) {
        widgetPanel.add(tools.get(i));
      }
    } else {
      widgetPanel.setVisible(false);
    }

    ComponentHelper.setParent(this, widgetPanel);

    appearance.getTextElem(getElement()).setId(getId() + "-label");

    setText(text);

    if (icon != null) {
      setIcon(icon);
    }

    getFocusSupport().setIgnore(true);
  }
  private void drawLoginInputs() {

    // default
    tbConsumerSecret.setVisible(true);
    tbConsumerSecretPass.setVisible(false);

    // reset ui
    pUi.clear();

    cbRemberMe.setText("Remember Me");

    hAccountCreate = new Hyperlink("Create Account", "account_Create");

    tbConsumerKey.setTitle(inputLabel_ConsumerKey);
    tbConsumerSecret.setTitle(inputLabel_consumerSecret);
    tbConsumerSecretPass.setTitle(inputLabel_consumerSecret);

    // hide loading by default
    hideLoading();

    // main login inputs
    HorizontalPanel ploginItems = new HorizontalPanel();
    ploginItems.setWidth("100%");
    ploginItems.add(tbConsumerKey);
    ploginItems.add(tbConsumerSecret);
    ploginItems.add(tbConsumerSecretPass);
    ploginItems.add(bLogin);

    // login options
    HorizontalPanel pOptions = new HorizontalPanel();
    // pOptions.setSpacing(4);
    pOptions.add(cbRemberMe);
    pOptions.add(hForgotPassword);
    pOptions.add(hAccountCreate);

    VerticalPanel vp = new VerticalPanel();
    vp.setWidth("100%");
    vp.add(ploginItems);
    vp.add(pOptions);

    // TODO - move this to a floating overlay
    vp.add(pError);

    pUi.add(vp);

    drawInputLabel_key();
    drawInputLabel_secret();

    tbConsumerKey.addStyleName("login-Ui-InputConsumerKey");
    tbConsumerSecret.addStyleName("login-Ui-InputConsumerSecret");
    tbConsumerSecretPass.addStyleName("login-Ui-InputConsumerSecret");
    pOptions.setCellHorizontalAlignment(hForgotPassword, HorizontalPanel.ALIGN_RIGHT);
    pOptions.setCellHorizontalAlignment(hAccountCreate, HorizontalPanel.ALIGN_RIGHT);
    pOptions.setCellVerticalAlignment(hForgotPassword, VerticalPanel.ALIGN_BOTTOM);
    pOptions.setCellVerticalAlignment(hAccountCreate, VerticalPanel.ALIGN_BOTTOM);
    pOptions.addStyleName("login-Ui-InputOptions");
    pOptions.setWidth("100%");

    // vp.addStyleName("test1");
    // pOptions.addStyleName("test2");
  }
Beispiel #11
0
  private void loadStockWatcher() {
    // Set up sign out hyperlink.
    signOutLink.setHref(loginInfo.getLogoutUrl());

    // Create table for tasks.
    tasksFlexTable.setText(0, 0, "Tâche");
    tasksFlexTable.setText(0, 1, "DeadLine");
    tasksFlexTable.setText(0, 2, "Priorité");
    tasksFlexTable.setText(0, 3, "Remove");

    // Add styles to elements in the stock list table.
    tasksFlexTable.getRowFormatter().addStyleName(0, "watchListHeader");
    tasksFlexTable.addStyleName("watchList");
    tasksFlexTable.getCellFormatter().addStyleName(0, 1, "watchListNumericColumn");
    tasksFlexTable.getCellFormatter().addStyleName(0, 2, "watchListNumericColumn");
    tasksFlexTable.getCellFormatter().addStyleName(0, 3, "watchListRemoveColumn");

    loadStocks();

    // Assemble Add Task panel.
    addPanel.add(newTaskTextBox);
    addPanel.add(addTaskButton);
    addPanel.addStyleName("addPanel");

    // Assemble Main panel.
    errorMsgLabel.setStyleName("errorMessage");
    errorMsgLabel.setVisible(false);

    mainPanel.add(errorMsgLabel);
    mainPanel.add(signOutLink);
    mainPanel.add(tasksFlexTable);
    mainPanel.add(addPanel);
    mainPanel.add(lastUpdatedLabel);

    // Associate the Main panel with the HTML host page.
    RootPanel.get("tasksList").add(mainPanel);

    // Move cursor focus to the input box.
    newTaskTextBox.setFocus(true);

    // Setup timer to refresh list automatically.
    Timer refreshTimer =
        new Timer() {
          @Override
          public void run() {
            refreshWatchList();
          }
        };
    refreshTimer.scheduleRepeating(REFRESH_INTERVAL);

    // Listen for mouse events on the Add button.
    addTaskButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            addTask();
          }
        });

    // Listen for keyboard events in the input box.
    newTaskTextBox.addKeyPressHandler(
        new KeyPressHandler() {
          public void onKeyPress(KeyPressEvent event) {
            if (event.getCharCode() == KeyCodes.KEY_ENTER) {
              addTask();
            }
          }
        });
  }
  public CriterionHeader(int idx, int cid, String cdesc, float b, int regrid, int regraccepted) {
    this.mainPanel = new VerticalPanel();
    this.mainPanel.addStyleName(Resources.INSTANCE.css().criterionrow());
    this.criterionId = cid;
    this.criterionDescription = cdesc;
    this.index = idx;

    Label lbl = new Label(cdesc);
    lbl.addStyleName(Resources.INSTANCE.css().criterionheader());
    lbl.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            if (commentId > 0 && commentPage > 0)
              EMarkingWeb.markingInterface
                  .getMarkingPagesInterface()
                  .highlightRubricMark(commentId, commentPage);
          }
        });
    mainPanel.add(lbl);

    HorizontalPanel horizontal = new HorizontalPanel();
    horizontal.addStyleName(Resources.INSTANCE.css().colorsquaretable());

    // the square with the color
    if (EMarkingConfiguration.isColoredRubric()) {
      Label lbl2 = new Label("");
      Color.setWidgetBackgroundHueColor(cid, lbl2);
      lbl2.addStyleName(Resources.INSTANCE.css().colorsquare());
      lbl2.setTitle(String.valueOf(idx));
      // lbl2.addStyleName(MarkingInterface.getMapCss().get("colorsquare"));

      // HTML rectangle = new HTML();
      // rectangle.setHTML("<div data-index='"+idx+"' style='width:20px;	height:20px;border:1px
      // solid #000;' class='"+ MarkingInterface.getMapCss().get("color"+idx) +"
      // "+MarkingInterface.getMapCss().get("colorsquare") + "' ></div>");
      lbl2.addClickHandler(
          new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
              Label rectangle = (Label) event.getSource();
              int index = Integer.parseInt(rectangle.getTitle());
              EMarkingWeb.markingInterface
                  .getToolbar()
                  .getMarkingButtons()
                  .changeCriterionList(index);
            }
          });
      horizontal.add(lbl2);
    }

    HTML separation = new HTML();
    separation.setHTML("<div style='width:20px;height:20px;'></div>");
    horizontal.add(separation);

    mainPanel.add(horizontal);

    bonusHtml = new HTML();
    setBonus(b);

    mainPanel.add(bonusHtml);

    regradeHtml = new HTML();
    regradeHtml.setVisible(false);

    mainPanel.add(regradeHtml);

    this.setRegradeData(regrid, regraccepted);

    loadingIcon = new HTML();
    loadingIcon.setVisible(false);
    Icon iconloading = new Icon(IconType.COG);
    loadingIcon.setHTML(iconloading.toString());
    loadingIcon.addStyleName(Resources.INSTANCE.css().loadingicon());
    loadingIcon.addStyleName("icon-spin");

    mainPanel.add(loadingIcon);
    mainPanel.setCellHorizontalAlignment(loadingIcon, HasHorizontalAlignment.ALIGN_CENTER);

    initWidget(mainPanel);
  }
  public CompositeToggleButton(String leftText, String rightText, final boolean ask) {
    holder = new HorizontalPanel();
    holder.setStyleName("tae-Composite-ToggleButton");
    holder.addStyleName("no-Padding");
    initWidget(holder);
    left = new com.google.gwt.user.client.ui.ToggleButton(leftText);
    left.setStylePrimaryName("tae-Composite-ToggleButton-Left");
    holder.add(left);
    right = new com.google.gwt.user.client.ui.ToggleButton(rightText);
    right.setStylePrimaryName("tae-Composite-ToggleButton-Right");
    holder.add(right);
    left.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            if (ask) {
              new ConfirmDialog(
                  new ConfirmDialog.RequiresUserResponse() {

                    @Override
                    public void onResponse(boolean response) {
                      if (response) {
                        setValue(true, true);
                      } else {
                        setValue(false, true);
                      }
                    }
                  },
                  "Are you sure you want to change task status?",
                  "YES",
                  "NO");
            } else {
              setValue(true, true);
            }
          }
        });
    right.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            if (ask) {
              new ConfirmDialog(
                  new ConfirmDialog.RequiresUserResponse() {

                    @Override
                    public void onResponse(boolean response) {
                      if (response) {
                        setValue(false, true);
                      } else {
                        setValue(true, true);
                      }
                    }
                  },
                  "Are you sure you want to change task status?",
                  "YES",
                  "NO");
            } else {
              setValue(false, true);
            }
          }
        });
  }
  @SuppressWarnings("unchecked")
  public Widget asWidget() {

    ProvidesKey<ModelNode> providesKey = node -> node.get("operation-date").asString();
    table = new DefaultCellTable<>(20, providesKey);

    dataProvider = new ListDataProvider<>(providesKey);
    dataProvider.addDataDisplay(table);

    // the date / time column
    table.addColumn(
        new TextColumn<ModelNode>() {
          @Override
          public String getValue(ModelNode item) {
            // the operation-date is 2016-07-08T22:39:50.783Z
            // there is some format to facilitate user experience
            // by replacing the T with a blank space
            String opTimestamp = item.get("operation-date").asString();
            opTimestamp = opTimestamp.replaceFirst("T", " ");
            return opTimestamp;
          }
        },
        "Date and time");

    // access-mechanism column
    TextColumn<ModelNode> accessMechanismColumn = createColumn("access-mechanism");
    accessMechanismColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    table.addColumn(accessMechanismColumn, "Access Mechanism");

    // remote address column
    TextColumn<ModelNode> remoteAddressColumn =
        new TextColumn<ModelNode>() {
          @Override
          public String getValue(ModelNode item) {
            // the remote address is 10.10.10.10/10.10.10.10
            // to facilitate user experience we cut at at first slash
            String clientAddress = item.get("remote-address").asString();
            clientAddress = clientAddress.substring(0, clientAddress.indexOf("/"));
            return clientAddress;
          }
        };
    remoteAddressColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    table.addColumn(remoteAddressColumn, "Remote address");

    // the resource address
    TextColumn<ModelNode> resourceColumn =
        new TextColumn<ModelNode>() {
          @Override
          public String getValue(ModelNode item) {
            return StringUtils.shortenStringIfNecessary(extractResourceAddress(item), 63);
          }
        };
    table.addColumn(resourceColumn, "Resource address");
    table.setColumnWidth(resourceColumn, 50, Style.Unit.PCT);

    // operation column
    table.addColumn(
        new TextColumn<ModelNode>() {
          @Override
          public String getValue(ModelNode item) {
            return item.get(OPERATIONS).get(0).get(OP).asString();
          }
        },
        "Operation");

    // result column
    table.addColumn(createColumn(OUTCOME), "Result");
    table.setTableLayoutFixed(false);

    // the details panel
    selectionModel = new SingleSelectionModel<>(providesKey);
    selectionModel.addSelectionChangeHandler(
        event -> {
          ModelNode changeDetails = selectionModel.getSelectedObject();
          if (changeDetails != null) {
            detailsConfigurationChange.setValue(changeDetails.toString());
          }
        });
    table.setSelectionModel(selectionModel);

    detailsConfigurationChange = new TextAreaItem("details", "Details 1", 20);
    detailsConfigurationChange.setEnabled(false);

    HorizontalPanel header = new HorizontalPanel();
    header.addStyleName("fill-layout-width");
    header.add(new HTML("<h3 class='metric-label-embedded'>Configuration change details</h3>"));

    VerticalPanel detailsPanel = new VerticalPanel();
    detailsPanel.addStyleName("metric-container");
    detailsPanel.add(header);
    detailsPanel.add(detailsConfigurationChange.asWidget());

    // ======================
    DefaultPager pager = new DefaultPager();
    pager.setDisplay(table);

    VerticalPanel tableAndPager = new VerticalPanel();
    tableAndPager.setStyleName("fill-layout-width");
    tableAndPager.add(table);
    tableAndPager.add(pager);

    SimpleLayout layout =
        new SimpleLayout()
            .setPlain(true)
            .setHeadline("Configuration Changes")
            .setDescription(
                SafeHtmlUtils.fromString(Console.MESSAGES.configuration_changes_description()))
            .addContent("", toolstripButtons())
            .addContent("", tableAndPager)
            .addContent("", detailsPanel);

    return layout.build();
  }
  private void buildContent(RowData data) {
    grid = new FlexTable();
    grid.setCellSpacing(5);

    HTML html = new HTML("Working Set Name:  ");
    html.addStyleName("color-dark-blue");
    workingSetName = new TextBox();
    grid.setWidget(0, 0, html);
    grid.setWidget(0, 1, workingSetName);
    workingSetName.setSize("95%", "100%");

    html = new HTML("Creator:  ");
    html.addStyleName("color-dark-blue");
    managerHTML = new HTML();
    grid.setWidget(1, 0, html);
    grid.setWidget(1, 1, managerHTML);

    html = new HTML("Date Created:  ");
    html.addStyleName("color-dark-blue");
    dateCreatedHTML = new HTML();
    grid.setWidget(2, 0, html);
    grid.setWidget(2, 1, dateCreatedHTML);

    html = new HTML("Working Set Type:  ");
    html.addStyleName("color-dark-blue");
    workingSetMode = new ListBox(false);
    workingSetMode.insertItem("none selected", 0);
    workingSetMode.insertItem(WorkingSetData.PRIVATE, PRIVATEINDEX);
    workingSetMode.insertItem(WorkingSetData.PUBLIC, PUBLICINDEX);
    workingSetMode.setVisibleItemCount(1);
    workingSetMode.setEnabled(false);
    workingSetMode.setSelectedIndex(PUBLICINDEX);
    grid.setWidget(3, 0, html);
    grid.setWidget(3, 1, workingSetMode);

    html = new HTML("Associated People:  ");
    html.addStyleName("color-dark-blue");
    people = new SISCompleteList(this, 400);
    grid.setWidget(PEOPLECELL, 0, html);
    grid.setWidget(PEOPLECELL, 1, people);

    html = new HTML("Assessment Scope:  ");
    html.addStyleName("color-dark-blue");
    filterPanel = new AssessmentFilterPanel(new AssessmentFilter(), false, true, false, true);
    grid.setWidget(5, 0, html);
    grid.setWidget(5, 1, filterPanel);

    html = new HTML("Description:  ");
    html.addStyleName("color-dark-blue");
    description = new TextArea();
    grid.setWidget(6, 0, html);
    grid.setWidget(6, 1, description);
    description.setSize("95%", "100%");

    html = new HTML("Working Set Notes: ");
    html.addStyleName("color-dark-blue");
    notes = new TextArea();
    grid.setWidget(7, 0, html);
    grid.setWidget(7, 1, notes);
    notes.setSize("95%", "100%");

    grid.getColumnFormatter().setWidth(0, "130px");
    grid.getColumnFormatter().setWidth(1, "400px");
    grid.getRowFormatter().addStyleName(5, "vertical-align-top");
    grid.getRowFormatter().addStyleName(6, "vertical-align-top");
    grid.getRowFormatter().addStyleName(7, "vertical-align-top");
    grid.getCellFormatter().setHeight(6, 1, "200px");
    grid.getCellFormatter().setHeight(7, 1, "200px");

    HorizontalPanel hp = new HorizontalPanel();
    hp.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
    hp.addStyleName("expert-border");
    hp.add(grid);

    // add(hp, data);

    LayoutContainer widget = new LayoutContainer();
    widget.setScrollMode(Scroll.AUTO);
    widget.setLayout(new FillLayout());
    widget.add(hp);
    add(widget, data);
    grid.setWidth("100%");
  }
 public void addStyleName(String style) {
   layout.addStyleName(style);
 }
Beispiel #17
0
  /*
   * Creates the command bar.
   *
   * @return the command bar.
   */
  private HorizontalPanel createCommands() {
    final HorizontalPanel bar = new HorizontalPanel();
    bar.addStyleName(AbstractField.CSS.cbtAbstractCommand());

    final LocalRequest resetRequest =
        new LocalRequest() {
          protected void perform() {
            hide();
          }
        };

    // -----------------------------------------------
    // Save button
    // -----------------------------------------------
    final CommandButton saveButton =
        new CommandButton(this, AbstractField.CONSTANTS.allSave(), licenseUpdate, tab++);
    saveButton.addStyleName(AbstractField.CSS.cbtGradientBlue());
    saveButton.setTitle(AbstractField.CONSTANTS.helpSave());
    bar.add(saveButton);

    // -----------------------------------------------
    // Restore button
    // -----------------------------------------------
    final CommandButton restoreButton =
        new CommandButton(this, AbstractField.CONSTANTS.allRestore(), licenseUpdate, tab++);
    restoreButton.addStyleName(AbstractField.CSS.cbtGradientBlue());
    restoreButton.setTitle(AbstractField.CONSTANTS.helpRestore());
    bar.add(restoreButton);

    // -----------------------------------------------
    // Suspend button
    // -----------------------------------------------
    final CommandButton suspendButton =
        new CommandButton(this, AbstractField.CONSTANTS.allSuspend(), licenseUpdate, tab++);
    suspendButton.addStyleName(AbstractField.CSS.cbtGradientBlue());
    suspendButton.setTitle(AbstractField.CONSTANTS.helpSuspend());
    bar.add(suspendButton);

    // -----------------------------------------------
    // Delete button
    // -----------------------------------------------
    final CommandButton deleteButton =
        new CommandButton(this, AbstractField.CONSTANTS.allDelete(), licenseDelete, tab++);
    deleteButton.addStyleName(AbstractField.CSS.cbtGradientRed());
    deleteButton.setTitle(AbstractField.CONSTANTS.helpDelete());
    bar.add(deleteButton);

    // -----------------------------------------------
    // Cancel button
    // -----------------------------------------------
    final CommandButton cancelButton =
        new CommandButton(this, AbstractField.CONSTANTS.allCancel(), resetRequest, tab++);
    cancelButton.addStyleName(AbstractField.CSS.cbtGradientRed());
    cancelButton.setTitle(AbstractField.CONSTANTS.helpCancel());
    bar.add(cancelButton);

    // -----------------------------------------------
    // Transition array that defines the finite state machine
    // -----------------------------------------------
    fsm = new ArrayList<Transition>();
    fsm.add(new Transition(License.INITIAL, cancelButton, License.CREATED));
    fsm.add(new Transition(License.INITIAL, saveButton, License.CREATED));
    fsm.add(new Transition(License.INITIAL, suspendButton, License.SUSPENDED));

    fsm.add(new Transition(License.CREATED, saveButton, License.CREATED));
    fsm.add(new Transition(License.CREATED, suspendButton, License.SUSPENDED));
    fsm.add(new Transition(License.CREATED, deleteButton, License.CREATED));

    fsm.add(new Transition(License.SUSPENDED, saveButton, License.SUSPENDED));
    fsm.add(new Transition(License.SUSPENDED, restoreButton, License.CREATED));
    fsm.add(new Transition(License.SUSPENDED, cancelButton, License.SUSPENDED));
    return bar;
  }
Beispiel #18
0
 private void assembleAddStockPanel() {
   addPanel.add(newSymbolTextBox);
   addPanel.add(addStockButton);
   addPanel.addStyleName("addPanel");
 }