コード例 #1
0
ファイル: CreateGroupWidget.java プロジェクト: RobertMcK/ice
  public CreateGroupWidget(UserGroup parent) {
    initComponents();
    this.parent = parent;

    int row = 0;

    createTable.setWidget(row, 0, closeLink);
    createTable.getFlexCellFormatter().setColSpan(row, 0, 2);
    row += 1;

    createTable.setHTML(row, 0, "<b>Name</b>");
    createTable.setWidget(row, 1, groupName);
    row += 1;

    createTable.setHTML(row, 0, "<b>Description</b>");
    createTable.setWidget(row, 1, groupDescription);
    row += 1;

    createTable.setWidget(row, 0, table);
    createTable.getFlexCellFormatter().setColSpan(row, 0, 2);
    row += 1;

    createTable.setWidget(row, 0, createButton);
    createTable.getFlexCellFormatter().setHorizontalAlignment(row, 0, HasAlignment.ALIGN_RIGHT);
    createTable.setWidget(row, 1, cancelButton);

    popup.setWidget(createTable);
    popup.setGlassEnabled(true);
    popup.setGlassStyleName("dialog_box_glass");
    closeLink.addClickHandler(new CloseWidgetHandler());
    cancelButton.addClickHandler(new CloseWidgetHandler());
  }
コード例 #2
0
  private FlexTable getErrorWidget(PerunError error) {

    String text = "Request timeout exceeded.";
    String errorInfo = "";
    if (error != null) {
      if (error.getName().equalsIgnoreCase("VoNotExistsException")) {
        text =
            "Virtual organization with such name doesn't exists. Please check URL and try again.";
      } else if (error.getName().equalsIgnoreCase("GroupNotExistsException")) {
        text = "Group with such name doesn't exists. Please check URL and try again.";
      } else {
        text = "Error: " + error.getName();
      }
      errorInfo = error.getErrorInfo();
    }

    FlexTable ft = new FlexTable();
    ft.setSize("100%", "300px");
    ft.setHTML(0, 0, new Image(LargeIcons.INSTANCE.errorIcon()) + "<h2>" + text + "</h2>");
    ft.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);
    ft.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_BOTTOM);

    ft.setHTML(1, 0, "<p>" + errorInfo);
    ft.getFlexCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_CENTER);
    ft.getFlexCellFormatter().setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_TOP);

    return ft;
  }
コード例 #3
0
  private SecurityPanel() {

    saveButton.setStylePrimaryName("pentaho-button");

    HorizontalPanel roleTypeSelectionPanel = new HorizontalPanel();
    regularRolesBtn.addValueChangeHandler(this);
    systemRolesBtn.addValueChangeHandler(this);
    roleTypeSelectionPanel.add(regularRolesBtn);
    roleTypeSelectionPanel.add(systemRolesBtn);

    // add role type panel
    FlexTable securityPanel = new FlexTable();
    securityPanel.setWidget(0, 0, roleTypeSelectionPanel);
    securityPanel.getFlexCellFormatter().setColSpan(0, 0, 2);

    // add available roles list
    securityPanel.setWidget(1, 0, createRolesListBox());
    securityPanel.getFlexCellFormatter().setRowSpan(1, 0, 2);

    saveButton.addClickHandler(this);
    securityPanel.setWidget(2, 0, saveButton);

    securityPanel.setWidget(1, 1, createPermissionPanel());
    securityPanel.getFlexCellFormatter().setVerticalAlignment(2, 0, HasVerticalAlignment.ALIGN_TOP);

    setWidget(securityPanel);

    initializeAvailUserRoles();
    initializeSystemRoles();
    initializeLogicalRoleMappings();
  }
コード例 #4
0
ファイル: PropertyTable.java プロジェクト: sldurkovic/semlab
 public void insertWidget(Widget key, Widget value) {
   int row = table.getRowCount();
   table.setWidget(row, 0, key);
   table.setWidget(row, 1, value);
   table.getFlexCellFormatter().addStyleName(row, 0, Resources.INSTANCE.css().propertyTableKey());
   table
       .getFlexCellFormatter()
       .addStyleName(row, 1, Resources.INSTANCE.css().propertyTableValue());
 }
