Exemple #1
0
  /** @param errorMsg the error description */
  public ErrorScreen(String errorMsg) {
    super();
    Label label;

    setSizeFull();

    // logoComponent: horizontal layout (label left + image + label right)
    HorizontalLayout logoComponent = new HorizontalLayout();
    logoComponent.setWidth("100%");

    label = new Label();
    logoComponent.addComponent(label);
    logoComponent.setExpandRatio(label, 1.0f);

    Resource res = LibResource.getImgResource("splash_image.png");
    if (res != null) {
      Image img = LibImage.getImage(res);
      logoComponent.addComponent(img);
    }

    label = new Label();
    logoComponent.addComponent(label);
    logoComponent.setExpandRatio(label, 1.0f);

    // msgComponent: (label left + msg label + label right)
    HorizontalLayout msgComponent = new HorizontalLayout();
    msgComponent.setWidth("100%");

    label = new Label();
    msgComponent.addComponent(label);
    msgComponent.setExpandRatio(label, 1.0f);
    // label.addStyleName("blueBg");

    msgLabel = new Label(errorMsg);
    msgComponent.addComponent(msgLabel);
    msgLabel.setWidthUndefined();
    msgLabel.addStyleName("error-screen-msg");

    label = new Label();
    msgComponent.addComponent(label);
    msgComponent.setExpandRatio(label, 1.0f);
    // label.addStyleName("blueBg");

    // add components to this vertical layout
    label = new Label();
    addComponent(label);
    setExpandRatio(label, 1.0f);

    addComponent(logoComponent);

    label = new Label();
    addComponent(label);
    setExpandRatio(label, 0.3f);

    addComponent(msgComponent);

    label = new Label();
    addComponent(label);
    setExpandRatio(label, 1.0f);
  }
  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);
  }
  public void onSuccessfulLogin2() {

    this.context = (WebApplicationContext) getContext();
    context
        .getHttpSession()
        .setAttribute("session", HibernateUtil.getSessionFactory().openSession());
    context.getHttpSession().setAttribute("userName", userCurrent.getName());
    controlUserPermissions = new ControlUserPermissions(userCurrent, context);

    String propName = this.getProperty("pathEntityOrder");
    String propPath =
        this.getContext().getBaseDirectory().getAbsolutePath() + File.separator + propName;
    HibernateUtil.getEntityOrder(propPath);

    /**
     * ******************************************** Cabecera
     * ******************************************************
     */
    HorizontalLayout headHorizontalLayout = new HorizontalLayout();
    headHorizontalLayout.setWidth("100%");
    headHorizontalLayout.setHeight("80");
    logoPNG = new Embedded(null, new ThemeResource("images/logo.png"));
    logoPNG.setWidth("140");
    logoPNG.setHeight("60");
    headHorizontalLayout.addComponent(logoPNG);
    headHorizontalLayout.setComponentAlignment(logoPNG, Alignment.MIDDLE_LEFT);
    headHorizontalLayout.setExpandRatio(logoPNG, 3);
    UserTab userTab = new UserTab(this);
    headHorizontalLayout.addComponent(userTab);
    headHorizontalLayout.setComponentAlignment(userTab, Alignment.MIDDLE_RIGHT);
    headHorizontalLayout.setExpandRatio(userTab, 1);
    /**
     * *********************************************************************
     * ***************************************
     */
    /**
     * ******************************************** Barra Menú
     * ****************************************************
     */
    toolbar = new YacareToolbar(this);
    /**
     * *********************************************************************
     * ***************************************
     */
    /**
     * ******************************************** Cuerpo de página
     * **********************************************
     */
    bodyPageVerticalLayout = new VerticalLayout();
    bodyPageVerticalLayout.addComponent(headHorizontalLayout);
    bodyPageVerticalLayout.addComponent(toolbar);
    YacareFooter footer = new YacareFooter();
    bodyPageVerticalLayout.addComponent(footer);
    bodyPageVerticalLayout.setComponentAlignment(footer, Alignment.BOTTOM_CENTER);
    /**
     * *********************************************************************
     * ***************************************
     */
    getMainWindow().setContent(bodyPageVerticalLayout);
  }
