예제 #1
0
 private HorizontalPanel getHorizontalPanel() {
   if (horizontalPanel == null) {
     horizontalPanel = new HorizontalPanel();
     horizontalPanel.setSpacing(10);
     horizontalPanel.setEnabled(false);
   }
   return horizontalPanel;
 }
예제 #2
0
 private HorizontalPanel getFirstRow() {
   if (firstRow == null) {
     firstRow = new HorizontalPanel();
     firstRow.setSpacing(10);
     firstRow.add(getCommandLinePanel());
     firstRow.add(getStageFileList());
   }
   return firstRow;
 }
예제 #3
0
 private HorizontalPanel getSecondRow() {
   if (secondRow == null) {
     secondRow = new HorizontalPanel();
     secondRow.setSpacing(10);
     secondRow.add(getJobnamePanel());
     secondRow.add(getEmailPanel());
   }
   return secondRow;
 }
예제 #4
0
  protected void onRender(Element parent, int index) {
    super.onRender(parent, index);

    ContentPanel inforPanel = new ContentPanel();
    //		 inforPanel.setHeading(this.getCurState().getAuction().getString(IAuction.AUCTION_NAME));
    HorizontalPanel infoContent = new HorizontalPanel();
    infoContent.setSpacing(20);
    Label sk = new Label("拍卖活动名称:");
    Label sv = new Label(this.getCurState().getAuction().getString(IAuction.AUCTION_NAME));
    Label ek = new Label("拍卖商品名称:");
    Label ev = new Label(this.getCurState().getAuction().getString(IAuction.GOOD_NAME));
    infoContent.add(sk);
    infoContent.add(sv);
    infoContent.add(ek);
    infoContent.add(ev);
    inforPanel.add(infoContent);

    BasePagingLoader loader = new PagingListService().getLoader(ModelNames.AUCTIONLOG);
    loader.load(0, 10);
    store = new ListStore<BeanObject>(loader);
    toolBar = new PagingToolBar(10);
    toolBar.bind(loader);

    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    final CheckBoxSelectionModel<BeanObject> smRowSelection =
        new CheckBoxSelectionModel<BeanObject>();
    columns.add(smRowSelection.getColumn());
    columns.add(new ColumnConfig(IAuctionLog.BID_USER, "买家", 150));
    columns.add(new ColumnConfig(IAuctionLog.BID_PRICE, "出价", 150));
    columns.add(new ColumnConfig(IAuctionLog.BID_TIME, "时间", 150));
    columns.add(new ColumnConfig(IAuctionLog.LOG_ID, "状态", 150));

    ColumnModel cm = new ColumnModel(columns);
    grid = new Grid<BeanObject>(store, cm);

    //        grid.setLoadMask(true);
    //        grid.setBorders(true);
    grid.setSelectionModel(smRowSelection);
    grid.addPlugin(smRowSelection);
    grid.setHeight(250);

    ContentPanel contentPanel = new ContentPanel();
    contentPanel.setFrame(true);
    contentPanel.setCollapsible(true);
    contentPanel.setAnimCollapse(false);
    contentPanel.setButtonAlign(HorizontalAlignment.CENTER);
    contentPanel.setIconStyle("icon-table");
    contentPanel.setLayout(new FitLayout());
    contentPanel.add(grid);
    contentPanel.setBottomComponent(toolBar);

    topPanel.add(inforPanel);
    topPanel.add(contentPanel);
    add(topPanel);
  }
예제 #5
0
 private HorizontalPanel getThirdRow() {
   if (thirdRow == null) {
     thirdRow = new HorizontalPanel();
     thirdRow.setHorizontalAlign(HorizontalAlignment.RIGHT);
     thirdRow.setSpacing(10);
     thirdRow.add(getApplicationPanel());
     thirdRow.add(getWalltimeContainer());
     thirdRow.add(getCpusPanel());
   }
   return thirdRow;
 }
예제 #6
0
  @Override
  protected void onRender(Element parent, int pos) {
    super.onRender(parent, pos);
    HorizontalPanel hp = new HorizontalPanel();
    hp.setSpacing(10);

    Button btn = new Button("Basic");
    btn.setToolTip(new ToolTipConfig("Information", "Prints the current document"));
    hp.add(btn);

    btn = new Button("Closable");
    ToolTipConfig config = new ToolTipConfig();
    config.setTitle("Information");
    config.setText("Prints the current document");
    config.setCloseable(true);
    btn.setToolTip(config);
    hp.add(btn);

    btn = new Button("Mouse Tracking");
    config = new ToolTipConfig();
    config.setTitle("Information");
    config.setText("Prints the current document");
    config.setTrackMouse(true);
    btn.setToolTip(config);
    hp.add(btn);

    btn = new Button("Anchor");
    config = new ToolTipConfig();
    config.setTitle("Information");
    config.setText("Prints the current document");
    config.setMouseOffset(new int[] {0, 0});
    config.setAnchor("left");
    btn.setToolTip(config);
    hp.add(btn);

    btn = new Button("Custom");
    config = new ToolTipConfig();
    config.setText("Prints the current document");
    config.setTitle("Template Tip");
    config.setMouseOffset(new int[] {0, 0});
    config.setAnchor("left");
    config.setTemplate(new Template(getTemplate()));
    config.setCloseable(true);
    config.setMaxWidth(415);
    btn.setToolTip(config);
    hp.add(btn);

    add(hp);
  }