コード例 #5
0
  public TournamentPoolPanel() {
    super("Pooler");

    poolCounts = new int[3];
    lblPoolCountTotal = new Label();
    lblPoolCount2 = new Label();
    lblPoolCount3 = new Label();
    lblPoolCount4 = new Label();

    poolGrid = new FlexTable();

    poolGrid.setText(0, 0, "Poolstorlek");
    lbPoolSize = new ListBox();
    lbPoolSize.addItem("2", "2");
    lbPoolSize.addItem("3", "3");
    lbPoolSize.setSelectedIndex(1);
    lbPoolSize.addChangeListener(
        new ChangeListener() {

          public void onChange(Widget sender) {
            updateControls();
          }
        });
    poolGrid.setWidget(0, 1, lbPoolSize);
    poolGrid.getFlexCellFormatter().setColSpan(0, 1, 3);

    poolGrid.setText(1, 0, "Vid udda deltagare");
    FlowPanel prefersLargerPanel = new FlowPanel();
    rbPreferLarger = new RadioButton("rePreferringLarger", "Föredrar större pooler");
    rbPreferLarger.setChecked(true);
    rbPreferSmaller = new RadioButton("rePreferringLarger", "Föredrar mindre pooler");
    prefersLargerPanel.add(rbPreferLarger);
    prefersLargerPanel.add(rbPreferSmaller);
    poolGrid.setWidget(1, 1, prefersLargerPanel);
    poolGrid.getFlexCellFormatter().setColSpan(1, 1, 3);

    poolGrid.setText(2, 0, "Antal pooler");
    poolGrid.getFlexCellFormatter().setColSpan(2, 0, 4);

    poolGrid.setText(3, 0, "Totalt");
    poolGrid.setText(3, 1, "2-man");
    poolGrid.setText(3, 2, "3-man");
    poolGrid.setText(3, 3, "4-man");
    poolGrid.setWidget(4, 0, lblPoolCountTotal);
    poolGrid.setWidget(4, 1, lblPoolCount2);
    poolGrid.setWidget(4, 2, lblPoolCount3);
    poolGrid.setWidget(4, 3, lblPoolCount4);

    for (int i = 0; i < 3; ++i) {
      poolGrid.getColumnFormatter().setWidth(i, "25%");
    }

    add(poolGrid);
  }
コード例 #6
0
ファイル: TabMenu.java プロジェクト: papperwing/perun
  /**
   * Method to set proper CSS styles to menu widget. Should be called after any widget content
   * change
   */
  private void setStyles() {

    // set proper last item tag
    for (int i = 0; i < cellCount; i++) {
      if (i == 0) menu.getFlexCellFormatter().addStyleName(0, i, "tabMenu-first");
      menu.getFlexCellFormatter().addStyleName(0, i, "tabMenu");
      menu.getFlexCellFormatter().removeStyleName(0, i, "tabMenu-last");
      if (i == cellCount - 1) {
        menu.getFlexCellFormatter().addStyleName(0, i, "tabMenu-last");
      }
    }
  }
コード例 #7
0
  private void setupTableHeaders(boolean includeMappingColumn) {
    Label defsLabel = new Label(definitionsLabel);
    defsLabel.setStyleName(style.definitionHeader());
    table.setWidget(0, 0, defsLabel);
    table.getFlexCellFormatter().setColSpan(0, 0, includeMappingColumn ? 2 : 4);
    table.getFlexCellFormatter().setStyleName(0, 0, style.headerCell());

    if (includeMappingColumn) {
      Label tarsLabel = new Label(targetsLabel);
      tarsLabel.setStyleName(style.targetHeader());
      table.setWidget(0, 1, tarsLabel);
      table.getFlexCellFormatter().setColSpan(0, 1, 2);
      table.getFlexCellFormatter().setStyleName(0, 1, style.headerCell());
    }
  }
コード例 #8
0
  /**
   * Navigation Buttons to browse other pages
   *
   * @param layout
   * @return a table containing navigation buttons
   */
  private FlexTable NavigationButtons(VerticalPanel layout) {
    FlexTable navigatorLayout = new FlexTable();
    FlexCellFormatter formatterNavigator = navigatorLayout.getFlexCellFormatter();
    navigatorLayout.setWidth("60%");

    Button businessGoalButton = new Button(messages.businessGoalButtonLabel());
    Button associateAssetsAndGoalsButton =
        new Button(messages.associateAssetsAndGoalsButtonLabel());
    businessGoalButton.setWidth("180px");
    associateAssetsAndGoalsButton.setWidth("180px");

    navigatorLayout.setWidget(0, 0, businessGoalButton);
    navigatorLayout.setWidget(0, 1, associateAssetsAndGoalsButton);
    formatterNavigator.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT);
    formatterNavigator.setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_RIGHT);

    businessGoalButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            updateBusinessGoalInformation(null);
            History.newItem(
                AssetsAndGoalsPilot.generateNavigationId(AssetsAndGoalsPilot.PageId.start));
          }
        });

    associateAssetsAndGoalsButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            updateBusinessGoalInformation(new AssociateAssetsNavigation());
          }
        });
    return navigatorLayout;
  }
コード例 #9
0
  /**
   * Add a new row to the sub goals table
   *
   * @param integer
   * @param subGoalsTable the flex table for the sub-goals
   */
  private void addRowToTable(
      String info, String keyInfo, Integer priority, final FlexTable table, boolean isAsset) {
    // get the current number of rows so we know where to add the new text box
    int currentNumberOfRows = table.getRowCount();

    // Create and add the textbox and supporting links for the mechanics of the UI
    final ScrollBarTextBox userInput = new ScrollBarTextBox();
    userInput.setWidth("100%");
    SquareHyperlink removeLink = new SquareHyperlink(messages.remove());

    userInput.setName(String.valueOf(currentNumberOfRows));
    userInput.setKey(keyInfo); // For tracking db id
    userInput.setText(info);
    userInput.setPriority(priority);

    table.setWidget(currentNumberOfRows, 0, userInput);
    table.setWidget(currentNumberOfRows, 1, removeLink);
    FlexCellFormatter formatter = table.getFlexCellFormatter();
    formatter.setHorizontalAlignment(currentNumberOfRows, 0, HasHorizontalAlignment.ALIGN_LEFT);
    formatter.setHorizontalAlignment(currentNumberOfRows, 1, HasHorizontalAlignment.ALIGN_RIGHT);
    formatter.setWidth(currentNumberOfRows, 1, "10%");

    if (isAsset) {
      this.addAssetToTable(userInput, removeLink);
    } else {
      this.addGoalToTable(userInput, removeLink);
    }
  }