Exemple #4
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;
  }
  @AutoGenerated
  private HorizontalLayout buildWorkAreaLayout() {
    // common part: create layout
    workAreaLayout = new HorizontalLayout();
    workAreaLayout.setImmediate(false);
    workAreaLayout.setWidth("100.0%");
    workAreaLayout.setHeight("100.0%");
    workAreaLayout.setMargin(false);

    // availableModulesComponent
    availableModulesComponent = new AvailableModulesComponent();
    availableModulesComponent.setImmediate(false);
    availableModulesComponent.setWidth("-1px");
    availableModulesComponent.setHeight("100.0%");
    workAreaLayout.addComponent(availableModulesComponent);

    // configuratedModulesComponent
    configuratedModulesComponent = new ConfiguratedModulesComponent();
    configuratedModulesComponent.setImmediate(false);
    configuratedModulesComponent.setWidth("100.0%");
    configuratedModulesComponent.setHeight("100.0%");
    workAreaLayout.addComponent(configuratedModulesComponent);
    workAreaLayout.setExpandRatio(configuratedModulesComponent, 1.0f);

    return workAreaLayout;
  }
  @AutoGenerated
  private HorizontalLayout buildConfirmDiv() {
    // common part: create layout
    confirmDiv = new HorizontalLayout();
    confirmDiv.setImmediate(false);
    confirmDiv.setWidth("100.0%");
    confirmDiv.setHeight("100.0%");
    confirmDiv.setMargin(false);

    // confirmLabel
    confirmLabel = new Label();
    confirmLabel.setImmediate(false);
    confirmLabel.setWidth("52px");
    confirmLabel.setHeight("-1px");
    confirmLabel.setValue("Confirm:");
    confirmDiv.addComponent(confirmLabel);
    confirmDiv.setComponentAlignment(confirmLabel, new Alignment(9));

    // passwordConfirm
    passwordConfirm = new PasswordField();
    passwordConfirm.setCaption("Need confirm password:"******"195px");
    passwordConfirm.setHeight("20px");
    passwordConfirm.setRequired(true);
    confirmDiv.addComponent(passwordConfirm);
    confirmDiv.setExpandRatio(passwordConfirm, 1.0f);
    confirmDiv.setComponentAlignment(passwordConfirm, new Alignment(34));

    return confirmDiv;
  }
Exemple #7
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;
  }
