protected void renderEditors(final Component parent) {
      final DefaultLiveEditBrowserModel model = (DefaultLiveEditBrowserModel) getModel();
      final PreviewDataModel previewData = model.getPreviewData();

      if (previewData != null) {
        final TypedObject previewDataTO = getTypeService().wrapItem(previewData);

        final Collection<EditorRowConfiguration> rowConfigs =
            getRowConfigs(previewDataTO.getType());
        final Collection<PropertyDescriptor> props = new ArrayList<PropertyDescriptor>();
        for (final EditorRowConfiguration row : rowConfigs) {
          props.add(row.getPropertyDescriptor());
        }
        final ObjectValueContainer valueContainer =
            TypeTools.createValueContainer(
                previewDataTO,
                new HashSet<PropertyDescriptor>(props),
                UISessionUtils.getCurrentSession().getSystemService().getAvailableLanguageIsos());

        int index = 0;
        Hbox singleRow = null;
        for (final EditorRowConfiguration row : rowConfigs) {
          if (index % EDITORS_PER_ROW == 0) {
            singleRow = new Hbox();
            parent.appendChild(singleRow);
          }
          singleRow.appendChild(createEditor(previewDataTO, row, valueContainer));
          index++;
        }
      }
    }
 protected void buildBox(Listcell cell) {
   Hbox hbox = new Hbox();
   hbox.setWidths("130px,,");
   hbox.setAlign("center");
   buildLabel(hbox);
   hbox.setParent(cell);
 }
Ejemplo n.º 3
0
  private static void outputCase(FlexCase... flexCases) throws Exception {
    StringBuffer flexCaseXML = new StringBuffer("<zk>");
    Hbox hbox1 = new Hbox();
    Hbox hbox2 = new Hbox();
    for (int i = 0; i < flexCases.length; i++) {
      FlexCase flexCase = flexCases[i];

      switch (flexCases.length) {
        case 1:
          flexCaseXML.append(flexCase.getViewXML());
          break;
        case 2:
          hbox1.appendChild(flexCase.getView());
          if (i == 1) flexCaseXML.append(new XMLConverter(hbox1).toXML());
          break;
        case 4:
          if (i < 2) hbox1.appendChild(flexCase.getView());
          else if (i > 1) hbox2.appendChild(flexCase.getView());
          if (i == 1) flexCaseXML.append(new XMLConverter(hbox1).toXML());
          if (i == 3) flexCaseXML.append(new XMLConverter(hbox2).toXML());
          break;
      }
    }
    flexCaseXML.append("</zk>");

    File ztl = generateZTL();
    save(flexCaseXML.toString(), ztl);
    System.out.println("save to file " + ztl.getName());
    System.out.println("file contnet: \n" + flexCaseXML + "\n");
  }
Ejemplo n.º 4
0
 private void createLabel(Component container, String key, String value) {
   Hbox box = new Hbox();
   box.setParent(container);
   new Label(key + ": ").setParent(box);
   Label label = new Label(value != null ? value : "NULL");
   label.setClass(key);
   label.setParent(box);
 }
  public Row crearFilas(Object objeto, Component componente) throws Exception {
    Row fila = new Row();

    final Anexo3_entidad anexo3_entidad = (Anexo3_entidad) objeto;

    Hbox hbox = new Hbox();
    Space space = new Space();

    fila.setStyle("text-align: justify;nowrap:nowrap");

    hbox.appendChild(space);

    Image img = new Image();
    img.setSrc("/images/editar.gif");
    img.setTooltiptext("Editar");
    img.setStyle("cursor: pointer");
    img.addEventListener(
        Events.ON_CLICK,
        new EventListener<Event>() {
          @Override
          public void onEvent(Event arg0) throws Exception {
            mostrarDatos(anexo3_entidad);
          }
        });
    hbox.appendChild(img);

    img = new Image();
    img.setSrc("/images/borrar.gif");
    img.setTooltiptext("Eliminar");
    img.setStyle("cursor: pointer");
    img.addEventListener(
        Events.ON_CLICK,
        new EventListener<Event>() {
          @Override
          public void onEvent(Event arg0) throws Exception {
            Messagebox.show(
                "Esta seguro que desea eliminar este registro? ",
                "Eliminar Registro",
                Messagebox.YES + Messagebox.NO,
                Messagebox.QUESTION,
                new org.zkoss.zk.ui.event.EventListener<Event>() {
                  public void onEvent(Event event) throws Exception {
                    if ("onYes".equals(event.getName())) {
                      // do the thing
                      eliminarDatos(anexo3_entidad);
                      buscarDatos();
                    }
                  }
                });
          }
        });
    hbox.appendChild(space);
    hbox.appendChild(img);

    fila.appendChild(hbox);

    return fila;
  }
