private void initComponents() {
    setSpacing(true);
    HorizontalLayout layout = new HorizontalLayout();
    layout.setSpacing(true);
    layout.setWidth("100%");
    cardNuberField = new TextField();
    cardNuberField.setWidth("100%");
    cardNuberField.setInputPrompt("Ноомер социальной карты, либо e-mail");
    layout.addComponent(cardNuberField);
    layout.setComponentAlignment(cardNuberField, Alignment.MIDDLE_RIGHT);
    layout.setExpandRatio(cardNuberField, 1.0f);
    addComponent(layout);

    layout = new HorizontalLayout();
    layout.setSpacing(true);
    layout.setWidth("100%");
    checkwordField = new TextField();
    checkwordField.setWidth("100%");
    checkwordField.setInputPrompt("Проверочное слово");
    layout.addComponent(checkwordField);
    layout.setComponentAlignment(checkwordField, Alignment.MIDDLE_RIGHT);
    layout.setExpandRatio(checkwordField, 1.0f);
    addComponent(layout);

    Button btnSearch = new Button("Найти");
    btnSearch.addClickListener(getSearchClickListener());
    addComponent(btnSearch);
  }
Ejemplo n.º 2
0
  public TaskListHeader() {
    this.i18nManager = ExplorerApp.get().getI18nManager();
    this.taskService = ProcessEngines.getDefaultProcessEngine().getTaskService();
    this.verlayout = new VerticalLayout();

    addStyleName(Reindeer.PANEL_LIGHT);
    addStyleName(ExplorerLayout.STYLE_SEARCHBOX);

    layout = new HorizontalLayout();
    layout.setHeight(36, UNITS_PIXELS);
    layout.setWidth(99, UNITS_PERCENTAGE); // 99, otherwise the Panel will
    // display scrollbars
    layout.setSpacing(true);
    layout.setMargin(false, true, false, true);
    verlayout.addComponent(layout);

    inLayout = new HorizontalLayout();
    inLayout.setHeight(36, UNITS_PIXELS);
    inLayout.setWidth(99, UNITS_PERCENTAGE); // 99, otherwise the Panel will
    // display scrollbars
    inLayout.setSpacing(true);
    inLayout.setMargin(false, true, false, true);

    verlayout.addComponent(layout);
    verlayout.addComponent(inLayout);

    setContent(verlayout);

    initInputField();
    initKeyboardListener();
    // initSortMenu();
  }
Ejemplo n.º 3
0
  private void initLayoutContent() {
    initNavigationButtons();
    initHideWeekEndButton();
    initReadOnlyButton();
    initDisabledButton();
    initAddNewEventButton();

    HorizontalLayout hl = new HorizontalLayout();
    hl.setWidth("100%");
    hl.setSpacing(true);
    hl.setMargin(new MarginInfo(false, false, true, false));
    hl.addComponent(prevButton);
    hl.addComponent(captionLabel);
    hl.addComponent(monthButton);
    hl.addComponent(weekButton);
    hl.addComponent(nextButton);
    hl.setComponentAlignment(prevButton, Alignment.MIDDLE_LEFT);
    hl.setComponentAlignment(captionLabel, Alignment.MIDDLE_CENTER);
    hl.setComponentAlignment(monthButton, Alignment.MIDDLE_CENTER);
    hl.setComponentAlignment(weekButton, Alignment.MIDDLE_CENTER);
    hl.setComponentAlignment(nextButton, Alignment.MIDDLE_RIGHT);

    monthButton.setVisible(viewMode == Mode.WEEK);
    weekButton.setVisible(viewMode == Mode.DAY);

    HorizontalLayout controlPanel = new HorizontalLayout();
    controlPanel.setSpacing(true);
    controlPanel.setMargin(new MarginInfo(false, false, true, false));
    controlPanel.setWidth("100%");
    controlPanel.addComponent(localeSelect);
    controlPanel.addComponent(timeZoneSelect);
    controlPanel.addComponent(formatSelect);
    controlPanel.addComponent(customFirstDayOfWeekSelect);
    controlPanel.addComponent(hideWeekendsButton);
    controlPanel.addComponent(readOnlyButton);
    controlPanel.addComponent(disabledButton);
    controlPanel.addComponent(addNewEvent);

    controlPanel.setComponentAlignment(timeZoneSelect, Alignment.MIDDLE_LEFT);
    controlPanel.setComponentAlignment(formatSelect, Alignment.MIDDLE_LEFT);
    controlPanel.setComponentAlignment(localeSelect, Alignment.MIDDLE_LEFT);
    controlPanel.setComponentAlignment(hideWeekendsButton, Alignment.MIDDLE_LEFT);
    controlPanel.setComponentAlignment(readOnlyButton, Alignment.MIDDLE_LEFT);
    controlPanel.setComponentAlignment(disabledButton, Alignment.MIDDLE_LEFT);
    controlPanel.setComponentAlignment(addNewEvent, Alignment.MIDDLE_LEFT);

    GridLayout layout = (GridLayout) getContent();
    layout.addComponent(controlPanel);
    layout.addComponent(hl);
    layout.addComponent(calendarComponent);
    layout.setRowExpandRatio(layout.getRows() - 1, 1.0f);
  }