コード例 #10
0
ファイル: EventEditor.java プロジェクト: jrray/gotefarm
  public void updateRoleTotals() {
    int mint = 0;
    int maxt = 0;

    final int rows = roleft.getRowCount() - 2;

    for (int row = 0; row < rows; ++row) {
      TextBox minw = (TextBox) roleft.getWidget(row + 1, 1);
      TextBox maxw = (TextBox) roleft.getWidget(row + 1, 2);

      mint += Integer.parseInt(minw.getText());
      maxt += Integer.parseInt(maxw.getText());
    }

    roleft.setText(rows + 1, 1, "" + mint);
    roleft.setText(rows + 1, 2, "" + maxt);

    int size = getRaidSize();

    FlexTable.FlexCellFormatter fcf = roleft.getFlexCellFormatter();

    if (mint < size) {
      fcf.addStyleName(rows + 1, 1, "error");
    } else {
      fcf.removeStyleName(rows + 1, 1, "error");
    }

    if (maxt < size) {
      fcf.addStyleName(rows + 1, 2, "error");
    } else {
      fcf.removeStyleName(rows + 1, 2, "error");
    }

    updateBadgeRoles();
  }
コード例 #11
0
ファイル: TableBuilder.java プロジェクト: ggaljoen/ilarkesto
 public FlexTable createTable() {
   if (!currentRow.cells.isEmpty()) nextRow();
   FlexTable table = new FlexTable();
   table.setStyleName(styleName);
   table.setCellSpacing(cellSpacing);
   table.setCellPadding(cellPadding);
   if (centered) table.getElement().setAttribute("align", "center");
   String widthAsString = width == null ? "" : width;
   table.setWidth(widthAsString);
   table.getElement().setAttribute("width", widthAsString);
   if (columnWidths != null) {
     ColumnFormatter columnFormatter = table.getColumnFormatter();
     for (int i = 0; i < columnWidths.length; i++) {
       columnFormatter.setWidth(i, columnWidths[i]);
     }
   }
   int rowIndex = 0;
   for (Row row : rows) {
     int colIndex = 0;
     for (Cell cell : row.cells) {
       table.setWidget(rowIndex, colIndex, cell.widget);
       if (cell.colspan > 1)
         table.getFlexCellFormatter().setColSpan(rowIndex, colIndex, cell.colspan);
       if (cell.align != null) {
         table.getCellFormatter().setHorizontalAlignment(rowIndex, colIndex, cell.align);
       }
       colIndex += cell.colspan;
     }
     rowIndex++;
   }
   return table;
 }
コード例 #12
0
 private void appendRow(Row row) {
   if (row.object == null) {
     Widget groupWidget;
     try {
       groupWidget = createGroupWidget(row.group);
     } catch (Exception ex) {
       throw new RuntimeException(Str.getSimpleName(getClass()) + "getGroupWidget() failed");
     }
     table.setWidget(row.tableRowIndex, 0, groupWidget);
     table.getFlexCellFormatter().setColSpan(row.tableRowIndex, 0, columns.size());
   } else {
     for (AColumn column : columns) {
       table.setWidget(row.tableRowIndex, column.index, column.getCellWidget(row.object));
       column.formatCell(row.tableRowIndex, row.object, table.getCellFormatter());
     }
     if (isClickable()) {
       switch (getMouseover()) {
         case ROW:
           table.getRowFormatter().setStyleName(row.tableRowIndex, "clickable");
           break;
         case CELL:
           for (int col = 0; col < columns.size(); col++) {
             if (isColumnClickable(col)) {
               table.getCellFormatter().setStyleName(row.tableRowIndex, col, "clickable");
             }
           }
           break;
         case NONE:
           break;
       }
     }
   }
 }
