@Override protected Canvas createRecordComponent(final ListGridRecord record, Integer colNum) { if (record != null) { String fieldName = this.getFieldName(colNum); if (fieldName.equals(EditRulesLayout.EDIT_RULES_COPY)) { // Copy button IButton copyButton = new IButton(i18n.copy()); copyButton.setShowDown(false); copyButton.setShowRollOver(false); copyButton.setHeight(17); copyButton.setLayoutAlign(Alignment.CENTER); copyButton.setAlign(Alignment.CENTER); copyButton.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { System.out.println("copy " + record.getAttribute("name")); String userID = getLoggedInUserId(); EventBus.getMainEventBus() .fireEvent(new CopyEvent(userID, record.getAttribute("name"))); } }); return copyButton; } return null; } return null; }
public PCAPanel(DatasetInformation datasetInfo) { this.setWidth("400px"); this.setHeight("150px"); this.setTitle("Principal component analysis"); this.setShowMinimizeButton(false); this.setIsModal(false); this.centerInPage(); this.addCloseClickHandler( new CloseClickHandler() { @Override public void onCloseClick(CloseClickEvent event) { hide(); destroy(); } }); VLayout vp = new VLayout(); vp.setWidth100(); vp.setHeight100(); this.addItem(vp); HLayout hp1 = new HLayout(); hp1.setWidth100(); hp1.setHeight("20px"); Label l1 = new Label("X AXES "); l1.setHeight("20px"); l1.setWidth("100px"); pcaI = new ListBox(); pcaI.setWidth("200px"); pcaI.setHeight("20px"); pcaI.setTitle("X AXES"); hp1.addMember(l1); hp1.addMember(pcaI); hp1.setMargin(5); vp.addMember(hp1); hp1.setAlign(Alignment.LEFT); HLayout hp2 = new HLayout(); hp2.setWidth100(); hp2.setHeight("20px"); Label l2 = new Label("Y AXES "); l2.setHeight("20px"); l2.setWidth("100px"); pcaII = new ListBox(); pcaII.setWidth("200px"); pcaII.setHeight("20px"); pcaII.setTitle("Y AXES"); hp2.addMember(l2); hp2.addMember(pcaII); hp2.setMargin(5); vp.addMember(hp2); hp2.setAlign(Alignment.LEFT); if (datasetInfo != null) { for (String str : datasetInfo.getColsNames()) { pcaI.addItem(str); pcaII.addItem(str); } pcaI.setSelectedIndex(0); pcaII.setSelectedIndex(1); } okBtn = new IButton("Start Process"); okBtn.setWidth("200px"); okBtn.setAlign(Alignment.CENTER); okBtn.setShowRollOver(true); okBtn.setShowDown(true); okBtn.setTitleStyle("stretchTitle"); HLayout btnLayout = new HLayout(); btnLayout.setWidth100(); btnLayout.setHeight("20px"); btnLayout.addMember(okBtn); btnLayout.setAlign(Alignment.CENTER); vp.addMember(btnLayout); vp.setTop(20); vp.setMembersMargin(15); this.show(); }