Ejemplo n.º 4
0
  void buildLayout() {
    setSizeUndefined();
    setMargin(true);

    HorizontalLayout topActions = new HorizontalLayout(saveButton, cloneDinnerButton);
    topActions.setSpacing(true);

    HorizontalLayout bottomActions = new HorizontalLayout(removeButton, cancelButton);
    bottomActions.setSpacing(true);

    addComponents(topActions, dinnerDate, soup, meat, starch, vegetables, bottomActions);
    setVisible(false);
  }
Ejemplo n.º 5
0
  /*
   * (non-Javadoc)
   *
   * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server.
   * VaadinRequest)
   */
  @Override
  protected void setup(VaadinRequest request) {
    setSizeFull();

    HorizontalLayout layout = new HorizontalLayout();
    layout.setSizeFull();
    layout.setSpacing(true);
    addComponent(layout);

    Table table1 = createTable("no scrolling, has context menu");
    addActionHandler(table1);
    table1.addItem();
    layout.addComponent(table1);

    Table table2 = createTable("should scroll, has context menu");
    for (int i = 0; i < 100; ++i) {
      table2.addItem();
    }
    addActionHandler(table2);
    layout.addComponent(table2);

    Table table3 = createTable("no scrolling, no context menu");
    table3.addItem();
    layout.addComponent(table3);

    Table table4 = createTable("should scroll, no context menu");
    for (int i = 0; i < 100; ++i) {
      table4.addItem();
    }
    layout.addComponent(table4);
  }
Ejemplo n.º 6
0
  private void buildFooterButtons() {

    FooterCell cell = footer.getCell("clientName");

    HorizontalLayout btnLayout = new HorizontalLayout();
    btnLayout.setSpacing(true);

    Button exportBtn = new Button("Export");
    exportBtn.addStyleName(ValoTheme.BUTTON_TINY);
    exportBtn.addStyleName(ValoTheme.BUTTON_FRIENDLY);
    exportBtn.setIcon(FontAwesome.FILE_EXCEL_O);

    Button refreshBtn = new Button("Refresh");
    refreshBtn.addStyleName(ValoTheme.BUTTON_TINY);
    refreshBtn.addStyleName(ValoTheme.BUTTON_FRIENDLY);
    refreshBtn.setIcon(FontAwesome.REFRESH);

    refreshBtn.addClickListener(
        new Button.ClickListener() {

          private static final long serialVersionUID = 1L;

          @Override
          public void buttonClick(ClickEvent event) {

            queryAndRefresh(
                PerisaiUtil.convertDateToString(today, dtFormat),
                PerisaiUtil.convertDateToString(tmrw, dtFormat));
          }
        });

    // btnLayout.addComponent(exportBtn);
    // btnLayout.addComponent(refreshBtn);
    cell.setComponent(btnLayout);
  }
Ejemplo n.º 7
0
  protected void addButtons() {
    // Cancel
    Button cancelButton = new Button(i18nManager.getMessage(Messages.BUTTON_CANCEL));
    cancelButton.addStyleName(Reindeer.BUTTON_SMALL);
    cancelButton.addListener(
        new ClickListener() {
          public void buttonClick(ClickEvent event) {
            close();
          }
        });

    // Delete
    Button deleteButton =
        new Button(i18nManager.getMessage(Messages.DEPLOYMENT_DELETE_POPUP_DELETE_BUTTON));
    deleteButton.addStyleName(Reindeer.BUTTON_SMALL);
    deleteButton.addListener(
        new ClickListener() {
          public void buttonClick(ClickEvent event) {
            // Delete deployment, close popup window and refresh deployment list
            repositoryService.deleteDeployment(deployment.getId(), true);
            close();
            deploymentPage.refreshSelectNext();
          }
        });

    // Alignment
    HorizontalLayout buttonLayout = new HorizontalLayout();
    buttonLayout.setSpacing(true);
    buttonLayout.addComponent(cancelButton);
    buttonLayout.addComponent(deleteButton);
    addComponent(buttonLayout);
    windowLayout.setComponentAlignment(buttonLayout, Alignment.BOTTOM_RIGHT);
  }