コード例 #13
0
  public PositionsListeWidget() {
    this.setWidth("100%");
    this.setHeight("100%");

    links = UIFactory.getVLayout("70%", "500px");
    rechts = UIFactory.getVLayout("30%", "100%");
    this.setBackgroundColor("#CCFFCC");

    Positionsliste einkaufArtikel = new Positionsliste();
    Artikel neuerArtikel;
    try {
      neuerArtikel = Bauteil.erzeugeBauteil(20, 3, 2, "zweiterTyp", "schlecht");
      einkaufArtikel.erfassePosition(neuerArtikel, 500, 1000);
      neuerArtikel = Bauteil.erzeugeBauteil(20, 3, 2, "dritter", "schlecht");
      einkaufArtikel.erfassePosition(neuerArtikel, 500, 1000);
    } catch (InstanceCreationException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    einkaufsTabelle = new PositionsWidget();

    // Create a table to layout the form options
    FlexTable layout = new FlexTable();
    layout.setCellSpacing(6);
    FlexCellFormatter cellFormatter = layout.getFlexCellFormatter();

    // Add a title to the form
    layout.setHTML(0, 0, "Gesamtverbrauch");
    cellFormatter.setColSpan(0, 0, 2);
    cellFormatter.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);

    txtGesamtkosten = UIFactory.getStyledTextBox("TB1", true);
    txtLagerbedarf = UIFactory.getStyledTextBox("TB1", true);

    // Add some standard form options
    layout.setHTML(1, 0, "Gesamtkosten:");
    layout.setWidget(1, 1, txtGesamtkosten);
    layout.setHTML(2, 0, "Lagerbedarf:");
    layout.setWidget(2, 1, txtLagerbedarf);

    // Wrap the content in a DecoratorPanel
    //	    DecoratorPanel gesamt = new DecoratorPanel();
    Canvas gesamt = new Canvas();
    gesamt.setWidth("100%");
    //	    gesamt.setWidget(layout);
    gesamt.addChild(layout);

    auswahl = new AuswahlEinkaufWidget();

    // add Members to left and right side
    links.addMember(UIFactory.getStyledLabel("Einkaufsartikel", 30, 30));
    links.addMember(einkaufsTabelle);

    rechts.addMember(auswahl);
    rechts.addMember(gesamt);

    this.addMember(links);
    this.addMember(rechts);
  }
コード例 #14
0
  private FlexTable getFooter() {

    ft = new FlexTable();
    ft.addStyleName("perunFooter");

    FlexTable.FlexCellFormatter ftf = ft.getFlexCellFormatter();

    if (!voContact.getHTML().isEmpty()) {
      // show only if any contact is present
      voContact.setHTML(
          "<strong>"
              + ApplicationMessages.INSTANCE.supportContact()
              + "</strong> "
              + voContact.getHTML());
    }

    ft.setWidget(0, 0, voContact);
    ft.setWidget(0, 1, new HTML(PerunWebConstants.INSTANCE.footerPerunCopyright()));

    ftf.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT);
    ftf.setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);
    ftf.getElement(0, 1).setAttribute("style", "text-wrap: avoid;");
    ftf.setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_RIGHT);
    ftf.setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_MIDDLE);

    return ft;
  }
コード例 #15
0
  public LoginViewImpl() {
    VerticalPanel vp = new VerticalPanel();
    this.initWidget(vp);
    vp.setSize("100%", "100%");
    FlexTable grid = new FlexTable();
    grid.setStyleName(Adicionais.RESOURCES.css().login());

    Label loginLabel = new Label("Login:"******"Senha:");
    this.passwordTextBox = new PasswordTextBox();
    this.accessButton = new Button("Acessar");
    this.accessButton.setWidth("5em");

    grid.setCellSpacing(6);
    grid.setWidget(0, 0, loginLabel);
    grid.setWidget(0, 1, this.loginTextBox);
    grid.setWidget(1, 0, passwordLabel);
    grid.setWidget(1, 1, this.passwordTextBox);
    grid.setWidget(2, 0, accessButton);
    grid.getFlexCellFormatter().setColSpan(2, 0, 2);
    grid.getCellFormatter().setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_RIGHT);

    vp.add(grid);
    vp.setCellVerticalAlignment(grid, HasVerticalAlignment.ALIGN_MIDDLE);
    vp.setCellHorizontalAlignment(grid, HasHorizontalAlignment.ALIGN_CENTER);
    this.setSize("100%", "100%");
  }
コード例 #16
0
ファイル: WeaponsView.java プロジェクト: liangstone/easymorse
  public WeaponsView() {
    DecoratorPanel contentTableDecorator = new DecoratorPanel();
    initWidget(contentTableDecorator);
    contentTableDecorator.setWidth("100%");
    contentTableDecorator.setWidth("15em");

    contentTable = new FlexTable();
    contentTable.setWidth("100%");
    contentTable.getCellFormatter().addStyleName(0, 0, "contacts-ListContainer");
    contentTable.getCellFormatter().setWidth(0, 0, "100%");
    contentTable.getFlexCellFormatter().setVerticalAlignment(0, 0, DockPanel.ALIGN_TOP);

    HorizontalPanel hPanel = new HorizontalPanel();
    hPanel.setBorderWidth(0);
    hPanel.setSpacing(0);
    hPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
    addButton = new Button("增加");
    hPanel.add(addButton);
    deleteButton = new Button("删除");
    hPanel.add(deleteButton);
    contentTable.getCellFormatter().addStyleName(0, 0, "contacts-ListMenu");
    contentTable.setWidget(0, 0, hPanel);

    contactsTable = new FlexTable();
    contactsTable.setCellSpacing(0);
    contactsTable.setCellPadding(0);
    contactsTable.setWidth("100%");
    contactsTable.addStyleName("contacts-ListContents");
    contactsTable.getColumnFormatter().setWidth(0, "15px");
    contentTable.setWidget(1, 0, contactsTable);

    contentTableDecorator.add(contentTable);
  }