Ejemplo n.º 6
0
  public void createScenario(ModelStoryline storyline) throws ThinklabException {

    browser.setVisible(false);
    sceditor.setVisible(true);
    sceditor.setStoryline(storyline);
    sceditor.setLocation(map.getZoom(), (ArealExtent) storyline.getContext().getSpace());
  }
Ejemplo n.º 7
0
  /**
   * Static Init
   *
   * @throws Exception
   */
  private void jbInit() throws Exception {
    Charset[] charsets = Ini.getAvailableCharsets();

    for (int i = 0; i < charsets.length; i++)
      fCharset.appendItem(charsets[i].displayName(), charsets[i]);

    bFile.setLabel(Msg.getMsg(Env.getCtx(), "FileImportFile"));
    bFile.setTooltiptext(Msg.getMsg(Env.getCtx(), "FileImportFileInfo"));
    bFile.addEventListener(Events.ON_CLICK, this);

    fCharset.setMold("select");
    fCharset.setRows(0);
    fCharset.setTooltiptext(Msg.getMsg(Env.getCtx(), "Charset", false));

    info.setValue("   ");

    labelFormat.setValue(Msg.translate(Env.getCtx(), "AD_ImpFormat_ID"));

    pickFormat.setMold("select");
    pickFormat.setRows(0);

    bNext.setTooltiptext(Msg.getMsg(Env.getCtx(), "Next"));
    bNext.setLabel(">");
    bNext.addEventListener(Events.ON_CLICK, this);

    record.setValue("------");

    bPrevious.setTooltiptext(Msg.getMsg(Env.getCtx(), "Previous"));
    bPrevious.setLabel("<");
    bPrevious.addEventListener(Events.ON_CLICK, this);

    northPanel.appendChild(bFile);
    northPanel.appendChild(fCharset);
    northPanel.appendChild(info);
    northPanel.appendChild(labelFormat);
    northPanel.appendChild(pickFormat);
    northPanel.appendChild(bPrevious);
    northPanel.appendChild(record);
    northPanel.appendChild(bNext);

    rawData.setWidth("100%");
    rawData.setCols(80);
    rawData.setRows(MAX_SHOWN_LINES);
    rawData.setHeight("40%");

    previewPanel.setWidth("100%");
    previewPanel.setHeight("58%");
    previewPanel.setStyle("overflow: auto");

    centerPanel.setWidth("100%"); // Elaine 2008/11/07 - fix text area is not expanded in IE7
    centerPanel.setHeight("100%");
    centerPanel.appendChild(rawData);
    centerPanel.appendChild(new Separator());
    centerPanel.appendChild(previewPanel);

    confirmPanel.addActionListener(Events.ON_CLICK, this);
  }
Ejemplo n.º 8
0
  // temp - this should be passed what the editor created, or null
  public void addScenario(IContext editor) throws ThinklabException {

    /*
     * if editor is not null, do something
     */
    sceditor.setVisible(false);
    browser.setVisible(true);
  }