Ejemplo n.º 8
0
  private Layout buildButtons(boolean disabled, boolean icon, boolean error, boolean sized) {

    String[] buttonStyles = new String[] {"Normal", "Primary", "Small", "Link"};

    HorizontalLayout hl = new HorizontalLayout();
    hl.setSpacing(true);
    hl.setMargin(true);

    for (int i = 0; i < buttonStyles.length; i++) {
      Button b;
      if (nativeButtons) {
        b = new NativeButton(buttonStyles[i] + " style");
      } else {
        b = new Button(buttonStyles[i] + " style");
      }
      b.setStyleName(buttonStyles[i].toLowerCase());
      if (icon) {
        b.setIcon(
            new ThemeResource("../runo/icons/" + (largeIcons ? "64" : "16") + "/document.png"));
      }
      if (error) {
        b.setComponentError(new UserError("Error"));
      }
      if (disabled) {
        b.setEnabled(false);
      }
      if (sized) {
        b.setWidth("250px");
        b.setCaption(b.getCaption() + " (250px)");
      }
      hl.addComponent(b);
    }

    return hl;
  }
Ejemplo n.º 9
0
  private Component buildFields() {
    HorizontalLayout fields = new HorizontalLayout();
    fields.setSpacing(true);
    fields.addStyleName("fields");

    username = new TextField("Usuario");
    username.setIcon(FontAwesome.USER);
    username.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    username.focus();

    clave = new PasswordField("Contraseña");
    clave.setIcon(FontAwesome.LOCK);
    clave.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);

    final Button signin = new Button("Entrar");
    signin.addStyleName(ValoTheme.BUTTON_PRIMARY);
    signin.setClickShortcut(KeyCode.ENTER);

    fields.addComponents(username, clave, signin);
    fields.setComponentAlignment(signin, Alignment.BOTTOM_LEFT);

    signin.addClickListener(
        new ClickListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void buttonClick(final ClickEvent event) {

            doLogin();
          }
        });
    return fields;
  }
Ejemplo n.º 10
0
 @Override
 public Layout startLayout() {
   VerticalLayout vl = new VerticalLayout();
   vl.setMargin(true);
   vl.setSpacing(true);
   Label tps = new Label("Temps de scan estimé : " + Ping.TPS);
   Label desc = new Label(Ping.DESCRITPION, ContentMode.HTML);
   HorizontalLayout hl = new HorizontalLayout();
   hl.setMargin(true);
   hl.setSpacing(true);
   @SuppressWarnings("serial")
   Button start =
       new ScanStartButton() {
         @Override
         public void onClick() {
           ping.start(site);
           panel.setContent(runningLayout());
         }
       };
   hl.addComponents(start);
   hl.setSizeUndefined();
   vl.addComponents(desc, tps, hl);
   vl.setComponentAlignment(hl, Alignment.MIDDLE_CENTER);
   return vl;
 }
  public CrmPreviewFormControlsGenerator(final AdvancedPreviewBeanForm<T> editForm) {
    this.previewForm = editForm;

    editButtons = new HorizontalLayout();
    editButtons.setSpacing(true);
    editButtons.addStyleName("edit-btn");
  }
Ejemplo n.º 12
0
  @AutoGenerated
  private HorizontalLayout buildHorizontalLayout_1() {
    // common part: create layout
    horizontalLayout_1 = new HorizontalLayout();
    horizontalLayout_1.setImmediate(false);
    horizontalLayout_1.setWidth("-1px");
    horizontalLayout_1.setHeight("-1px");
    horizontalLayout_1.setMargin(false);
    horizontalLayout_1.setSpacing(true);

    // cmbPolicia
    cmbPolicia = new ComboBox();
    cmbPolicia.setCaption("Policia");
    cmbPolicia.setImmediate(false);
    cmbPolicia.setWidth("230px");
    cmbPolicia.setHeight("-1px");
    horizontalLayout_1.addComponent(cmbPolicia);

    // btnAgregarPolicia
    btnAgregarPolicia = new Button();
    btnAgregarPolicia.setCaption(" ");
    btnAgregarPolicia.setImmediate(true);
    btnAgregarPolicia.setWidth("-1px");
    btnAgregarPolicia.setHeight("-1px");
    horizontalLayout_1.addComponent(btnAgregarPolicia);
    horizontalLayout_1.setComponentAlignment(btnAgregarPolicia, new Alignment(9));

    return horizontalLayout_1;
  }
Ejemplo n.º 13
0
  /**
   * 页面底部版权 Bar
   *
   * @return
   */
  public HorizontalLayout getPageFooter() {
    // 底部公司介绍 水平布局
    HorizontalLayout footer = new HorizontalLayout();
    footer.setWidth(100, Unit.PERCENTAGE);
    footer.setMargin(true);
    footer.addStyleName(Reindeer.LAYOUT_BLACK);
    // -----------------------底部公司介绍-------------------------------
    Label lbcopyright = new Label("Copyright 2014");
    lbcopyright.setSizeUndefined();
    // lbcopyright.addStyleName(Reindeer.LABEL_H2);
    Label lbcompany = new Label("上海释伟科技有限公司");
    // lbcompany.addStyleName(Reindeer.LABEL_H2);
    Label lbdesc = new Label("留夫鸭电子商务O2O解决方案");
    // lbdesc.addStyleName(Reindeer.LABEL_H2);

    Label lbspace = new Label(); // 占位空间
    lbspace.setWidth(520, Unit.PIXELS);

    footer.setSpacing(true); // 设置间隙
    footer.addComponent(lbcopyright);
    footer.setComponentAlignment(lbcopyright, Alignment.MIDDLE_LEFT);

    // footer.addComponent(lbspace);
    footer.addComponent(lbdesc);
    footer.setComponentAlignment(lbdesc, Alignment.MIDDLE_LEFT);

    footer.addComponent(lbspace);
    footer.addComponent(lbcompany);
    footer.setComponentAlignment(lbcompany, Alignment.MIDDLE_LEFT);

    return footer;
  }