Exemple #8
0
  public void initializeAddBtnPanel() {
    btnAdd = initSizeButton(btnAdd, "Agregar", ">", null);
    btnAddAll = initSizeButton(btnAddAll, "Agregar Todos", ">>", null);
    btnRemove = initSizeButton(btnRemove, "Quitar", "<", null);
    btnRemoveAll = initSizeButton(btnRemoveAll, "Quitar Todos", "<<", null);

    panelAddButton = new VerticalLayout();
    panelAddButton.setMargin(false);
    panelAddButton.setHeight("100%");
    panelAddButton.setWidth("100%");

    GridLayout grid = new GridLayout(1, 4);
    grid.setWidth("90%");
    grid.setHeight("50%");

    grid.addComponent(btnAddAll, 0, 0);
    grid.setComponentAlignment(btnAddAll, Alignment.MIDDLE_CENTER);
    grid.addComponent(btnRemoveAll, 0, 3);
    grid.setComponentAlignment(btnRemoveAll, Alignment.MIDDLE_CENTER);
    panelAddButton.addComponent(grid);
    panelAddButton.setComponentAlignment(grid, Alignment.MIDDLE_CENTER);

    mainPanel.addComponent(panelAddButton);
    mainPanel.setExpandRatio(panelAddButton, new Float(0.10));
  }
  private void initLayout() {
    horizontalLayout = new HorizontalLayout();

    uriFragmentUtility.addListener(
        new FragmentChangedListener() {
          @Override
          public void fragmentChanged(FragmentChangedEvent source) {
            String fragment = uriFragmentUtility.getFragment();
            if (!uriCallbacks.isEmpty() && Strings.hasText(fragment)) {
              for (UriChangedCallback callback : uriCallbacks) {
                callback.handle(fragment);
              }
            }
          }
        });

    activityQueuesPane = new ActivityQueuesPane(this);
    initViewController();
    activityQueuesPane.refreshData();
    viewController.displayCurrentView();

    removeAllComponents();

    showHideButton0 = new Button();
    showHideButton0.setStyleName(BaseTheme.BUTTON_LINK);
    showHideButton0.setIcon(resourceCache.getImage("/img/guzik_1.png"));
    showHideButton0.setSizeFull();

    showHideButton1 = new Button();
    showHideButton1.setStyleName(BaseTheme.BUTTON_LINK);
    showHideButton1.setIcon(resourceCache.getImage("/img/guzik_2.png"));

    showHideButton2 = new Button();
    showHideButton2.setStyleName(BaseTheme.BUTTON_LINK);
    showHideButton2.setIcon(resourceCache.getImage("/img/guzik_2.png"));
    final VerticalLayout leftPanel =
        verticalLayout(
            showHideButton1,
            new NewProcessExtendedPane(bpmSession, i18NSource, this),
            activityQueuesPane,
            new ActivityFiltersPane(this),
            showHideButton2);

    leftPanelTrigger = new LeftPanelVisibilityTrigger(leftPanel, true);
    leftPanel.setWidth(300, Sizeable.UNITS_PIXELS);
    showHideButton0.addListener(leftPanelTrigger);
    showHideButton1.addListener(leftPanelTrigger);
    showHideButton2.addListener(leftPanelTrigger);

    ComponentContainer viewContainer = viewController.getViewContainer();

    horizontalLayout.setWidth(100, Sizeable.UNITS_PERCENTAGE);
    horizontalLayout.addComponent(leftPanel);
    horizontalLayout.addComponent(viewContainer);
    horizontalLayout.setExpandRatio(viewContainer, 1.0f);
    addComponent(showHideButton0);
    addComponent(horizontalLayout);
    addComponent(uriFragmentUtility);
  }
  private void buildLayout() {
    keyList.setSizeFull();

    HorizontalLayout showAndEdit = new HorizontalLayout(keyList, editForm);
    showAndEdit.setSizeFull();
    showAndEdit.setSpacing(true);
    showAndEdit.setMargin(false);
    showAndEdit.setExpandRatio(keyList, 0.5f);
    showAndEdit.setExpandRatio(editForm, 0.5f);

    addComponent(showAndEdit);

    setMargin(true);
    setSpacing(false);
    setSizeFull();
    setExpandRatio(showAndEdit, 1);
  }
Exemple #11
0
  public void initializePanelRigth() {
    lstStudentSelecteds = new ListSelect("Alumnos Asignados");
    lstStudentSelecteds.setSizeFull();
    lstStudentSelecteds.setMultiSelect(true);

    mainPanel.addComponent(lstStudentSelecteds);
    mainPanel.setExpandRatio(lstStudentSelecteds, new Float(0.45));
  }
 private HorizontalLayout getCaptionLayout() {
   final HorizontalLayout captionLayout = new HorizontalLayout();
   captionLayout.setSizeFull();
   captionLayout.setHeight("36px");
   captionLayout.addComponents(windowCaption, minimizeButton, resizeButton, closeButton);
   captionLayout.setExpandRatio(windowCaption, 1.0F);
   captionLayout.addStyleName("v-window-header");
   return captionLayout;
 }
  private void BuildMenuBar() {
    menuBar.addComponent(branding);
    menuBar.addComponent(menu);
    menuBar.addComponent(settings);
    menuBar.addStyleName("sidebar");

    //		menuBar.setComponentAlignment(menu, Alignment.MIDDLE_CENTER);
    menuBar.setExpandRatio(menu, 1);
    menuBar.setWidth("100%");
  }
