private void appendOperations(final Row row) { Button buttonRemove = new Button(); buttonRemove.setParent(row); buttonRemove.setClass("icono"); buttonRemove.setImage("/common/img/ico_borrar1.png"); buttonRemove.setHoverImage("/common/img/ico_borrar.png"); buttonRemove.setTooltiptext(_("Delete")); buttonRemove.addEventListener(Events.ON_CLICK, new EventListener() { @Override public void onEvent(Event event) { confirmRemove((TaskQualityForm) row.getValue()); } }); }
@Override public void doAfterCompose(Component comp) throws Exception { // TODO Auto-generated method stub timeplot = new Timeplot(); ValueGeometry vg = new DefaultValueGeometry(); vg.setGridColor("#000000"); vg.setAxisLabelsPlacement("left"); TimeGeometry tg = new DefaultTimeGeometry(); tg.setGridStep(2 * 60 * 60 * 1000); tg.setAxisLabelsPlacement("bottom"); tg.setGridStepRange(30 * 60 * 1000); timeplot.setWidth("100%"); timeplot.setHeight("300px"); plotinfo = new Plotinfo(); plotinfo.setShowValues(true); ListModelList dataModel = new ListModelList(initDataMode()); plotinfo.setDataModel(dataModel); plotinfo.setParent(timeplot); plotinfo.setTimeGeometry(tg); plotinfo.setValueGeometry(vg); timeplot.setParent(comp); Button btn = new Button("click"); btn.setParent(comp); btn.addEventListener( "onClick", new EventListener() { @Override public void onEvent(Event event) throws Exception { // TODO Auto-generated method stub ListModelList dml = (ListModelList) plotinfo.getDataModel(); TimeplotData td = new TimeplotData(); td.setTime(new Date(time + 1000 * 60 * 60 * 8)); td.setValue(10f); dml.add(td); } }); }
@Override public void render(final Row row, Object object) throws Exception { if (inputfmtcombo != null) { inputRateSelected = inputfmtcombo.getText(); if (!inputRateSelected.contains("VFI_")) inputRateSelected = "VFI_" + inputRateSelected; } final DefaultFormatMapEntries fmtMapEntry = (DefaultFormatMapEntries) object; final Combobox inputFormatCombo = new Combobox(); inputFormatCombo.setReadonly(true); String rateFormat = fmtMapEntry.getRateFormat(); if (rateFormat.contains("VF_")) rateFormat = rateFormat.replaceAll("VF_", ""); inputFormatCombo.setText(rateFormat); rateForamatSelected.add(rateFormat); if (fmtMapEntry.isOnEdit()) inputFormatCombo.setDisabled(true); final Collection<String> comboRateArray = new ArrayList<String>(); if (inputRateSelected.equals("VFI_480i")) { comboRateArray.add(VideoFormatT.findByValue(21).toString().replaceAll("VF_", "")); comboRateArray.add(VideoFormatT.findByValue(22).toString().replaceAll("VF_", "")); comboRateArray.add(VideoFormatT.findByValue(23).toString().replaceAll("VF_", "")); } else { comboRateArray.add(VideoFormatT.findByValue(1).toString().replaceAll("VF_", "")); comboRateArray.add(VideoFormatT.findByValue(2).toString().replaceAll("VF_", "")); comboRateArray.add(VideoFormatT.findByValue(3).toString().replaceAll("VF_", "")); comboRateArray.add(VideoFormatT.findByValue(4).toString().replaceAll("VF_", "")); comboRateArray.add(VideoFormatT.findByValue(5).toString().replaceAll("VF_", "")); } comboRateArray.removeAll(rateForamatSelected); inputFormatCombo.setModel(new ListModelList(comboRateArray)); ComboitemRenderer renderer = new ComboitemRenderer() { @Override public void render(Comboitem item, Object data) throws Exception { String audiotype = data.toString(); item.setLabel(audiotype); } }; inputFormatCombo.setItemRenderer(renderer); inputFormatCombo.addEventListener( Events.ON_OPEN, new EventListener() { public void onEvent(Event event) throws Exception { // inputFormatCombo.getModel().getSize(); comboRateArray.removeAll(rateForamatSelected); inputFormatCombo.setModel(new ListModelList(comboRateArray)); } }); inputFormatCombo.addEventListener( Events.ON_CHANGE, new EventListener() { public void onEvent(Event event) throws Exception { String rateformtname = inputFormatCombo.getText(); if (!rateformtname.contains("VF_")) rateformtname = "VF_" + rateformtname; fmtMapEntry.setRateFormat(rateformtname); System.out.println("......." + rateForamatSelected + rateformtname); rateForamatSelected.add(inputFormatCombo.getText()); inputFormatCombo.setDisabled(true); } }); inputFormatCombo.setParent(row); final Intbox bitrateIntBox = new Intbox(); bitrateIntBox.setMaxlength(5); bitrateIntBox.setConstraint(new IntValueConstraint()); bitrateIntBox.setText(fmtMapEntry.getBitRate()); bitrateIntBox.addEventListener( Events.ON_CHANGE, new EventListener() { public void onEvent(Event event) throws Exception { try { fmtMapEntry.setBitRate(bitrateIntBox.getText()); } catch (Exception e) { e.printStackTrace(); } } }); bitrateIntBox.setParent(row); final Button cancelBtn = new Button(); cancelBtn.setSclass("check_off"); cancelBtn.setTooltiptext("Delete"); cancelBtn.addEventListener( Events.ON_CLICK, new EventListener() { public void onEvent(Event event) throws Exception { if (row.getGrid().getListModel().getSize() > 1) { removeRow(row); } else { Messagebox.show( "Sorry,You will not be able to delete this row.!", "Aereo", Messagebox.OK, Messagebox.INFORMATION); } } }); cancelBtn.setParent(row); }
/** 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(); }
@SuppressWarnings("unchecked") public void carregaInterface() { Vbox candidatos = new Vbox(); candidatos.setParent(this); new Label("Disponíveis:").setParent(candidatos); lbDisponiveis.setParent(candidatos); lbDisponiveis.setHeight("300px"); lbDisponiveis.setRows(10); lbDisponiveis.setMultiple(true); lbDisponiveis.appendChild(defineCabecalho()); botoes.setSpacing("15px"); botoes.setAlign("center"); botoes.setPack("center"); botoes.setParent(this); btSelecionaTodos.setParent(botoes); btSelecionaTodos.setLabel(">>"); btSelecionaTodos.addEventListener( "onClick", new EventListener() { @Override public void onEvent(Event arg0) throws Exception { List<Listitem> itens = new ArrayList<Listitem>(); itens.addAll(lbDisponiveis.getItems()); for (Listitem listitem : itens) { listitem.setParent(lbSelecionados); } } }); btSelecionaUm.setParent(botoes); btSelecionaUm.setLabel(">"); btSelecionaUm.addEventListener( "onClick", new EventListener() { @Override public void onEvent(Event arg0) throws Exception { List<Listitem> itens = new ArrayList<Listitem>(); itens.addAll(lbDisponiveis.getSelectedItems()); for (Listitem listitem : itens) { listitem.setParent(lbSelecionados); } } }); btRemoveUm.setParent(botoes); btRemoveUm.setLabel("<"); btRemoveUm.addEventListener( "onClick", new EventListener() { @Override public void onEvent(Event arg0) throws Exception { List<Listitem> itens = new ArrayList<Listitem>(); itens.addAll(lbSelecionados.getSelectedItems()); for (Listitem listitem : itens) { listitem.setParent(lbDisponiveis); } } }); btRemoveTodos.setParent(botoes); btRemoveTodos.setLabel("<<"); btRemoveTodos.addEventListener( "onClick", new EventListener() { @Override public void onEvent(Event arg0) throws Exception { List<Listitem> itens = new ArrayList<Listitem>(); itens.addAll(lbSelecionados.getItems()); for (Listitem listitem : itens) { listitem.setParent(lbDisponiveis); } } }); Vbox selecionados = new Vbox(); selecionados.setParent(this); new Label("Selecionados:").setParent(selecionados); lbSelecionados.setParent(selecionados); lbSelecionados.setHeight("300px"); lbSelecionados.setMultiple(true); lbSelecionados.appendChild(defineCabecalho()); preencheListbox(); }