Ejemplo n.º 14
0
  public ConfirmationDialog(String caption, String description) {
    setCaption(caption);
    setModal(true);
    setResizable(false);
    setClosable(false);
    setWidth(400, Unit.PIXELS);
    setHeight(200, Unit.PIXELS);
    addCloseListener(this);

    okButton = UIHelper.createButton("ok", null, null, this);
    okButton.setId("confirmationDialog.button.ok");
    cancelButton = UIHelper.createButton("cancel", "cancels the current action.", null, this);
    cancelButton.setId("confirmationDialog.button.cancel");
    label.setDescription(description);

    final HorizontalLayout buttonLayout = new HorizontalLayout(okButton, cancelButton);
    buttonLayout.setSpacing(true);

    layout.setSpacing(true);
    layout.setMargin(true);
    layout.setSizeFull();
    layout.addComponent(label);
    layout.addComponent(buttonLayout);
    layout.setComponentAlignment(buttonLayout, Alignment.BOTTOM_RIGHT);

    setContent(layout);
    center();
  }
Ejemplo n.º 15
0
  private com.vaadin.ui.Component buildFields() {
    HorizontalLayout fields = new HorizontalLayout();
    fields.setSpacing(true);
    fields.addStyleName("fields");

    final TextField username = new TextField("Username");
    username.setIcon(FontAwesome.USER);
    username.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);

    final PasswordField password = new PasswordField("Password");
    password.setIcon(FontAwesome.LOCK);
    password.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);

    final Button signin = new Button("Sign In");
    signin.addStyleName(ValoTheme.BUTTON_PRIMARY);
    signin.setClickShortcut(ShortcutAction.KeyCode.ENTER);
    signin.focus();

    fields.addComponents(username, password, signin);
    fields.setComponentAlignment(signin, Alignment.BOTTOM_LEFT);

    signin.addClickListener(
        new Button.ClickListener() {
          @Override
          public void buttonClick(final Button.ClickEvent event) {
            DashboardEventBus.post(
                new UserLoginRequestedEvent(username.getValue(), password.getValue()));
          }
        });
    return fields;
  }
Ejemplo n.º 16
0
  public HorizontalLayout createTopBar() {
    TextField filter = new TextField();
    filter.setStyleName("filter-textfield");
    filter.setInputPrompt("Filter");
    ResetButtonForTextField.extend(filter);
    filter.setImmediate(true);
    filter.addTextChangeListener(
        new FieldEvents.TextChangeListener() {
          @Override
          public void textChange(FieldEvents.TextChangeEvent event) {
            grid.setFilter(event.getText());
          }
        });

    newProduct = new Button("New product");
    newProduct.addStyleName(ValoTheme.BUTTON_PRIMARY);
    newProduct.setIcon(FontAwesome.PLUS_CIRCLE);
    newProduct.addClickListener(
        new ClickListener() {
          @Override
          public void buttonClick(ClickEvent event) {
            viewLogic.newProduct();
          }
        });

    HorizontalLayout topLayout = new HorizontalLayout();
    topLayout.setSpacing(true);
    topLayout.setWidth("100%");
    topLayout.addComponent(filter);
    topLayout.addComponent(newProduct);
    topLayout.setComponentAlignment(filter, Alignment.MIDDLE_LEFT);
    topLayout.setExpandRatio(filter, 1);
    topLayout.setStyleName("top-bar");
    return topLayout;
  }
Ejemplo n.º 17
0
  @AutoGenerated
  private HorizontalLayout buildHorizontalLayout_2() {
    // common part: create layout
    horizontalLayout_2 = new HorizontalLayout();
    horizontalLayout_2.setImmediate(false);
    horizontalLayout_2.setWidth("-1px");
    horizontalLayout_2.setHeight("-1px");
    horizontalLayout_2.setMargin(true);
    horizontalLayout_2.setSpacing(true);

    // btnCrearUsuario
    btnCrearUsuario = new Button();
    btnCrearUsuario.setCaption("Crear");
    btnCrearUsuario.setImmediate(true);
    btnCrearUsuario.setWidth("80px");
    btnCrearUsuario.setHeight("-1px");
    horizontalLayout_2.addComponent(btnCrearUsuario);

    // btnEliminarUsuario
    btnEliminarUsuario = new Button();
    btnEliminarUsuario.setCaption("Eliminar");
    btnEliminarUsuario.setImmediate(true);
    btnEliminarUsuario.setWidth("-1px");
    btnEliminarUsuario.setHeight("-1px");
    horizontalLayout_2.addComponent(btnEliminarUsuario);

    return horizontalLayout_2;
  }