Exemple #14
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);
  }
  public ServerDescBasic() {
    setHeight("100%");
    addStyleName(Reindeer.PANEL_LIGHT);

    VerticalLayout panel = (VerticalLayout) getContent();
    panel.setWidth("100%");
    panel.setHeight("100%");
    panel.setMargin(true);
    panel.setSpacing(false);
    panel.addStyleName("server-desc-basic");

    HorizontalLayout hlPanels = new HorizontalLayout();
    hlPanels.setWidth("100%");
    hlPanels.setHeight("100%");
    hlPanels.setMargin(true);
    hlPanels.setSpacing(true);
    hlPanels.addStyleName("server-desc-basic");
    //        setContent(hlPanels);

    left.setWidth("100%");
    right.setHeight("100%");
    right.setWidth("100%");

    // 表同士の間隔をあける
    Label padding = new Label(" ");
    padding.setWidth("7px");
    padding.setHeight("99%");
    padding.addStyleName("desc-padding");

    Label padding2 = new Label("");
    padding2.setWidth("1px");

    hlPanels.addComponent(left);
    hlPanels.addComponent(padding);
    hlPanels.addComponent(padding2);
    hlPanels.addComponent(right);
    hlPanels.setExpandRatio(left, 40);
    hlPanels.setExpandRatio(right, 60);

    panel.addComponent(hlPanels);
    panel.setExpandRatio(hlPanels, 1.0f);
  }
Exemple #16
0
 private Layout createTextFieldMail(String title, Component component) {
   HorizontalLayout layout = new HorizontalLayout();
   Label lbTitle = new Label(title);
   lbTitle.setWidth("60px");
   lbTitle.setStyleName("lbmail");
   layout.addComponent(lbTitle);
   layout.setComponentAlignment(lbTitle, Alignment.MIDDLE_RIGHT);
   layout.addComponent(component);
   layout.setComponentAlignment(component, Alignment.MIDDLE_LEFT);
   layout.setWidth("100%");
   layout.setExpandRatio(component, 1.0f);
   return layout;
 }
