Ejemplo n.º 1
0
  public RoomMaterialsViewImpl() {
    /*CellTable.Resources tableResources = GWT
    .create(MyCellTableResources.class);*/
    // cell tbale changes
    CellTable.Resources tableResources = GWT.create(MyCellTableResourcesNoSortArrow.class);
    table = new AdvanceCellTable<MaterialListProxy>(OsMaConstant.TABLE_PAGE_SIZE, tableResources);
    // cell table chages
    SimplePager.Resources pagerResources = GWT.create(MySimplePagerResources.class);
    Pager =
        new SimplePager(
            SimplePager.TextLocation.RIGHT,
            pagerResources,
            true,
            OsMaConstant.TABLE_JUMP_SIZE,
            true);

    searchBox =
        new QuickSearchBox(
            new QuickSearchBox.Delegate() {
              @Override
              public void performAction() {
                delegate.performSearch(searchBox.getValue());
              }
            });

    initWidget(uiBinder.createAndBindUi(this));
    init();
    splitLayoutPanel.setWidgetMinSize(
        splitLayoutPanel.getWidget(0), OsMaConstant.SPLIT_PANEL_MINWIDTH);

    AddButton.setText(constants.addMaterial());
  }
  private void buildUI() {
    FlowPanel topPanel = new FlowPanel();
    SimplePanel toolbarWrapper = new SimplePanel();
    toolbarWrapper.setWidget(new BrowserToolbar());
    toolbarWrapper.setStyleName("files-toolbar"); // $NON-NLS-1$
    topPanel.add(toolbarWrapper);
    topPanel.add(new SolutionTreeWrapper(solutionTree));

    solutionNavigatorPanel.setStyleName("puc-vertical-split-panel");
    solutionNavigatorPanel.setWidth("100%");
    solutionNavigatorPanel.addNorth(topPanel, 500);
    solutionNavigatorPanel.add(filesListPanel);

    navigatorAndContentSplit.setStyleName("puc-horizontal-split-panel");
    navigatorAndContentSplit.addWest(solutionNavigatorPanel, 300);
    navigatorAndContentSplit.add(contentTabPanel);
    navigatorAndContentSplit.getElement().setAttribute("id", "solutionNavigatorAndContentPanel");

    Window.addResizeHandler(
        new ResizeHandler() {
          @Override
          public void onResize(ResizeEvent event) {
            adjustContentPanelSize();
          }
        });

    solutionNavigatorPanel.getElement().getParentElement().addClassName("puc-navigator-panel");
    solutionNavigatorPanel.getElement().getParentElement().removeAttribute("style");

    setStyleName("panelWithTitledToolbar"); // $NON-NLS-1$
    setHeight("100%"); // $NON-NLS-1$
    setWidth("100%"); // $NON-NLS-1$

    add(navigatorAndContentSplit);

    sinkEvents(Event.MOUSEEVENTS);

    navigatorAndContentSplit.getWidget(1).setWidth("100%");
    navigatorAndContentSplit.getElement().getStyle().setHeight(1, Unit.PX);
    contentTabPanel.getElement().getStyle().setHeight(1, Unit.PX);
  }