Ejemplo n.º 18
0
 private void assembleSearchLayout() {
   logger.info(
       "Company ID : "
           + companyId
           + " | User Name : "
           + userName
           + " > "
           + "Assembling search layout");
   // Remove all components in User Search Layout
   hlSearchLayout.removeAllComponents();
   cbPayPeried.setRequired(true);
   cbBranch.setRequired(true);
   vlSrchRsltContainer.setVisible(true);
   hlCmdBtnLayout.setVisible(false);
   // Add components for Search Layout
   FormLayout formLayout1 = new FormLayout();
   FormLayout formLayout2 = new FormLayout();
   FormLayout formLayout3 = new FormLayout();
   FormLayout formLayout4 = new FormLayout();
   formLayout1.addComponent(cbPayPeried);
   formLayout1.setSpacing(true);
   formLayout2.addComponent(tfProcessPeriod);
   formLayout2.setSpacing(true);
   formLayout3.addComponent(cbBranch);
   formLayout3.setSpacing(true);
   formLayout4.addComponent(cbEmployeeName);
   formLayout4.setSpacing(true);
   HorizontalLayout hlAttendanceProc1 = new HorizontalLayout();
   hlAttendanceProc1.addComponent(formLayout1);
   hlAttendanceProc1.addComponent(formLayout2);
   hlAttendanceProc1.addComponent(formLayout3);
   hlAttendanceProc1.addComponent(formLayout4);
   hlAttendanceProc1.addComponent(btnSearchStaff);
   hlAttendanceProc1.setComponentAlignment(btnSearchStaff, Alignment.MIDDLE_RIGHT);
   hlAttendanceProc1.setSpacing(true);
   HorizontalLayout hlAttendanceProc2 = new HorizontalLayout();
   hlAttendanceProc2.addComponent(btnAttendanceProc);
   hlAttendanceProc2.setSizeFull();
   hlAttendanceProc2.setComponentAlignment(btnAttendanceProc, Alignment.MIDDLE_RIGHT);
   VerticalLayout vlAttendanceProc1 = new VerticalLayout();
   vlAttendanceProc1.addComponent(hlAttendanceProc1);
   vlAttendanceProc1.addComponent(hlAttendanceProc2);
   hlSearchLayout.addComponent(vlAttendanceProc1);
   hlSearchLayout.setSpacing(true);
   hlSearchLayout.setMargin(true);
   btnSearch.setVisible(false);
 }
Ejemplo n.º 19
0
  /**
   * Build content 'evaluation process' of tab 3.
   *
   * @return content of third tab
   */
  private Layout buildTab3Content() {
    VerticalLayout tab3Content = new VerticalLayout();
    tab3Content.setSpacing(true);
    tab3Content.setMargin(true);
    tab3Content.setSizeFull();

    Label instructions =
        new Label(
            "<b>Instructions:</b> <i>Please select and click a sentence below in order to process the evaluation.</i>",
            Label.CONTENT_XHTML);
    tab3Content.addComponent(instructions);

    this.tableEvaluation = new Table("Evaluation process:");
    tableEvaluation.setHeight("150px");
    tableEvaluation.setWidth("100%");
    tableEvaluation.setImmediate(true);
    tableEvaluation.setSelectable(true);
    tableEvaluation.setMultiSelect(false);
    tableEvaluation.setSortDisabled(false);
    tableEvaluation.addContainerProperty("ID", Integer.class, null);
    tableEvaluation.addContainerProperty("Sentence", String.class, null);
    tableEvaluation.addContainerProperty("Precision", Double.class, null);
    tableEvaluation.addContainerProperty("Recall", Double.class, null);
    tableEvaluation.addContainerProperty("F-Score", Double.class, null);
    tab3Content.addComponent(tableEvaluation);

    this.buttonNext2 = new Button("Next");
    buttonNext2.setImmediate(true);
    buttonNext2.setDescription("Get the next sentence in table");
    tab3Content.addComponent(buttonNext2);

    this.textAreaEvalSentence = new TextArea("Sentence:");
    textAreaEvalSentence.setImmediate(false);
    textAreaEvalSentence.setReadOnly(true);
    textAreaEvalSentence.setRows(3);
    textAreaEvalSentence.setWidth("100%");
    tab3Content.addComponent(textAreaEvalSentence);

    HorizontalLayout hlay1 = new HorizontalLayout();
    this.listSelectGoldstandard = new ListSelect("Goldstandard:");
    listSelectGoldstandard.setImmediate(true);
    listSelectGoldstandard.setHeight("120px");
    listSelectGoldstandard.setWidth("100%");
    listSelectGoldstandard.setNullSelectionAllowed(false);
    this.listSelectFramework = new ListSelect("Framework:");
    listSelectFramework.setImmediate(true);
    listSelectFramework.setHeight("120px");
    listSelectFramework.setWidth("100%");
    listSelectFramework.setNullSelectionAllowed(false);
    hlay1.setSpacing(true);
    hlay1.setMargin(false);
    hlay1.setWidth("100%");
    hlay1.addComponent(listSelectGoldstandard);
    hlay1.addComponent(listSelectFramework);
    tab3Content.addComponent(hlay1);

    return tab3Content;
  }