コード例 #17
0
 private ValueEditor<O> addValueEditor(boolean deleteVisible) {
   final ValueEditor<O> editor = getFreshValueEditor();
   currentEditors.add(editor);
   final int rowCount = tableField.getRowCount();
   tableField.setWidget(rowCount, 0, editor.asWidget());
   final DeleteButton deleteButton = new DeleteButton();
   deleteButton.addClickHandler(
       new ClickHandler() {
         @Override
         public void onClick(ClickEvent event) {
           handleDelete(editor);
         }
       });
   tableField.setWidget(rowCount, 1, deleteButton);
   final FlexTable.FlexCellFormatter formatter = tableField.getFlexCellFormatter();
   formatter.setWidth(rowCount, 0, "100%");
   formatter.setVerticalAlignment(rowCount, 0, HasVerticalAlignment.ALIGN_TOP);
   formatter.setWidth(rowCount, 1, "30px");
   formatter.getElement(rowCount, 1).getStyle().setPaddingLeft(1, Style.Unit.PX);
   formatter.setVerticalAlignment(rowCount, 1, HasVerticalAlignment.ALIGN_TOP);
   editor.addDirtyChangedHandler(dirtyChangedHandler);
   editor.addValueChangeHandler(valueChangeHandler);
   deleteButton.setVisible(deleteVisible);
   return editor;
 }
コード例 #18
0
  private void render(final FixtureList retList, final FlexTable outer, final Scenario sc) {
    outer.clear();
    outer.getCellFormatter().setStyleName(0, 0, "modeller-fact-TypeHeader");
    outer
        .getCellFormatter()
        .setAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE);
    outer.setStyleName("modeller-fact-pattern-Widget");
    outer.setWidget(0, 0, new SmallLabel(Constants.INSTANCE.ActivateRuleFlowGroup()));
    outer.getFlexCellFormatter().setColSpan(0, 0, 2);

    int row = 1;
    for (Fixture fixture : retList) {
      final ActivateRuleFlowGroup acticateRuleFlowGroup = (ActivateRuleFlowGroup) fixture;
      outer.setWidget(row, 0, new SmallLabel(acticateRuleFlowGroup.getName()));
      Image del =
          new ImageButton(
              DroolsGuvnorImages.INSTANCE.itemImages().deleteItemSmall(),
              Constants.INSTANCE.RemoveThisRuleFlowActivation(),
              new ClickHandler() {
                public void onClick(ClickEvent w) {
                  retList.remove(acticateRuleFlowGroup);
                  sc.getFixtures().remove(acticateRuleFlowGroup);
                  render(retList, outer, sc);
                  parent.renderEditor();
                }
              });
      outer.setWidget(row, 1, del);

      row++;
    }
  }
コード例 #19
0
  private void createGUI() {

    getCaption().setText(app.getMenu("Exercise.CreateNew"));

    setWidget(mainWidget = new VerticalPanel());
    addDomHandlers(mainWidget);
    assignmentsTable = new FlexTable();
    FlexCellFormatter cellFormatter = assignmentsTable.getFlexCellFormatter();
    cellFormatter.setColSpan(0, 1, 2);

    assignmentsTable.setWidget(0, 1, new Label(app.getPlain("Tool")));
    assignmentsTable.setWidget(0, 2, new Label(app.getPlain("HintForCorrect")));
    assignmentsTable.setWidget(0, 3, new Label(app.getPlain("Fraction")));

    createAssignmentsTable();
    checkAssignmentsTable = new FlexTable();
    checkAssignmentsTable.setVisible(false);

    mainWidget.add(assignmentsTable);
    mainWidget.add(checkAssignmentsTable);

    addList = new UnorderedList();
    addDomHandlers(addList);
    // addIcon = new ListItem();
    Image addIcon = new Image(GuiResources.INSTANCE.menu_icon_file_new());
    ListItem addListItem = new ListItem();
    addListItem.addStyleName("toolbar_item");
    addListItem.add(addIcon);
    addList.add(addListItem);

    userAddModes = new ToolbarSubemuW(app, 1);
    userAddModes.addStyleName("toolbar_item");
    userAddModes.setVisible(false);
    for (int i = 0; i < app.getKernel().getMacroNumber(); i++) {
      if (!exercise.usesMacro(i)) {
        ListItem item = userAddModes.addItem(i + EuclidianConstants.MACRO_MODE_ID_OFFSET);
        addDomHandlers(item);
      }
    }
    addList.add(userAddModes);
    mainWidget.add(addList);

    mainWidget.add(bottomWidget = new FlowPanel());
    bottomWidget.setStyleName("DialogButtonPanel");

    btApply = new Button(app.getPlain("OK"));
    btApply.addClickHandler(this);
    btApply.getElement().getStyle().setMargin(3, Style.Unit.PX);

    addCancelButton();

    btTest = new Button(app.getPlain("Test"));
    btTest.addClickHandler(this);
    btTest.getElement().getStyle().setMargin(3, Style.Unit.PX);

    bottomWidget.add(btTest);
    bottomWidget.add(btApply);
    // bottomWidget.add(btCancel);

  }
