private HorizontalPanel getHorizontalPanel() {
   if (horizontalPanel == null) {
     horizontalPanel = new HorizontalPanel();
     horizontalPanel.setSpacing(10);
     horizontalPanel.setEnabled(false);
   }
   return horizontalPanel;
 }
 private HorizontalPanel getFirstRow() {
   if (firstRow == null) {
     firstRow = new HorizontalPanel();
     firstRow.setSpacing(10);
     firstRow.add(getCommandLinePanel());
     firstRow.add(getStageFileList());
   }
   return firstRow;
 }
 private HorizontalPanel getSecondRow() {
   if (secondRow == null) {
     secondRow = new HorizontalPanel();
     secondRow.setSpacing(10);
     secondRow.add(getJobnamePanel());
     secondRow.add(getEmailPanel());
   }
   return secondRow;
 }
  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);
  }
 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;
 }
Beispiel #6
0
  public LibraryData(HorizontalPanel lp, DrakeGeneticsServiceAsync drakeGeneticsService) {
    this.libraryPanel = lp;

    final DrakeGeneticsServiceAsync dgs = drakeGeneticsService;
    drakeGeneticsService.getLibrary(
        new AsyncCallback<LibraryNode>() {
          public void onSuccess(LibraryNode results) {
            getTreeModelSucceeded(results, dgs);
          }

          public void onFailure(Throwable caught) {
            getTreeModelFailed(caught);
          }
        });

    treePanel.setHeaderVisible(true);
    treePanel.setLayout(new FitLayout());
    treePanel.setHeading("Publications");

    tree.setDisplayProperty("name");
    tree.setWidth(200);
    // tree.setHeight(450);
    tree.setHeight(670);
    tree.addListener(
        Events.OnClick,
        new Listener<TreePanelEvent<ModelData>>() {

          public void handleEvent(TreePanelEvent<ModelData> be) {
            ModelData item = be.getItem();
            String url = (String) item.get("url");
            if (url != null && !url.equals("")) {
              if (url.startsWith("/")) {
                url = url.substring(1);
              }
              libraryDocumentPanel.setUrl(GWT.getHostPageBaseURL() + url);
            }
          }
        });

    treePanel.add(tree);

    libraryPanel.add(treePanel);

    libraryDocumentPanel.setHeaderVisible(false);
    libraryDocumentPanel.setWidth(494);
    // libraryDocumentPanel.setHeight(451);
    libraryDocumentPanel.setHeight(671);
    libraryDocumentPanel.setUrl(GWT.getHostPageBaseURL() + "Library/index.html");
    libraryPanel.add(libraryDocumentPanel);
  }
Beispiel #7
0
  @Override
  public Widget initwidget() {
    if (!isinit) {
      HorizontalPanel hpanel = new HorizontalPanel();
      createGrid();
      LayoutContainer lc = initProButtons();

      hpanel.add(grid);
      hpanel.add(lc);
      this.add(hpanel);
      isinit = true;
      Tools.setResize(grid, 0.8, 0.95);
      Tools.setResize(lc, 0.2, 0.95);
    }
    return this;
  }
Beispiel #8
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);
  }
  @Override
  protected void onRender(Element parent, int pos) {
    super.onRender(parent, pos);

    Label zoomLabel = new Label("zoom");
    zoomLabel.setStyleName("zoomAndPrecisionLabel");
    HorizontalPanel zoomPanel = new HorizontalPanel();
    ZoomSlider zoom = new ZoomSlider();
    zoom.setClickToChange(false);
    zoom.setMessage("{0}%");
    zoom.setWidth("100px");
    zoom.setIncrement(100);
    zoom.setMinValue(100);
    zoom.setMaxValue(1600);

    zoomPanel.add(zoomLabel);
    zoomPanel.add(zoom);

    Label precisionLabel = new Label("precision");
    precisionLabel.setStyleName("zoomAndPrecisionLabel");
    HorizontalPanel precisionPanel = new HorizontalPanel();
    PrecisionSlider precision = new PrecisionSlider();
    precision.setClickToChange(false);
    precision.setMessage("{0} minutes");
    precision.setWidth("100px");
    precision.setIncrement(5);
    precision.setMinValue(5);
    precision.setMaxValue(240);
    precision.setValue(timeSpaceModel.getTimeIntervalMinutes());

    precisionPanel.add(precisionLabel);
    precisionPanel.add(precision);

    Image spacer = new Image("resources/images/mine/pix/white.gif");
    spacer.setWidth("7px");
    add(zoomPanel);
    add(spacer);
    add(precisionPanel);
  }
  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;
  }
  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;
  }