Exemple #17
0
  public EditorView(ProjectFile file, Project project, User user, boolean inIde, int line) {
    super();
    this.file = file;
    this.project = project;
    this.user = user;
    layout.setSizeFull();

    HorizontalLayout ho = new HorizontalLayout();
    if (!inIde) {
      String url = "#" + project.getName() + "/" + file.getName() + "!";
      Link link = new Link("<<< " + file.getName(), new ExternalResource(url));
      link.setDescription("View project");
      layout.addComponent(link);
    }
    if (inIde) {
      String url = "#" + project.getName() + "/" + file.getName();
      Link link = new Link(file.getName() + " >>>", new ExternalResource(url));
      link.setDescription("View in standalone window");
      layout.addComponent(link);
    }

    layout.addComponent(ho);

    layout.setExpandRatio(ho, 1);
    ho.setSizeFull();

    cdoc = project.getDoc(file);

    editor = createEditor(file, project);
    editor.setSizeFull();
    editor.setEnabled(user != null);
    editor.setUser(user.getUserId(), user.getStyle());

    final int pos =
        org.vaadin.aceeditor.gwt.shared.Util.cursorPosFromLineCol(
            cdoc.getShared().getValue().getText(), line, 0, 1);
    editor.scrollToPosition(pos);
    ho.addComponent(editor);
    ho.setExpandRatio(editor, 1);

    VerticalLayout rightBar = new VerticalLayout();
    rightBar.setWidth("64px");
    rightBar.addComponent(userLayout);
    rightBar.addComponent(markerLayout);

    ho.addComponent(rightBar);

    setSizeFull();
    setCompositionRoot(layout);
  }
  public Component getComponent() {
    Responsive.makeResponsive(panel);
    panel.setSizeFull();

    panel.setHeight(100, Unit.PERCENTAGE);

    // p.setHeight(200, Unit.PERCENTAGE);
    HorizontalLayout layout = new HorizontalLayout();

    layout.setSizeFull();

    layout.addComponent(projectInfo);
    layout.addComponent(dataPart);
    layout.addComponent(commentsGrid);

    layout.setExpandRatio(projectInfo, 2.8f);
    layout.setExpandRatio(dataPart, 6.2f);
    layout.setExpandRatio(commentsGrid, 2.1f);

    panel.setContent(layout);

    return panel;
  }
  @PostConstruct
  public void postConstuct() {
    setSizeFull();

    navbar = new HorizontalLayout();
    navbar.setWidth("100%");
    navbar.setMargin(true);
    navbar.setDefaultComponentAlignment(Alignment.MIDDLE_RIGHT);
    addComponent(navbar);

    final Label brand = new Label("Vaadin4Spring Security Social Demo");
    brand.addStyleName(ValoTheme.LABEL_H2);
    brand.addStyleName(ValoTheme.LABEL_NO_MARGIN);
    navbar.addComponent(brand);
    navbar.setComponentAlignment(brand, Alignment.MIDDLE_LEFT);
    navbar.setExpandRatio(brand, 1);

    btnHome = new Button("Home", FontAwesome.HOME);
    btnHome.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    btnHome.setData(ViewToken.HOME);
    btnHome.addClickListener(this);
    navbar.addComponent(btnHome);

    btnSocial = new Button("Social connections", FontAwesome.SHARE_SQUARE);
    btnSocial.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    btnSocial.setData(ViewToken.SOCIAL);
    btnSocial.addClickListener(this);
    navbar.addComponent(btnSocial);

    btnLogout = new Button("Logout", FontAwesome.SIGN_OUT);
    btnLogout.setData("-");
    btnLogout.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    navbar.addComponent(btnLogout);
    btnLogout.addClickListener(
        new ClickListener() {

          @Override
          public void buttonClick(ClickEvent event) {
            UI.getCurrent().getSession().close();
            Page.getCurrent().setLocation("/logout");
          }
        });

    viewContainer = new Panel();
    viewContainer.setSizeFull();
    addComponent(viewContainer);
    setExpandRatio(viewContainer, 1);
  }
  protected void initInputField() {
    // Csslayout is used to style inputtext as rounded
    CssLayout csslayout = new CssLayout();
    csslayout.setHeight(24, UNITS_PIXELS);
    csslayout.setWidth(100, UNITS_PERCENTAGE);
    layout.addComponent(csslayout);

    inputField = new TextField();
    inputField.setWidth(100, UNITS_PERCENTAGE);
    inputField.addStyleName(ExplorerLayout.STYLE_SEARCHBOX);
    inputField.setInputPrompt(i18nManager.getMessage(Messages.TASK_CREATE_NEW));
    inputField.focus();
    csslayout.addComponent(inputField);
    layout.setComponentAlignment(csslayout, Alignment.MIDDLE_LEFT);
    layout.setExpandRatio(csslayout, 1.0f);
  }
  public FileSearchResultComponent() {
    this.resourceService = ApplicationContextUtil.getSpringBean(ResourceService.class);

    final CssLayout headerWrapper = new CssLayout();
    headerWrapper.setWidth("100%");
    headerWrapper.addStyleName(UIConstants.THEME_COMP_HEADER);

    final HorizontalLayout headerLayout = new HorizontalLayout();
    headerLayout.setWidth("100%");
    headerLayout.setSpacing(true);

    headerWrapper.addComponent(headerLayout);
    this.addComponent(headerWrapper);

    final Embedded headerIcon = new Embedded();
    headerIcon.setSource(MyCollabResource.newResource("icons/16/search.png"));
    headerLayout.addComponent(headerIcon);
    headerLayout.setComponentAlignment(headerIcon, Alignment.MIDDLE_LEFT);

    this.searchHeader = new Label();
    headerLayout.addComponent(this.searchHeader);
    headerLayout.setComponentAlignment(this.searchHeader, Alignment.MIDDLE_LEFT);
    headerLayout.setExpandRatio(this.searchHeader, 1.0f);

    final Button backButton =
        new Button(
            "Back to dashboard",
            new Button.ClickListener() {
              private static final long serialVersionUID = 1L;

              @Override
              public void buttonClick(final ClickEvent event) {
                backView();
              }
            });
    backButton.addStyleName(UIConstants.THEME_BLUE_LINK);
    headerLayout.addComponent(backButton);

    this.resourceTable = new ResourceTableDisplay();
    this.resourceTable.setWidth("100%");

    this.bodyLayout = new VerticalLayout();
    this.bodyLayout.addComponent(this.resourceTable);
    this.addComponent(this.bodyLayout);
    this.setMargin(true);
  }
  /**
   * Creates the field with the given container.
   *
   * @param container The container
   */
  public QualificationField(QualificationContainer container) {
    HorizontalLayout horLayout = new HorizontalLayout();
    horLayout.setWidth("100%");
    setCompositionRoot(horLayout);

    this.container = container;
    tags = new QualificationTagField();
    tags.setContainerDataSource(container);
    tags.setNewTokensAllowed(true);
    tags.setFilteringMode(Filtering.FILTERINGMODE_CONTAINS);
    horLayout.addComponent(tags);
    horLayout.setExpandRatio(tags, 1.0f);

    btnEdit = new Button();
    btnEdit.setDescription("Qualifikationen bearbeiten");
    btnEdit.addListener((ClickListener) this);
    horLayout.addComponent(btnEdit);
  }
 private void createSaveButton() {
   saveButton =
       SPUIComponentProvider.getButton(
           UIComponentIdProvider.SAVE_BUTTON,
           "Save",
           "",
           "",
           true,
           FontAwesome.SAVE,
           SPUIButtonStyleNoBorderWithIcon.class);
   saveButton.setSizeUndefined();
   saveButton.addStyleName("default-color");
   addCloseListenerForSaveButton();
   saveButton.setEnabled(false);
   buttonsLayout.addComponent(saveButton);
   buttonsLayout.setComponentAlignment(saveButton, Alignment.MIDDLE_RIGHT);
   buttonsLayout.setExpandRatio(saveButton, 1.0F);
 }
  public WindowTimtheobomon() {

    setCaption("Tìm theo bộ môn "); // Constants.USER_CAPTION) ;

    HorizontalLayout mainLayout = new HorizontalLayout();
    mainLayout.setImmediate(false);
    mainLayout.setWidth(Constants.WIDTH_MAX, Sizeable.UNITS_PIXELS);
    mainLayout.setMargin(false);
    mainLayout.setSpacing(true);

    mainLayout.addComponent(new leftSide());
    rContent = new VerticalLayout();
    rContent.setWidth("100%");

    mainLayout.addComponent(rContent);
    mainLayout.setExpandRatio(rContent, 1.0f);

    VerticalLayout v = new VerticalLayout();
    v.setWidth("100%");
    v.setStyleName("bl-mainContent");
    v.addComponent(mainLayout);
    v.setComponentAlignment(mainLayout, Alignment.MIDDLE_CENTER);

    addComponent(new topLogin());
    addComponent(new topPanel());
    addComponent(new mainMenu());
    addComponent(v);
    addComponent(new bottom());

    // --------------------bl
    Label title = new Label("<center><h1>Tìm theo bộ môn<h1></center>", Label.CONTENT_XHTML);

    final BeanItemContainer<ResearchingBean> beans =
        new BeanItemContainer<ResearchingBean>(ResearchingBean.class);

    Table table = new Table("Tìm kiếm", beans);

    table.setWidth("100%");
    table.setPageLength(10);

    rContent.addComponent(title);
    rContent.addComponent(table);
  }