예제 #7
0
  private HorizontalPanel getSearchPanel() {
    HorizontalPanel searchBox = new HorizontalPanel();
    TextField<String> msisdnField = new TextField<String>();
    msisdnField.setFieldLabel("MSISDN");
    msisdnField.setWidth(200);
    msisdnField.setEmptyText("Enter MSISDN");
    Button searchButton = new Button("Search");
    searchBox.setShadow(true);
    searchBox.setSpacing(5);
    searchBox.add(msisdnField);
    searchBox.add(searchButton);
    searchBox.setHorizontalAlign(HorizontalAlignment.CENTER);
    searchButton.addSelectionListener(
        new SelectionListener<ButtonEvent>() {

          @Override
          public void componentSelected(ButtonEvent ce) {}
        });
    return searchBox;
  }
예제 #8
0
  private HorizontalPanel getWallTimeFormPanel() {
    if (WallTimeFormPanel == null) {
      WallTimeFormPanel = new HorizontalPanel();
      WallTimeFormPanel.setHeight("66px");
      WallTimeFormPanel.setVerticalAlign(VerticalAlignment.BOTTOM);
      WallTimeFormPanel.setSpacing(10);
      TableData tableData = new TableData();
      tableData.setVerticalAlign(VerticalAlignment.BOTTOM);
      WallTimeFormPanel.add(getDaysContainer(), tableData);
      TableData tableData_1 = new TableData();
      tableData_1.setVerticalAlign(VerticalAlignment.BOTTOM);
      WallTimeFormPanel.add(getHoursContainer(), tableData_1);
      TableData tableData_2 = new TableData();
      tableData_2.setVerticalAlign(VerticalAlignment.BOTTOM);
      WallTimeFormPanel.add(getMinutesContainer(), tableData_2);

      // setting last walltime
      int walltimeInMinutes = -1;
      try {
        String wtString =
            UserEnvironment.getInstance()
                .getUserProperty(Constants.GENERIC_JOB_LAST_WALLTIME_IN_MINUTES);
        walltimeInMinutes = Integer.parseInt(wtString);
        if (walltimeInMinutes > 0) {
          int days = walltimeInMinutes / (60 * 24);
          int hours = (walltimeInMinutes - (days * 60 * 24)) / 3600;
          int minutes = (walltimeInMinutes - ((days * 60 * 24) + (hours * 3600))) / 60;

          getMinutesComboBox().setSimpleValue(minutes);
          getHoursComboBox().setSimpleValue(hours);
          getDaysComboBox().setSimpleValue(days);
        }

      } catch (Exception e) {
        // do nothing
      }
    }
    return WallTimeFormPanel;
  }
예제 #9
0
  @Override
  protected void onRender(Element parent, int index) {
    super.onRender(parent, index);

    final Stock stock = TestData.getStocks().get(0);

    HorizontalPanel hp = new HorizontalPanel();
    hp.setSpacing(10);

    StringBuffer sb = new StringBuffer();
    sb.append("<div class=text style='line-height: 1.5em'>");
    sb.append("<b>Name:</b> {name}<br>");
    sb.append("<b>Symbol:</b> {symbol}<br>");
    sb.append("<b>Last:</b> {last}<br>");
    sb.append("<b>Change:</b> {[new Number(values.change).toFixed(2)]}<br>");
    sb.append("<b>Updated:</b> {date:date(\"MM/dd/y\")}<br>");
    sb.append("</div>");

    final XTemplate template = XTemplate.create(sb.toString());
    final HTML html = new HTML();
    html.setWidth("160px");
    template.overwrite(html.getElement(), Util.getJsObject(stock));
    hp.add(html);
    // update template when model changes
    stock.addChangeListener(
        new ChangeListener() {
          public void modelChanged(ChangeEvent event) {
            template.overwrite(html.getElement(), Util.getJsObject(stock));
          }
        });

    FormPanel panel = new FormPanel();
    panel.setHeaderVisible(false);
    panel.setWidth(350);

    TextField<String> name = new TextField<String>();
    name.setName("nameField");
    name.setFieldLabel("Name");
    panel.add(name);

    TextField<String> symbol = new TextField<String>();
    symbol.setName("symbol");
    symbol.setFieldLabel("Symbol");
    panel.add(symbol);

    NumberField open = new NumberField();
    open.setName("last");
    open.setFieldLabel("Last");
    panel.add(open);

    NumberField change = new NumberField();
    change.setName("change");
    change.setFieldLabel("Change");
    change.setFormat(NumberFormat.getDecimalFormat());
    panel.add(change);

    DateField last = new DateField();
    last.setName("date");
    last.setFieldLabel("Updated");
    panel.add(last);

    SimpleComboBox<String> scb = new SimpleComboBox<String>();
    for (Stock s : TestData.getStocks()) {
      scb.add(s.getName());
    }
    scb.setFieldLabel("Name");
    scb.setForceSelection(true);
    scb.setTypeAhead(true);
    scb.setName("company");
    scb.setTriggerAction(TriggerAction.ALL);
    panel.add(scb);

    hp.add(panel);

    FormBinding binding = new FormBinding(panel);
    // manually add bindings
    binding.addFieldBinding(new FieldBinding(name, "name"));
    binding.addFieldBinding(new FieldBinding(symbol, "symbol"));
    binding.addFieldBinding(new SimpleComboBoxFieldBinding(scb, "name"));

    // auto bind remaining fields, field name must match model property name
    binding.autoBind();
    binding.bind(stock);

    add(hp);
  }