Beispiel #12
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);
  }
  private void initialize(BillTypeManager billTypeManager, ServiceLocations serviceLocations) {
    FormData formData = new FormData("-20");

    matchingField = new MatchingItemsControl();
    Widget storeField = createStoreField();
    Widget billTypeField = createBillTypeField(billTypeManager);
    Widget costField = createCostField();
    Widget notesField = createNotesField();
    Widget dateField = createDateField();

    Button okButton = new Button("OK");

    okButton.addSelectionListener(
        new SelectionListener<ButtonEvent>() {
          @Override
          public void componentSelected(ButtonEvent ce) {
            if (isSplit) {
              submitSplitPurchase();
            } else {
              if (isValid()) {
                submitPurchase();
              } else {
                Window.alert("Not valid");
              }
            }
          }
        });

    Button cancelButton = new Button("Cancel");

    cancelButton.addSelectionListener(
        new SelectionListener<ButtonEvent>() {
          @Override
          public void componentSelected(ButtonEvent ce) {
            finishPurchase();
          }
        });

    submitWithMatchesButton = new Button("Submit With Matches");

    submitWithMatchesButton.addSelectionListener(
        new SelectionListener<ButtonEvent>() {
          @Override
          public void componentSelected(ButtonEvent ce) {
            sendPurchase();
          }
        });

    submitWithMatchesButton.setVisible(false);

    Button splitButton = new Button("Split");
    splitButton.addSelectionListener(
        new SelectionListener<ButtonEvent>() {
          @Override
          public void componentSelected(ButtonEvent ce) {
            toggleSplit();
          }
        });

    VerticalPanel labelPanel = new VerticalPanel();
    VerticalPanel controlPanel = new VerticalPanel();
    labelPanel.add(new Label("Store"));
    labelPanel.add(new Label("Cost"));
    labelPanel.add(new Label("Date"));
    labelPanel.add(new Label("Bill Type"));
    labelPanel.add(new Label("Note"));
    controlPanel.add(storeField);
    controlPanel.add(costField);
    controlPanel.add(dateField);
    controlPanel.add(billTypeField);
    controlPanel.add(notesField);

    fieldPanel = new Grid(5, 2);

    fieldPanel.setText(0, 0, "Store:");
    fieldPanel.setWidget(0, 1, storeField);

    fieldPanel.setText(1, 0, "Cost:");
    fieldPanel.setWidget(1, 1, costField);

    fieldPanel.setText(2, 0, "Date:");
    fieldPanel.setWidget(2, 1, dateField);

    fieldPanel.setText(3, 0, "Bill Type:");
    fieldPanel.setWidget(3, 1, billTypeField);

    fieldPanel.setText(4, 0, "Note:");
    fieldPanel.setWidget(4, 1, notesField);

    HorizontalPanel buttonPanel = new HorizontalPanel();

    buttonPanel.add(okButton);
    buttonPanel.add(cancelButton);

    add(splitButton);
    add(fieldPanel);
    add(matchingField);
    add(submitWithMatchesButton);
    add(buttonPanel);
  }
  protected void onRender(Element parent, int index) {
    super.onRender(parent, index);

    criteria.addCondition(new Condition(IGoods.DELETED, Condition.EQUALS, "true"));
    BasePagingLoader loader = new PagingListService().getLoader(ModelNames.GOODS, criteria);
    loader.load(0, 10);
    final ListStore<BeanObject> 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(IGoods.ID, "ID", 50));
    ColumnConfig col = new ColumnConfig(IGoods.NAME, Resources.constants.Goods_name(), 100);
    columns.add(col);
    col = new ColumnConfig(IGoods.SN, Resources.constants.Goods_SN(), 100);
    columns.add(col);

    col = new ColumnConfig(IGoods.SHOPPRICE, Resources.constants.Goods_shopPrice(), 80);
    col.setAlignment(HorizontalAlignment.RIGHT);
    col.setNumberFormat(NumberFormat.getCurrencyFormat());
    columns.add(col);

    ColumnConfig actcol = new ColumnConfig("Action", Resources.constants.GoodsList_action(), 100);
    //		columns.add(actcol);

    ColumnModel cm = new ColumnModel(columns);

    Grid<BeanObject> grid = new EditorGrid<BeanObject>(store, cm);
    grid.setLoadMask(true);
    grid.setBorders(true);
    grid.setSelectionModel(smRowSelection);
    //      grid.setAutoExpandColumn("forum");

    ActionCellRenderer render = new ActionCellRenderer(grid);
    ActionCellRenderer.ActionInfo act = new ActionCellRenderer.ActionInfo();
    act.setImage("icon_edit.gif");
    act.setAction("editGoods($id)");
    act.setTooltip(Resources.constants.GoodsList_action_edit());
    render.addAction(act);
    act = new ActionCellRenderer.ActionInfo();
    act.setImage("icon_trash.gif");
    act.setAction("deleteGoods($id)");
    act.setTooltip(Resources.constants.GoodsList_action_delete());
    render.addAction(act);

    actcol.setRenderer(render);

    HorizontalPanel header = new HorizontalPanel();
    header.add(Resources.images.icon_search().createImage());
    header.add(new Label("  " + Resources.constants.GoodsList_keyword()));
    header.add(txtKeyword);
    header.add(btnFind);
    add(header);

    btnFind.addSelectionListener(
        new SelectionListener<ButtonEvent>() {
          public void componentSelected(ButtonEvent ce) {
            search();
          }
        });

    ContentPanel panel = new ContentPanel();
    panel.setFrame(true);
    panel.setCollapsible(true);
    panel.setAnimCollapse(false);
    panel.setButtonAlign(HorizontalAlignment.CENTER);
    panel.setIconStyle("icon-table");
    //        panel.setHeading("Paging Grid");
    panel.setLayout(new FitLayout());
    panel.add(grid);
    panel.setSize(880, 350);
    panel.setBottomComponent(toolBar);

    panel.setButtonAlign(HorizontalAlignment.CENTER);
    panel.addButton(
        new Button(
            "彻底删除",
            new SelectionListener<ButtonEvent>() {
              public void componentSelected(ButtonEvent ce) {
                List<BeanObject> items = smRowSelection.getSelectedItems();
                purgeGoods(items);
              }
            }));

    panel.addButton(
        new Button(
            "恢复",
            new SelectionListener<ButtonEvent>() {
              public void componentSelected(ButtonEvent ce) {
                List<BeanObject> items = smRowSelection.getSelectedItems();
                restoreGoods(items);
              }
            }));

    add(panel);
  }