Exemple #25
0
  public void initializePanelLeft() {
    txtSearch = new TextField();
    txtSearch.setWidth("100%");
    txtSearch.setHeight("100%");

    txtSearch.addListener(
        new TextChangeListener() {
          private static final long serialVersionUID = 1L;

          public void textChange(TextChangeEvent event) {
            String filter = event.getText();
            search(filter);
          }
        });

    btnSearch.setStyleName("searchButton");
    btnSearch.setDescription("Buscar");

    HorizontalLayout pnlSearch = new HorizontalLayout();
    pnlSearch.setWidth("100%");
    pnlSearch.setHeight("100%");
    pnlSearch.setMargin(false);
    pnlSearch.addComponent(txtSearch);
    pnlSearch.addComponent(btnSearch);

    lstStudents = new ListSelect("Alumnos Disponibles");
    lstStudents.setSizeFull();
    lstStudents.setMultiSelect(true);

    // panel left
    VerticalLayout pnlLeft = new VerticalLayout();
    pnlLeft.setHeight("100%");
    pnlLeft.setWidth("100%");
    pnlLeft.addComponent(pnlSearch);
    pnlLeft.addComponent(lstStudents);
    pnlLeft.setMargin(false);
    pnlLeft.setExpandRatio(pnlSearch, new Float(0.08));
    pnlLeft.setExpandRatio(lstStudents, new Float(0.92));

    mainPanel.addComponent(pnlLeft);
    mainPanel.setExpandRatio(pnlLeft, new Float(0.45));
  }