コード例 #20
0
  public Widget init() {
    FlexTable ft = new FlexTable();
    ft.setWidth("100%");
    ft.setWidget(0, 0, this.print);
    ft.setWidget(0, 1, this.printExcel);
    FlexTable.FlexCellFormatter format = ft.getFlexCellFormatter();
    format.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT);
    format.setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_LEFT);
    Widget panel =
        VisualForm.visualize(null, getSearchTable(), onInitializeWithScroll("300px"), ft);

    // Добавление столбцов
    addColumn(
        new TextCell(),
        "Статус",
        new GetValue<String, FormInfo<Statistic>>() {
          public String getValue(FormInfo<Statistic> info) {
            return ((Statistic) info.getData()).getName();
          }
        },
        null);
    addColumn(
        new NumberCell(),
        "Количество кандидатов",
        new GetValue<Number, FormInfo<Statistic>>() {
          public Number getValue(FormInfo<Statistic> info) {
            return ((Statistic) info.getData()).getQnt1();
          }
        },
        null);
    setPagerVisible(false);
    this.print.setWidth("120px");
    this.print.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            ReportParams params = new ReportParams(Report.CAND_PRINT, ReportType.html);
            params.putParam("daten", (String) CandStatisticsForm.this.localPar.get(5));
            params.putParam("datek", (String) CandStatisticsForm.this.localPar.get(6));
            params.putParam("pkct", (String) CandStatisticsForm.this.localPar.get(7));
            params.putParam("pksro", (String) CandStatisticsForm.this.localPar.get(8));
            Window.open(params.getRunString(), "", "");
          }
        });
    this.printExcel.setWidth("120px");
    this.printExcel.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            ReportParams params = new ReportParams(Report.CAND_PRINT, ReportType.xls);
            params.putParam("daten", (String) CandStatisticsForm.this.localPar.get(5));
            params.putParam("datek", (String) CandStatisticsForm.this.localPar.get(6));
            params.putParam("pkct", (String) CandStatisticsForm.this.localPar.get(7));
            params.putParam("pksro", (String) CandStatisticsForm.this.localPar.get(8));
            Window.open(params.getRunString(), "", "");
          }
        });
    setFormData();
    return panel;
  }
コード例 #21
0
ファイル: MethodList.java プロジェクト: samizzo/monbulk
  private void BuildList(String Filter) {

    Iterator<Entry<String, pojoMethod>> it = this.methodList.entrySet().iterator();

    int i = 0;
    this._MenuStack.clear();
    this._MenuStack.removeAllRows();

    // this._MenuStack.setHeight(height)
    // We need to set Height of the parent panel dynamically based on the number of items
    // We need to add a hidden field with a unique id
    while (it.hasNext()) {
      // Use of final to allow access to it in the clickHandlers
      final int index = i; // This keeps track of which item we are looking at
      Entry<String, pojoMethod> tmpEntry = it.next();
      final pojoMethod tmpMethod = tmpEntry.getValue();
      //
      String comp1 = tmpMethod.getMethodName().toLowerCase();
      String comp2 = Filter.toLowerCase();
      if (comp1.contains(comp2)) {
        final Label titleLabel = new Label();
        titleLabel.setText(tmpMethod.getMethodName());
        titleLabel.addStyleName("menuMethodName");
        final int _i = i;
        // _edit.setStyleName("btnEditMethod");
        titleLabel.addClickHandler(
            new ClickHandler() {

              @Override
              public void onClick(ClickEvent event) {

                // set selected style/should shuffle as well
                setActiveMenu(tmpMethod.getMethodID());
                eventBus.fireEvent(
                    new DragEvent(titleLabel.getText(), "EditMethod", index, (IPojo) tmpMethod));
              }
            });

        // this._MenuStack.setWidget(i,0,tmpItem.asWidget());
        this._MenuStack.setWidget(i, 0, titleLabel);
        // this._MenuStack.setWidget(i,1,_edit);
        Hidden tmpHidden = new Hidden();
        tmpHidden.setValue(tmpMethod.getMethodID());
        this._MenuStack.setWidget(i, 1, tmpHidden);
        _MenuStack.getFlexCellFormatter()
            .getElement(i, 0)
            .setAttribute("style", "border-right:Solid 1px #ccc;");
        // _MenuStack.getFlexCellFormatter().getElement(i, 1).setAttribute("style",
        // "padding-left:5px;");
        i++;
      }
    }

    _MenuStack.setCellPadding(0);
    _MenuStack.setCellSpacing(0);
    int newHeight = _MenuStack.getRowCount() * 30;
    this._MenuStack.setHeight(newHeight + "px");
  }
コード例 #22
0
ファイル: EventsView.java プロジェクト: sumi/irtk5-old
 EventsView() {
   initWidget(eventsFormTable);
   eventsFormTable.setWidth("32em");
   eventsFormTable.setCellSpacing(5);
   eventsFormTable.setCellPadding(3);
   cellFormatter.setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_LEFT);
   eventsFormTable.getFlexCellFormatter().setColSpan(1, 0, 2);
   eventsFormTable.setWidget(2, 0, new HTML("Events List"));
 }