Ejemplo n.º 9
0
 // 判断信息状态,控制界面显示,初始化信息值
 public void initInfo(WkTDistribute dis) {
   this.dis = dis;
   WkTInfo info = newsService.getWkTInfo(dis.getKiId());
   String state = dis.getKbStatus().trim();
   if (info.getKiType().trim().equals("1")) {
     ljnews.setVisible(false);
     bdnews.setVisible(false);
     initInfocnt(newsService.getChildNewsContent(info.getKiId()));
     kitype.setValue("输入");
     sep1.setVisible(true);
     sep2.setVisible(true);
   } else if (info.getKiType().trim().equals("2")) {
     ljnews.setVisible(false);
     wdnews.setVisible(false);
     wd.setVisible(false);
     tupian.setVisible(false);
     kitype.setValue("上传文件");
   } else if (info.getKiType().trim().equals("3")) {
     wdnews.setVisible(false);
     wd.setVisible(false);
     bdnews.setVisible(false);
     tupian.setVisible(false);
     kiaddress.setContent(
         "<a href=\""
             + info.getKiAddress()
             + "\" target=\"_blank\">"
             + info.getKiAddress()
             + "</a>");
     kitype.setValue("外部链接");
   }
   kititle.setValue(info.getKiTitle());
   kititle2.setValue(info.getKiTitle2());
   kbtitle.setValue(dis.getKbTitle());
   // 初始化显示图片
   if (info.getKiImage() != null && info.getKiImage().trim().length() > 0) {
     kiimage.setSrc("/upload/info/" + info.getKiImage().trim());
   }
   // 加载附件
   List flist = newsService.getFile(dis.getKiId());
   modelListbox.addAll(flist);
   upList.setModel(modelListbox);
 }
  public Row crearFilas(Object objeto, Component componente) throws Exception {
    Row fila = new Row();

    final Ficha_epidemiologia_n22 ficha_epidemiologia_n22 = (Ficha_epidemiologia_n22) objeto;

    Hbox hbox = new Hbox();
    Space space = new Space();

    fila.setStyle("text-align: justify;nowrap:nowrap");
    fila.appendChild(new Label(ficha_epidemiologia_n22.getCodigo_ficha() + ""));
    fila.appendChild(new Label(ficha_epidemiologia_n22.getFecha_inicial() + ""));
    fila.appendChild(new Label(ficha_epidemiologia_n22.getIdentificacion() + ""));

    hbox.appendChild(space);

    Image img = new Image();
    img.setSrc("/images/editar.gif");
    img.setTooltiptext("Editar");
    img.setStyle("cursor: pointer");
    img.addEventListener(
        Events.ON_CLICK,
        new EventListener<Event>() {
          @Override
          public void onEvent(Event arg0) throws Exception {
            mostrarDatos(ficha_epidemiologia_n22);
          }
        });
    hbox.appendChild(img);

    hbox.appendChild(space);
    hbox.appendChild(img);

    fila.appendChild(hbox);

    return fila;
  }
Ejemplo n.º 11
0
  /** Load Format */
  private void cmd_loadFormat() {
    //	clear panel
    previewPanel.getChildren().clear();

    ListItem listitem = pickFormat.getSelectedItem();

    String formatName = (String) listitem.getValue();

    if (formatName.equals(s_none)) return;

    m_format = ImpFormat.load(formatName);

    if (m_format == null) {
      FDialog.error(m_WindowNo, this, formatName);
      return;
    }

    //	pointers

    int size = m_format.getRowCount();
    m_labels = new Label[size];
    m_fields = new Textbox[size];

    for (int i = 0; i < size; i++) {
      ImpFormatRow row = m_format.getRow(i);

      m_labels[i] = new Label(row.getColumnName());

      Hbox hbox = new Hbox();
      hbox.setWidth("100%");
      hbox.setWidths("30%, 70%");
      hbox.setStyle("padding-bottom: 3px");

      hbox.appendChild(m_labels[i].rightAlign());

      int length = row.getEndNo() - row.getStartNo();

      if (length <= 5) length = 5;
      else if (length > 20) length = 20;

      m_fields[i] = new Textbox();
      m_fields[i].setStyle("margin-left: 2px");

      hbox.appendChild(m_fields[i]);

      previewPanel.appendChild(hbox);
    }
    m_record = -1;
    record.setValue("------");
    previewPanel.invalidate();
  } //	cmd_format
  /** Creates the components..<br> */
  private void createComponents() {

    /**
     * !! Windows as NameSpaceContainer to prevent not unique id's error from other dashboard module
     * buttons or other used components.
     */
    Window win = new Window();
    win.setBorder("none");
    win.setParent(this);

    Groupbox gb = new Groupbox();
    gb.setMold("3d");
    gb.setClosable(false);
    gb.setParent(win);
    Caption cap = new Caption();
    cap.setImage("/images/icons/new_icons_10.gif");
    cap.setLabel(Labels.getLabel("common.Application.History"));
    cap.setStyle("padding: 0px;");
    cap.setParent(gb);

    // Buttons Toolbar/Timer
    Div div = new Div();
    div.setSclass("z-toolbar");
    div.setStyle("padding: 0px");
    div.setParent(cap);
    Hbox hbox = new Hbox();
    hbox.setPack("stretch");
    hbox.setSclass("hboxRemoveWhiteStrips");
    hbox.setWidth("100%");
    hbox.setParent(div);
    Toolbar toolbarRight = new Toolbar();
    toolbarRight.setAlign("end");
    toolbarRight.setStyle("float:right; border-style: none;");
    toolbarRight.setParent(hbox);

    Hbox hboxBtn = new Hbox();
    hboxBtn.setSclass("hboxRemoveWhiteStrips");
    hboxBtn.setWidth("100%");
    hboxBtn.setParent(toolbarRight);

    //		Paging paging = new Paging();
    //		paging.setParent(hboxBtn);
    //		paging.setDetailed(true);

    if (isTimerControl()) {
      Button btnTimer = new Button();
      btnTimer.setId("btnTimer");
      btnTimer.setHeight("22px");
      btnTimer.setImage("/images/icons/clock1_16x16.gif");

      // convert to seconds
      int seconds = (int) Math.round(getDelay() / 1000);

      if (seconds > 60) {
        // convert to minutes and set localization to minutes
        int minutes = (int) Math.round((getDelay() / 1000) / 60);
        btnTimer.setTooltiptext(
            Labels.getLabel("btnTimer.tooltiptext")
                + " "
                + minutes
                + " "
                + Labels.getLabel("common.Minutes"));
      } else
        // set localization to seconds
        btnTimer.setTooltiptext(
            Labels.getLabel("btnTimer.tooltiptext")
                + " "
                + seconds
                + " "
                + Labels.getLabel("common.Seconds"));

      btnTimer.addEventListener("onClick", new BtnClickListener());
      btnTimer.setParent(hboxBtn);
    }

    Button btnRefresh = new Button();
    btnRefresh.setId("btnRefresh");
    btnRefresh.setHeight("22px");
    btnRefresh.setLabel("!");
    btnRefresh.setTooltiptext(Labels.getLabel("btnRefresh.tooltiptext"));
    btnRefresh.addEventListener("onClick", new BtnClickListener());
    btnRefresh.setParent(hboxBtn);
    // END Buttons Toolbar/Timer

    // body
    Borderlayout bl = new Borderlayout();
    bl.setHeight(getModulHeight() + "px");
    bl.setParent(gb);
    Center ct = new Center();
    ct.setSclass("FDCenterNoBorder");
    ct.setStyle("background-color: white");
    ct.setFlex(true);
    ct.setParent(bl);

    // Listbox
    listbox = new Listbox();
    listbox.setStyle("border: none;");
    listbox.setHeight("100%");
    listbox.setVisible(true);
    listbox.setParent(ct);
    listbox.setItemRenderer(new ItemRenderer());

    Listhead listhead = new Listhead();
    listhead.setParent(listbox);

    Listheader listheader1 = new Listheader();
    listheader1.setWidth("100px");
    listheader1.setHeight("0px");
    listheader1.setParent(listhead);

    Listheader listheader2 = new Listheader();
    listheader2.setWidth("100%");
    listheader1.setHeight("0px");
    listheader2.setParent(listhead);

    doReadData();
  }