Exemple #26
0
  private void initLayout() {
    this.setSizeFull();
    this.setSpacing(true);
    this.addComponent(this.header);

    HorizontalLayout toolBarLayout = new HorizontalLayout();
    toolBarLayout.setWidth(100, UNITS_PERCENTAGE);
    toolBarLayout.setSpacing(true);
    this.addComponent(toolBarLayout);

    toolBarLayout.addComponent(this.statusIcon);
    toolBarLayout.addComponent(this.statusLabel);
    toolBarLayout.setExpandRatio(this.statusLabel, 1.0f);
    toolBarLayout.addComponent(this.activationButton);
    toolBarLayout.setComponentAlignment(this.activationButton, Alignment.MIDDLE_RIGHT);
    toolBarLayout.addComponent(this.deleteButton);
    toolBarLayout.setComponentAlignment(this.deleteButton, Alignment.MIDDLE_RIGHT);

    GridLayout detailTabLayout = new GridLayout(2, 2);
    // detailTabLayout.setMargin(new MarginInfo(false, true, true, false));
    detailTabLayout.setSpacing(true);
    detailTabLayout.setSizeFull();
    this.addComponent(detailTabLayout);
    this.setExpandRatio(detailTabLayout, 1.0f);

    this.profileForm.setWidth(100, UNITS_PERCENTAGE);
    this.profileForm.getLayout().addStyleName("gaemvnrepo-form");
    // this.profileForm.addStyleName("gaemvnrepo-form");
    this.profileForm.getLayout().setMargin(true);
    detailTabLayout.addComponent(this.profileForm, 0, 0);

    this.authenticationForm.setWidth(100, UNITS_PERCENTAGE);
    this.authenticationForm.getLayout().addStyleName("gaemvnrepo-form");
    // this.authenticationForm.addStyleName("gaemvnrepo-form");
    this.authenticationForm.getLayout().setMargin(true);
    detailTabLayout.addComponent(this.authenticationForm, 1, 0);
    // detailTabLayout.setRowExpandRatio(0, 0.7f);

    detailTabLayout.addComponent(this.saveButton, 1, 1);
    detailTabLayout.setComponentAlignment(this.saveButton, Alignment.TOP_RIGHT);
    detailTabLayout.setRowExpandRatio(1, 1.0f);
  }
  @Override
  protected void setup(VaadinRequest request) {
    TestUtils.injectCSS(this, ".hugemargin { margin: 10px 20px !important; }");

    HorizontalLayout hl = new HorizontalLayout();
    addLayoutTest(hl);
    hl.setExpandRatio(hl.getComponent(0), 1.0f);
    hl.setExpandRatio(hl.getComponent(2), 0.5f);
    VerticalLayout vl = new VerticalLayout();
    addLayoutTest(vl);
    vl.setExpandRatio(vl.getComponent(0), 1.0f);
    vl.setExpandRatio(vl.getComponent(2), 0.5f);

    GridLayout gl = new GridLayout(2, 1);
    addLayoutTest(gl);
    gl.setColumnExpandRatio(0, 1.0f);
    gl.setRowExpandRatio(0, 1.0f);
    gl.setColumnExpandRatio(1, 0.5f);
    gl.setRowExpandRatio(1, 0.5f);
  }
  @AutoGenerated
  private HorizontalLayout buildHorizontalLayoutHeader() {
    // common part: create layout
    horizontalLayoutHeader = new HorizontalLayout();
    horizontalLayoutHeader.setImmediate(false);
    horizontalLayoutHeader.setWidth("100.0%");
    horizontalLayoutHeader.setHeight("-1px");
    horizontalLayoutHeader.setMargin(true);
    horizontalLayoutHeader.setSpacing(true);

    // codeField
    codeField = new TextField();
    codeField.setCaption("Código");
    codeField.setImmediate(false);
    codeField.setWidth("100px");
    codeField.setHeight("-1px");
    codeField.setRequired(true);
    horizontalLayoutHeader.addComponent(codeField);

    // nameField
    nameField = new TextField();
    nameField.setCaption("Nombre Comercial");
    nameField.setImmediate(false);
    nameField.setWidth("100.0%");
    nameField.setHeight("-1px");
    nameField.setRequired(true);
    horizontalLayoutHeader.addComponent(nameField);
    horizontalLayoutHeader.setExpandRatio(nameField, 1.0f);

    // activeField
    activeField = new CheckBox();
    activeField.setCaption("Activo");
    activeField.setImmediate(false);
    activeField.setWidth("80px");
    activeField.setHeight("-1px");
    activeField.setRequired(true);
    horizontalLayoutHeader.addComponent(activeField);
    horizontalLayoutHeader.setComponentAlignment(activeField, new Alignment(10));

    return horizontalLayoutHeader;
  }