Ejemplo n.º 20
0
  public LoadForm(BWPresentation bwPresentation) {
    bwSpecReceiver = new SpecificationReceiver(bwPresentation);

    // Upload buttons
    setMargin(true);
    setWidth("320px");
    setHeight("120px");

    // Load goal specification (upload)
    Upload uploadBW =
        new Upload("Upload the Blended Workflow specification here:", this.bwSpecReceiver);
    uploadBW.setButtonCaption("Submit");
    uploadBW.addListener((Upload.SucceededListener) this.bwSpecReceiver);
    uploadBW.addListener((Upload.FailedListener) this.bwSpecReceiver);

    HorizontalLayout submitPanel = new HorizontalLayout();
    submitPanel.setSpacing(true);
    Button bwSpecificationLoadBtn = new Button("Load");
    bwSpecificationLoadBtn.addListener(
        new ClickListener() {
          @Atomic(mode = TxMode.WRITE)
          @Override
          public void buttonClick(ClickEvent event) {
            try {
              String bwSpec = bwSpecReceiver.getSpecInString();
              if (bwSpec != null) {
                BlendedWorkflow.getInstance().getBwManager().loadBWSpecification(bwSpec);
                getApplication().getMainWindow().removeWindow(LoadForm.this.getWindow());
              } else {
                getApplication()
                    .getMainWindow()
                    .showNotification("Blended Workflow Specification missing");
              }
            } catch (java.lang.NullPointerException jle) {
              getApplication()
                  .getMainWindow()
                  .showNotification(
                      "Please upload a Blended Workflow Specifications",
                      Notification.TYPE_ERROR_MESSAGE);
            }
          }
        });
    submitPanel.addComponent(bwSpecificationLoadBtn);

    Button cancel = new Button("Cancel");
    cancel.addListener(
        new Button.ClickListener() {
          @Override
          public void buttonClick(ClickEvent event) {
            getApplication().getMainWindow().removeWindow(LoadForm.this.getWindow());
          }
        });
    submitPanel.addComponent(cancel);

    addComponent(uploadBW);
    addComponent(submitPanel);
    setComponentAlignment(submitPanel, Alignment.BOTTOM_CENTER);
  }
Ejemplo n.º 21
0
    private void createBasicSearchLayout() {
      final HorizontalLayout basicSearchBody = new HorizontalLayout();
      basicSearchBody.setStyleName("message-search");
      basicSearchBody.setSizeUndefined();
      basicSearchBody.setSpacing(false);

      final TextField nameField = new TextField();
      nameField.addTextChangeListener(
          new TextChangeListener() {
            @Override
            public void textChange(final TextChangeEvent event) {
              MessageSearchPanel.this.messageSearchCriteria = new MessageSearchCriteria();

              MessageSearchPanel.this.messageSearchCriteria.setProjectids(
                  new SetSearchField<Integer>(
                      SearchField.AND, MessageSearchPanel.this.project.getId()));

              MessageSearchPanel.this.textSearch = event.getText().toString().trim();

              MessageSearchPanel.this.messageSearchCriteria.setMessage(
                  new StringSearchField(MessageSearchPanel.this.textSearch));

              MessageSearchPanel.this.notifySearchHandler(
                  MessageSearchPanel.this.messageSearchCriteria);
            }
          });

      nameField.setTextChangeEventMode(TextChangeEventMode.LAZY);
      nameField.setTextChangeTimeout(200);
      nameField.setWidth(UIConstants.DEFAULT_CONTROL_WIDTH);
      UiUtils.addComponent(basicSearchBody, nameField, Alignment.MIDDLE_LEFT);

      final Button searchBtn = new Button();
      searchBtn.addClickListener(
          new Button.ClickListener() {
            private static final long serialVersionUID = 1L;

            @Override
            public void buttonClick(final Button.ClickEvent event) {
              MessageSearchPanel.this.messageSearchCriteria = new MessageSearchCriteria();

              MessageSearchPanel.this.messageSearchCriteria.setProjectids(
                  new SetSearchField<Integer>(
                      SearchField.AND, MessageSearchPanel.this.project.getId()));

              MessageSearchPanel.this.messageSearchCriteria.setMessage(
                  new StringSearchField(MessageSearchPanel.this.textSearch));

              MessageSearchPanel.this.notifySearchHandler(
                  MessageSearchPanel.this.messageSearchCriteria);
            }
          });
      searchBtn.setStyleName("search-icon-button");
      searchBtn.setIcon(MyCollabResource.newResource("icons/16/search_white.png"));
      basicSearchBody.addComponent(searchBtn);

      this.setCompositionRoot(basicSearchBody);
    }
