Пример #1
0
  @AutoGenerated
  private HorizontalSplitPanel buildProductSearchSplit() {
    // common part: create layout
    productSearchSplit = new HorizontalSplitPanel();
    productSearchSplit.setStyleName("productSearchSplit");
    productSearchSplit.setImmediate(false);
    productSearchSplit.setWidth("90%");
    productSearchSplit.setHeight("90%");
    productSearchSplit.setSplitPosition(70);

    productSearchSplit.addComponent(buildProductTable());

    return productSearchSplit;
  }
Пример #2
0
  @AutoGenerated
  private HorizontalSplitPanel buildForgotTab() {
    // common part: create layout
    forgotTab = new HorizontalSplitPanel();
    forgotTab.setImmediate(false);
    forgotTab.setWidth("100.0%");
    forgotTab.setHeight("100.0%");
    forgotTab.setMargin(false);

    // verticalLayout_1
    verticalLayout_1 = buildVerticalLayout_1();
    forgotTab.addComponent(verticalLayout_1);

    // forgotUserNameDiv
    forgotUserNameDiv = buildForgotUserNameDiv();
    forgotTab.addComponent(forgotUserNameDiv);

    return forgotTab;
  }
Пример #3
0
  // 构造函数
  public ComplainTypeListView(ComplainTypeManager complainTypeManager) {
    // ------------------------------------------加载dao
    this.complainTypeManager = complainTypeManager;

    // -------------------------------------------标题部分
    HorizontalLayout navBar = new HorizontalLayout();
    navBar.setStyleName(Reindeer.LAYOUT_BLACK);
    navBar.setWidth(100, Unit.PERCENTAGE);
    navBar.setHeight(29, Unit.PIXELS);
    Label lblNav = new Label("CRM系统 / 诉求类别");
    Button btnAdd = new Button("新增"); // 增加 按钮
    btnAdd.setIcon(new ThemeResource("icons/16/add.png"));
    btnAdd.setDescription("增加类别");
    btnAdd.addClickListener(
        new Button.ClickListener() {
          @Override
          public void buttonClick(com.vaadin.ui.Button.ClickEvent event) {
            createWindow(null);
          }
        });
    navBar.addComponent(lblNav);
    navBar.addComponent(btnAdd);
    navBar.setComponentAlignment(btnAdd, Alignment.TOP_RIGHT); // 定义位置

    // -------------------------------------------正文部分
    conentHSplit = new HorizontalSplitPanel();
    conentHSplit.setStyleName(Reindeer.LAYOUT_WHITE); // 右侧样式
    conentHSplit.setHeight(Constants.PAGE_HEIGHT, Unit.PIXELS);

    // -----------------------------------------左边 tree

    initTree();
    conentHSplit.setFirstComponent(leftTree);
    conentHSplit.setSecondComponent(rightTable);
    conentHSplit.setSplitPosition(15F);
    // -----------------------------------------右边 table 使用
    container = new BeanItemContainer<ComplainTypeDtilBean>(ComplainTypeDtilBean.class);
    initRightTable(rightTable, container);

    this.addComponent(navBar);
    this.addComponent(conentHSplit);
  }
Пример #4
0
  public TradeTab() {
    HorizontalSplitPanel mainPanel = new HorizontalSplitPanel();
    mainPanel.setHeight("100%");

    VerticalLayout leftPanel = new VerticalLayout();
    leftPanel.setMargin(true);
    leftPanel.setSpacing(true);
    leftPanel.setHeight("100%");

    itemContainer.addContainerProperty("auction", AuctionService.class, null);
    itemContainer.addContainerProperty("id", String.class, null);
    itemContainer.addContainerProperty("description", String.class, null);
    itemContainer.addContainerProperty("startingPrice", Long.class, null);
    itemContainer.addContainerProperty("item", AuctionItem.class, null);

    itemTable.addStyleName("h1");
    //		itemTable.addStyleName("noheader");
    itemTable.setSelectable(true);
    itemTable.setImmediate(true);
    itemTable.setVisibleColumns(new String[] {"description", "startingPrice"});
    itemTable.setColumnHeaders(new String[] {"Description", "Starting Price"});
    itemTable.setSizeFull();

    itemTable.addListener(
        new Property.ValueChangeListener() {
          public void valueChange(ValueChangeEvent event) {
            Application application = getApplication();
            if (application instanceof UriFragmentService)
              ((UriFragmentService) application).setUriFragment(getCurrentUriFragment(), false);

            Object itemId = itemTable.getValue();
            AuctionItem item =
                itemId != null
                    ? (AuctionItem) itemTable.getContainerProperty(itemId, "item").getValue()
                    : null;
            for (Iterator<Component> iter = dynamicLayout.getComponentIterator();
                iter.hasNext(); ) {
              Component component = iter.next();
              if (component instanceof SelectionListener<?>) {
                ((SelectionListener<AuctionItem>) component).selectionChanged(item);
              }
            }
          }
        });

    leftPanel.addComponent(itemTable);
    leftPanel.setExpandRatio(itemTable, 1f);

    // Button panel
    VerticalLayout buttonBarLayout = new VerticalLayout();
    buttonBar = new DynamicContainer(buttonBarLayout);
    buttonBar.setWidth("100%");
    leftPanel.addComponent(buttonBar);

    // Progress Indicator (hidden)
    ProgressIndicator progress = new ProgressIndicator(ProgressIndicator.SIZE_UNDEFINED);
    progress.addStyleName("hidden");
    progress.setPollingInterval(POLL_INTERVAL);
    leftPanel.addComponent(progress);
    leftPanel.setExpandRatio(progress, 0f);

    mainPanel.addComponent(leftPanel);
    mainPanel.addComponent(container);

    Table table = new Table();
    table.setSizeFull();

    setCompositionRoot(mainPanel);
    setCaption("Trade");
    setSizeFull();
  }