コード例 #23
0
ファイル: PropertyTable.java プロジェクト: sldurkovic/semlab
 public PasswordTextBox insertPasswordWidget(String key) {
   int row = table.getRowCount();
   PasswordTextBox box = new PasswordTextBox();
   table.setWidget(row, 0, new Label(key));
   table.setWidget(row, 1, box);
   table.getFlexCellFormatter().addStyleName(row, 0, "property-Table-Key");
   table.getFlexCellFormatter().addStyleName(row, 1, "property-Table-Value");
   return box;
 }
コード例 #24
0
  private FlexTable getCustomErrorWidget(PerunError error, String customText) {

    FlexTable ft = new FlexTable();
    ft.setSize("100%", "300px");
    ft.setHTML(0, 0, new Image(LargeIcons.INSTANCE.errorIcon()) + "<h2>Error: </h2>" + customText);
    ft.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);
    ft.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);

    return ft;
  }
コード例 #25
0
ファイル: LoginForm.java プロジェクト: KWMalik/PFM
  public static VerticalPanel init() {

    // layout.setCellSpacing(8);
    // layout.setWidth("100%");
    panel.setWidth("35%");
    layoutFormat = layout.getFlexCellFormatter();
    layout.setText(0, 0, "Username: "******"Password: "******"");
    layout.setWidget(2, 1, signIn);
    layout.setWidget(2, 2, lSignInStatus);

    layoutFormat = layoutSignup.getFlexCellFormatter();
    layoutSignup.setText(0, 0, "Confirm password: "******"E-mail: ");
    layoutSignup.setWidget(1, 1, inputEmail);
    layoutFormat.setColSpan(1, 1, 2);
    // layoutSignup.setText(2, 0, ""); //passwords do not match
    lSignUpStatus.setText("");
    layoutSignup.setWidget(2, 1, signUp);
    layoutSignup.setWidget(2, 2, lSignUpStatus);

    signUpDisclosure.setAnimationEnabled(true);
    // signUpDisclosure.ensureDebugId("cwDisclosurePanel");
    signUpDisclosure.setContent(layoutSignup);

    // Wrap the contents in a DecoratorPanel
    signUpPanel.setWidget(layout);

    panel.add(layout);
    panel.add(signUpDisclosure);

    initHandlers();

    return panel;
  }
コード例 #26
0
ファイル: PropertyTable.java プロジェクト: sldurkovic/semlab
 public TextBox insertTextWidget(String key, String width) {
   int row = table.getRowCount();
   TextBox box = new TextBox();
   if (width != null) box.setWidth(width);
   box.addStyleName("neo-TextBox");
   table.setWidget(row, 0, new Label(key));
   table.setWidget(row, 1, box);
   table.getFlexCellFormatter().addStyleName(row, 0, "property-Table-Key");
   table.getFlexCellFormatter().addStyleName(row, 1, "property-Table-Value");
   return box;
 }
コード例 #27
0
ファイル: SnapshotView.java プロジェクト: nhenggeler/guvnor
  private Widget header() {
    FlexTable ft = new FlexTable();

    ft.setWidget(0, 0, new Label(Constants.INSTANCE.ViewingSnapshot()));
    ft.setWidget(0, 1, new HTML("<b>" + this.snapInfo.getName() + "</b>"));
    ft.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT);

    ft.setWidget(1, 0, new Label(Constants.INSTANCE.ForPackage()));
    ft.setWidget(1, 1, new Label(this.parentConf.getName()));
    ft.getFlexCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_RIGHT);

    HTML dLink =
        new HTML(
            "<a href='"
                + PackageBuilderWidget.getDownloadLink(this.parentConf)
                + "' target='_blank'>"
                + Constants.INSTANCE.clickHereToDownloadBinaryOrCopyURLForDeploymentAgent()
                + "</a>");
    ft.setWidget(2, 0, new Label(Constants.INSTANCE.DeploymentURL()));
    ft.setWidget(2, 1, dLink);
    ft.getFlexCellFormatter().setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_RIGHT);

    ft.setWidget(3, 0, new Label(Constants.INSTANCE.SnapshotCreatedOn()));
    ft.getFlexCellFormatter().setHorizontalAlignment(3, 0, HasHorizontalAlignment.ALIGN_RIGHT);
    ft.setWidget(
        3,
        1,
        new Label(
            DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_TIME_SHORT)
                .format(parentConf.getLastModified())));
    ft.getFlexCellFormatter().setHorizontalAlignment(4, 0, HasHorizontalAlignment.ALIGN_RIGHT);

    ft.setWidget(4, 0, new Label(Constants.INSTANCE.CommentColon()));
    ft.setWidget(4, 1, new Label(parentConf.getCheckinComment()));
    ft.getFlexCellFormatter().setHorizontalAlignment(4, 0, HasHorizontalAlignment.ALIGN_RIGHT);

    HorizontalPanel actions = new HorizontalPanel();

    actions.add(getDeleteButton(this.snapInfo.getName(), this.parentConf.getName()));
    actions.add(getCopyButton(this.snapInfo.getName(), this.parentConf.getName()));

    ft.setWidget(5, 0, actions);

    ft.setWidget(6, 0, getCompareWidget(this.parentConf.getName(), this.snapInfo.getName()));
    ft.getFlexCellFormatter().setHorizontalAlignment(4, 0, HasHorizontalAlignment.ALIGN_RIGHT);

    ft.getFlexCellFormatter().setColSpan(5, 0, 2);

    return ft;
  }