Ejemplo n.º 22
0
  private void buildLayout() {
    setSizeUndefined();
    setMargin(true);

    HorizontalLayout actions = new HorizontalLayout(save, cancel);
    actions.setSpacing(true);

    addComponents(actions, firstName, lastName, phone, email, birthDate);
  }
Ejemplo n.º 23
0
  private void buildLayout() {
    setSizeUndefined();
    setMargin(true);

    HorizontalLayout actions = new HorizontalLayout(save, cancel);
    actions.setSpacing(true);

    addComponents(actions, name, nominal, description, variantField, priceField, sourceLink);
  }
Ejemplo n.º 24
0
  @PostConstruct
  public void PostConstruct() {
    setSizeFull();
    VerticalLayout layout = new VerticalLayout();
    layout.setSpacing(true);
    layout.setMargin(true);

    HorizontalLayout usernameLayout = new HorizontalLayout();
    usernameLayout.setSpacing(true);
    usernameLayout.addComponent(new Label("Username:"******"Roles:"));
    userRolesLayout.addComponent(rolesLabel);

    layout.addComponent(usernameLayout);
    layout.addComponent(userRolesLayout);

    Link userView =
        new Link(
            "ROLE_USER View (disabled, if user doesn't have access)",
            new ExternalResource("#!" + RoleUserView.NAME));
    Link roleView =
        new Link(
            "ROLE_ADMIN View (disabled, if user doesn't have access)",
            new ExternalResource("#!" + RoleAdminView.NAME));

    userView.setEnabled(SpringSecurityHelper.hasRole("ROLE_USER"));
    roleView.setEnabled(SpringSecurityHelper.hasRole("ROLE_ADMIN"));

    layout.addComponent(userView);
    layout.addComponent(roleView);
    layout.addComponent(
        new Link(
            "ROLE_ADMIN View (throw exception, if user doesn't have access)",
            new ExternalResource("#!" + RoleAdminView.NAME)));

    layout.addComponent(new Link("Logout", new ExternalResource("/j_spring_security_logout")));

    setContent(layout);
  }
Ejemplo n.º 25
0
  @Override
  public Component getTestComponent() {
    addedVectorsLayout = new HorizontalLayout();
    addedVectorsLayout.setSpacing(true);
    content.addComponent(addedVectorsLayout);

    OpenLayersMap openLayersMap = new OpenLayersMap();
    addBaseLayer(openLayersMap);
    return openLayersMap;
  }
Ejemplo n.º 26
0
    private HorizontalLayout buildToolbarButtons() {

      HorizontalLayout toolbarLayout = new HorizontalLayout();
      toolbarLayout.setImmediate(false);
      toolbarLayout.setSpacing(true);

      ButtonGroup toolbar = new ButtonGroup();
      HorizontalLayout innerToolbarLayout = new HorizontalLayout();
      innerToolbarLayout.setSpacing(true);

      // createMenuFolderResourceButton;
      createMenuFolderResourceButton = new Button("Crear menu");
      createMenuFolderResourceButton.setIcon(
          new ThemeResource(ConfiguratorModule.MODULE_ICONS_PATH + "folder--plus.png"));
      createMenuFolderResourceButton.addListener(
          configuratedModulesComponent.new CreateMenuFolderResourceHandler());
      toolbar.addButton(createMenuFolderResourceButton);

      // removeMenuResourceButton;
      removeMenuResourceButton = new Button("Borrar");
      removeMenuResourceButton.setIcon(
          new ThemeResource(ConfiguratorModule.MODULE_ICONS_PATH + "cross.png"));
      removeMenuResourceButton.addListener(
          configuratedModulesComponent
          .new RemoveMenuResourceHandler(
              availableModulesComponent.getAvailableModuleTableContainer()));
      toolbar.addButton(removeMenuResourceButton);

      innerToolbarLayout.addComponent(toolbar);

      // ApplyChangesButton
      applyChangesButton = new Button("Aplicar cambios");
      applyChangesButton.setIcon(
          new ThemeResource(ConfiguratorModule.MODULE_ICONS_PATH + "disks-black.png"));
      applyChangesButton.setEnabled(false);
      applyChangesButton.addListener(
          configuratedModulesComponent.new ApplyMenuResourceChangesHandler());
      innerToolbarLayout.addComponent(applyChangesButton);

      toolbarLayout.addComponent(innerToolbarLayout);

      return toolbarLayout;
    }