Exemple #29
0
  /** {@inheritDoc} */
  @Override
  public ComponentContainer getContentContainer() {
    HorizontalLayout horLayout = new HorizontalLayout();
    horLayout.setSizeFull();

    VerticalSplitPanel verSidebar = new VerticalSplitPanel();
    verSidebar.setWidth("300px");
    verSidebar.setHeight("100%");
    verSidebar.setSplitPosition(150, UNITS_PIXELS, true);
    verSidebar.setLocked(true);
    tree = new EventTree(this);
    verSidebar.addComponent(tree);
    verSidebar.addComponent(new GlobalLayout());
    horLayout.addComponent(verSidebar);

    VerticalLayout verContent = new VerticalLayout();
    verContent.setSizeFull();
    horLayout.addComponent(verContent);
    horLayout.setExpandRatio(verContent, 1.0f);

    toolbar = new ToolBar(this);
    verContent.addComponent(toolbar);

    content = new Panel();
    content.setSizeFull();
    verContent.addComponent(content);
    verContent.setExpandRatio(content, 1.0f);

    // Make useless
    setEnabled(false);
    VerticalLayout verWarning = new VerticalLayout();
    verWarning.setSizeFull();
    content.setContent(verWarning);
    Label lblWarning = new Label("Diese Funktionalität steht z.Z. nicht zur Verfügung!");
    lblWarning.setStyleName(Reindeer.LABEL_H1);
    lblWarning.setSizeUndefined();
    verWarning.addComponent(lblWarning);
    verWarning.setComponentAlignment(lblWarning, Alignment.MIDDLE_CENTER);

    return horLayout;
  }
  private void createCancelButton() {
    cancelButton =
        SPUIComponentProvider.getButton(
            UIComponentIdProvider.CANCEL_BUTTON,
            "Cancel",
            "",
            "",
            true,
            FontAwesome.TIMES,
            SPUIButtonStyleNoBorderWithIcon.class);
    cancelButton.setSizeUndefined();
    cancelButton.addStyleName("default-color");
    addCloseListenerForCancelButton();
    if (cancelButtonClickListener != null) {
      cancelButton.addClickListener(cancelButtonClickListener);
    }

    buttonsLayout.addComponent(cancelButton);
    buttonsLayout.setComponentAlignment(cancelButton, Alignment.MIDDLE_LEFT);
    buttonsLayout.setExpandRatio(cancelButton, 1.0F);
  }