Ejemplo n.º 13
0
  private void init() {
    Grid grid = new Grid();
    grid.setWidth("100%");
    grid.setHeight("100%");
    grid.setStyle("margin:0; padding:0; position: absolute; align: center; valign: center;");
    grid.makeNoStrip();
    grid.setOddRowSclass("even");

    Rows rows = new Rows();
    grid.appendChild(rows);

    Row row = new Row();
    rows.appendChild(row);
    Div div = new Div();
    div.setAlign("right");
    div.appendChild(lNode);
    row.appendChild(div);
    row.appendChild(fNode);
    fNode.setWidth("100%");
    fNode.setReadonly(true);

    row = new Row();
    rows.appendChild(row);
    row.setValign("top");
    div = new Div();
    div.setAlign("right");
    div.appendChild(lDesctiption);
    row.appendChild(div);
    row.appendChild(fDescription);
    fDescription.setMultiline(true);
    fDescription.setWidth("100%");
    fDescription.setReadonly(true);

    row = new Row();
    rows.appendChild(row);
    div = new Div();
    div.setAlign("right");
    div.appendChild(lHelp);
    row.appendChild(div);
    row.appendChild(fHelp);
    fHelp.setMultiline(true);
    fHelp.setWidth("100%");
    fHelp.setReadonly(true);
    fHelp.setRows(3);
    row.appendChild(new Label());

    row = new Row();
    rows.appendChild(row);
    div = new Div();
    div.setAlign("right");
    div.appendChild(lHistory);
    row.appendChild(div);
    row.appendChild(fHistory);
    row.appendChild(new Label());

    row = new Row();
    rows.appendChild(row);
    div = new Div();
    div.setAlign("right");
    div.appendChild(lAnswer);
    row.appendChild(div);
    Hbox hbox = new Hbox();
    hbox.appendChild(fAnswerText);
    hbox.appendChild(fAnswerList);
    hbox.appendChild(fAnswerButton);
    fAnswerButton.addEventListener(Events.ON_CLICK, this);
    row.appendChild(hbox);
    row.appendChild(bZoom);
    bZoom.addEventListener(Events.ON_CLICK, this);

    row = new Row();
    rows.appendChild(row);
    div = new Div();
    div.setAlign("right");
    div.appendChild(lTextMsg);
    row.appendChild(div);
    row.appendChild(fTextMsg);
    fTextMsg.setMultiline(true);
    fTextMsg.setWidth("100%");
    row.appendChild(new Label());

    row = new Row();
    rows.appendChild(row);
    div = new Div();
    div.setAlign("right");
    div.appendChild(lForward);
    row.appendChild(div);
    hbox = new Hbox();
    hbox.appendChild(fForward.getComponent());
    hbox.appendChild(lOptional);
    row.appendChild(hbox);
    row.appendChild(bOK);
    bOK.addEventListener(Events.ON_CLICK, this);

    Borderlayout layout = new Borderlayout();
    layout.setWidth("100%");
    layout.setHeight("100%");
    layout.setStyle("background-color: transparent; position: absolute;");

    North north = new North();
    north.appendChild(listbox);
    north.setSplittable(true);
    north.setFlex(true);
    north.setHeight("50%");
    layout.appendChild(north);
    north.setStyle("background-color: transparent");
    listbox.addEventListener(Events.ON_SELECT, this);

    Center center = new Center();
    center.appendChild(grid);
    layout.appendChild(center);
    center.setStyle("background-color: transparent");
    center.setFlex(true);

    South south = new South();
    south.appendChild(statusBar);
    layout.appendChild(south);
    south.setStyle("background-color: transparent");

    this.appendChild(layout);
    this.setStyle("height: 100%; width: 100%; position: absolute;");
  }