Ejemplo n.º 27
0
  /**
   * LanguageSelect constructor.
   *
   * @param inPreferences {@link PreferencesHelper}
   * @param inConfigManager {@link ConfigManager}
   * @param inUser {@link User}
   */
  public LanguageSelect(
      final PreferencesHelper inPreferences,
      final ConfigManager inConfigManager,
      final User inUser) {
    super();
    // initialize language form prefs (1) or config admin (2)
    // final String lActiveLanguage = inPreferences.getLocale(inUser,
    // new Locale(inConfigManager.getLanguage())).getLanguage();

    setStyleName("ripla-language-select"); // $NON-NLS-1$
    setSizeUndefined();

    layout = new HorizontalLayout();
    setCompositionRoot(layout);
    layout.setHeight(22, Unit.PIXELS);
    layout.setSpacing(true);

    final Label lLabel =
        new Label(
            Activator.getMessages().getMessage("toolbar.label.language"),
            ContentMode.HTML); // $NON-NLS-1$
    lLabel.setStyleName("ripla-toolbar-label"); // $NON-NLS-1$
    lLabel.setSizeUndefined();
    layout.addComponent(lLabel);
    layout.setComponentAlignment(lLabel, Alignment.MIDDLE_LEFT);
    layout.setExpandRatio(lLabel, 1);

    select = createSelect();
    select.addValueChangeListener(
        new Property.ValueChangeListener() {
          @Override
          public void valueChange(final ValueChangeEvent inEvent) {
            final Locale lNew = ((LocaleAdapter) select.getValue()).getLocale();
            final Locale lOld = VaadinSession.getCurrent().getLocale();
            if (!lOld.equals(lNew)) {
              VaadinSession.getCurrent().setLocale(lNew);
              if (listener != null) {
                listener.processAction(
                    new IToolbarAction() {
                      @Override
                      public void run() {
                        LOG.trace("Setting language preference to {}.", lNew.getLanguage());
                        VaadinSession.getCurrent()
                            .getAttribute(IRiplaEventDispatcher.class)
                            .dispatch(
                                org.ripla.interfaces.IRiplaEventDispatcher.Event.REFRESH,
                                new HashMap<String, Object>());
                      }
                    });
              }
            }
          }
        });
    layout.addComponent(select);
  }
Ejemplo n.º 28
0
 /** @return */
 protected Component buildToolbar() {
   // TODO add custom component with previous/next page buttons and export pdf
   HorizontalLayout content = new HorizontalLayout();
   content.setSizeFull();
   content.setSpacing(true);
   content.addComponent(buildReportSelection());
   content.addComponent(buildExportSelection());
   content.addComponent(buildReportOptions());
   Panel panel = new Panel();
   panel.setContent(content);
   return panel;
 }
Ejemplo n.º 29
0
 private HorizontalLayout createPanelLayout(
     final String msg, final AbstractTextField textField, final String textValue) {
   HorizontalLayout msgLayout = new HorizontalLayout();
   msgLayout.setSpacing(true);
   Label msgLabel = new Label(msg);
   msgLabel.setWidth("65px");
   textField.setWidth("150px");
   msgLayout.addComponent(msgLabel);
   msgLayout.addComponent(textField);
   textField.setValue(textValue);
   return msgLayout;
 }
Ejemplo n.º 30
0
  Layout getHeader() {
    HorizontalLayout header = new HorizontalLayout();
    header.setWidth("100%");
    header.setMargin(false);
    header.setSpacing(true);

    ThemeResource themeResource = new ThemeResource("icons/processbase.png");
    Embedded logo = new Embedded();
    logo.setSource(themeResource);
    logo.setType(Embedded.TYPE_IMAGE);

    header.addComponent(logo);
    header.setExpandRatio(logo, 1.0f);
    Label helloUser;
    if (StringUtils.isEmpty(user.firstName) && StringUtils.isEmpty(user.lastName))
      helloUser = new Label(getPbMessages("welcome") + ", " + user.username);
    else
      helloUser = new Label(getPbMessages("welcome") + ", " + user.firstName + " " + user.lastName);
    //        helloUser.setStyleName(Runo.LABEL_H2);
    header.addComponent(helloUser);
    header.setComponentAlignment(helloUser, Alignment.MIDDLE_RIGHT);
    header.setExpandRatio(helloUser, 1.0f);

    if (!BPMModule.USER_GUEST.equals(user.username)) {
      Button profile =
          new Button(
              getPbMessages("btnProfile"),
              new Button.ClickListener() {

                public void buttonClick(ClickEvent event) {
                  openProfileWindow();
                }
              });
      profile.setStyleName(Runo.BUTTON_LINK);
      header.addComponent(profile);
      header.setComponentAlignment(profile, Alignment.MIDDLE_RIGHT);
    }
    Button logout =
        new Button(
            getPbMessages("btnLogout"),
            new Button.ClickListener() {

              public void buttonClick(ClickEvent event) {
                openLogoutWindow();
              }
            });
    logout.setStyleName(Runo.BUTTON_LINK);
    header.addComponent(logout);
    header.setComponentAlignment(logout, Alignment.MIDDLE_RIGHT);

    return header;
  }