コード例 #28
0
  public FlexTable getSearchTable() {
    FlexTable ft = new FlexTable();

    FlexTable dateFt = new FlexTable();
    dateFt.setHTML(0, 0, "За период с");
    dateFt.setWidget(0, 1, this.db1);
    dateFt.setHTML(0, 2, "по");
    dateFt.setWidget(0, 3, this.db2);

    this.search1.setButtonsVisible(true, false);
    this.search2.setButtonsVisible(true, false);
    FlexTable buttFt = new FlexTable();
    Button view = new Button("Поиск");
    view.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            CandStatisticsForm.this.setFormData();
          }
        });
    Button clear = new Button("Очистить");
    clear.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            CandStatisticsForm.this.db1.getTextBox().setText("");
            CandStatisticsForm.this.db2.getTextBox().setText("");
            CandStatisticsForm.this.search1.clear();
            CandStatisticsForm.this.search2.clear();
            CandStatisticsForm.this.setFormData();
          }
        });
    view.setWidth("100px");
    clear.setWidth("100px");
    buttFt.setWidget(0, 0, view);
    buttFt.setWidget(0, 1, clear);

    this.db1.setFormat(
        new DateBox.DefaultFormat(
            DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_MEDIUM)));
    this.db2.setFormat(
        new DateBox.DefaultFormat(
            DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_MEDIUM)));
    this.db1.setValue(new Date());
    this.db2.setValue(new Date());

    ft.setWidget(0, 0, dateFt);
    ft.setWidget(1, 0, this.search1.onInitialize(null));
    ft.setWidget(2, 0, this.search2.onInitialize(null));
    ft.setWidget(3, 0, buttFt);
    FlexTable.FlexCellFormatter format = ft.getFlexCellFormatter();
    format.setHorizontalAlignment(3, 0, HasHorizontalAlignment.ALIGN_CENTER);
    return ft;
  }
コード例 #29
0
ファイル: EventsView.java プロジェクト: sumi/irtk5-old
public class EventsView extends Composite {
  private FlexTable eventsFormTable = new FlexTable();
  FlexCellFormatter cellFormatter = eventsFormTable.getFlexCellFormatter();

  EventsView() {
    initWidget(eventsFormTable);
    eventsFormTable.setWidth("32em");
    eventsFormTable.setCellSpacing(5);
    eventsFormTable.setCellPadding(3);
    cellFormatter.setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_LEFT);
    eventsFormTable.getFlexCellFormatter().setColSpan(1, 0, 2);
    eventsFormTable.setWidget(2, 0, new HTML("Events List"));
  }
}
コード例 #30
0
ファイル: MethodList.java プロジェクト: samizzo/monbulk
  /*
   * (non-Javadoc)
   * @see monbulk.shared.view.iMenuWidget#setActiveMenu(java.lang.String)
   *
   *
   */
  @Override
  public final void setActiveMenu(String activeItem) {

    int count = this._MenuStack.getRowCount();
    int i = 0;
    //		GWT.log("SetActiveMenu Called" + activeItem + count);
    while (i < count) {
      Hidden tmpItem = (Hidden) this._MenuStack.getWidget(i, 1);
      ///			GWT.log("ItemFound:" + tmpItem.getText() + activeItem + tmpItem.getText().length() +
      // activeItem.length());
      GWT.log("Item collected is: " + tmpItem.getValue());
      if (tmpItem != null) {
        if (tmpItem.getValue().contains(activeItem)
            && tmpItem.getValue().length() == activeItem.length()) {
          _MenuStack.getFlexCellFormatter()
              .getElement(i, 0)
              .setAttribute("style", "font-weight:bold;color:#345484;");
          // _MenuStack.getFlexCellFormatter().getElement(i, 1).setAttribute("style",
          // "padding-left:5px;background-color:#345484;");
          // d	_MenuStack.getFlexCellFormatter().getElement(i, 2).setAttribute("style",
          // "background-color:#345484;");
          GWT.log("ItemFound:" + activeItem);
        } else {
          GWT.log("Item reset is " + tmpItem.getValue());
          _MenuStack.getFlexCellFormatter()
              .getElement(i, 0)
              .setAttribute("style", "font-weight:normal;");
          // _MenuStack.getFlexCellFormatter().getElement(i, 1).setAttribute("style",
          // "padding-left:5px;");
          // _MenuStack.getFlexCellFormatter().getElement(i, 2).setAttribute("style", "");
        }
      }
      // tmpItem.setActive(activeItem);
      i++;
    }
  }