Ejemplo n.º 14
0
  private void initLayout() {
    txtDocumentNo.setWidth("100%");
    txtDescription.setWidth("100%");
    txtOrderRef.setWidth("100%");
    dateFrom.setWidth("165px");
    dateTo.setWidth("165px");
    amountFrom.getDecimalbox().setWidth("155px");
    amountTo.getDecimalbox().setWidth("155px");

    Grid grid = GridFactory.newGridLayout();

    Rows rows = new Rows();
    grid.appendChild(rows);

    Row row = new Row();
    rows.appendChild(row);
    row.appendChild(lblDocumentNo.rightAlign());
    row.appendChild(txtDocumentNo);
    row.appendChild(editorBPartner.getLabel().rightAlign());
    row.appendChild(editorBPartner.getComponent());
    row.appendChild(isSoTrx);

    row = new Row();
    row.setSpans("1, 1, 1, 2");
    rows.appendChild(row);
    row.appendChild(lblDescription.rightAlign());
    row.appendChild(txtDescription);
    row.appendChild(lblDateOrdered.rightAlign());
    Hbox hbox = new Hbox();
    hbox.appendChild(dateFrom);
    hbox.appendChild(new Label("-"));
    hbox.appendChild(dateTo);
    row.appendChild(hbox);

    row = new Row();
    row.setSpans("1, 1, 1, 2");
    rows.appendChild(row);
    row.appendChild(lblOrderRef.rightAlign());
    row.appendChild(txtOrderRef);
    row.appendChild(lblGrandTotal.rightAlign());
    hbox = new Hbox();
    hbox.appendChild(amountFrom);
    hbox.appendChild(new Label("-"));
    hbox.appendChild(amountTo);
    row.appendChild(hbox);

    layout = new Borderlayout();
    layout.setWidth("100%");
    layout.setHeight("100%");
    if (!isLookup()) {
      layout.setStyle("position: absolute");
    }
    this.appendChild(layout);

    North north = new North();
    layout.appendChild(north);
    north.appendChild(grid);

    Center center = new Center();
    layout.appendChild(center);
    center.setFlex(true);
    Div div = new Div();
    div.appendChild(contentPanel);
    if (isLookup()) contentPanel.setWidth("99%");
    else contentPanel.setStyle("width: 99%; margin: 0px auto;");
    contentPanel.setVflex(true);
    div.setStyle("width :100%; height: 100%");
    center.appendChild(div);

    South south = new South();
    layout.appendChild(south);
    southBody = new Vbox();
    southBody.setWidth("100%");
    south.appendChild(southBody);
    southBody.appendChild(confirmPanel);
    southBody.appendChild(new Separator());
    southBody.appendChild(statusBar);
  }