List of usage examples for com.google.gwt.user.client.ui Hidden Hidden
protected Hidden(Element element)
From source file:com.ephesoft.gxt.batchinstance.client.presenter.TroubleshootPresenter.java
License:Open Source License
public void onUploadClicked() { boolean atLeastOneChecked = view.checkSelectedOptions(); if (!atLeastOneChecked) { // ConfirmationDialogUtil.showConfirmationDialogError(localeDictionary // .getMessageValue(BatchInstanceMessages.NO_OPTION_SELECTED_ERROR_MESSAGE)); DialogUtil.showMessageDialog(/* w w w. ja v a 2s . c om*/ LocaleDictionary.getConstantValue(BatchInstanceConstants.ERROR_TITLE), LocaleDictionary .getMessageValue(BatchInstanceMessages.NO_ARTIFACTS_SELECTED_FOR_TROUBLESHOOTING), DialogIcon.ERROR); } else if (StringUtil.isNullOrEmpty(view.getUsernameValue())) { DialogUtil.showMessageDialog(LocaleDictionary.getConstantValue(BatchInstanceConstants.ERROR_TITLE), LocaleDictionary.getMessageValue(BatchInstanceMessages.USERNAME_NOT_DEFINED), DialogIcon.ERROR); } else if (StringUtil.isNullOrEmpty(view.getPasswordValue())) { DialogUtil.showMessageDialog(LocaleDictionary.getConstantValue(BatchInstanceConstants.ERROR_TITLE), LocaleDictionary.getMessageValue(BatchInstanceMessages.PASSWORD_NOT_DEFINED), DialogIcon.ERROR); } else if (StringUtil.isNullOrEmpty(view.getServerURLValue())) { DialogUtil.showMessageDialog(LocaleDictionary.getConstantValue(BatchInstanceConstants.ERROR_TITLE), LocaleDictionary.getMessageValue(BatchInstanceMessages.SERVER_NOT_DEFINED), DialogIcon.ERROR); } else if (StringUtil.isNullOrEmpty(view.getTicketNoValue())) { DialogUtil.showMessageDialog(LocaleDictionary.getConstantValue(BatchInstanceConstants.ERROR_TITLE), LocaleDictionary.getMessageValue(BatchInstanceMessages.TICKET_ID_NOT_DEFINED), DialogIcon.ERROR); } else { hiddenFieldsContainer = new VerticalLayoutContainer(); addSelectedBatchIDToContainer(); addSelectedCheckboxToContainer(); addUploadParametersToConainer(); if (null != hiddenFieldsContainer) { selectedRadioButton = new Hidden("selectedRadioButton"); selectedRadioButton.setValue(BatchInfoConstants.UPLOAD_RADIO); hiddenFieldsContainer.add(selectedRadioButton); } view.addAndSubmitForm(hiddenFieldsContainer); } }
From source file:com.ephesoft.gxt.batchinstance.client.presenter.TroubleshootPresenter.java
License:Open Source License
private void addUploadParametersToConainer() { if (null != hiddenFieldsContainer) { final String userName = view.getUsernameValue(); final String password = view.getPasswordValue(); final String ftpPath = view.getServerURLValue(); final String ticketID = view.getTicketNoValue(); if (!StringUtil.isNullOrEmpty(userName)) { final Hidden userNameField = new Hidden(BatchInfoConstants.USERNAME_TEXT_BOX); userNameField.setValue(userName); hiddenFieldsContainer.add(userNameField); }/*from w ww.j ava2s . c om*/ if (!StringUtil.isNullOrEmpty(password)) { final Hidden passwordField = new Hidden(BatchInfoConstants.PASSWORD_TEXT_BOX); passwordField.setValue(password); hiddenFieldsContainer.add(passwordField); } if (!StringUtil.isNullOrEmpty(ftpPath)) { final Hidden ftpPathField = new Hidden(BatchInfoConstants.FTP_PATH_TEXT_BOX); ftpPathField.setValue(ftpPath); hiddenFieldsContainer.add(ftpPathField); } if (!StringUtil.isNullOrEmpty(ticketID)) { final Hidden ticketIDField = new Hidden(BatchInfoConstants.TICKET_TEXT_BOX); ticketIDField.setValue(ticketID); hiddenFieldsContainer.add(ticketIDField); } } }
From source file:com.ephesoft.gxt.batchinstance.client.view.BatchInstanceDetailView.java
License:Open Source License
private void initializeFormPanel() { batchInstanceLogFilePath = new Hidden(BatchInfoConstants.BI_LOG_FILE_PATH); batchInstanceIdentifierField = new Hidden(BatchInfoConstants.BATCH_INSTANCE_IDENTIFIER); logFileDownloadPanel = new FormPanel(); logFliePathPanel = new VerticalPanel(); logFileDownloadPanel.add(logFliePathPanel); logFileDownloadPanel.setMethod(FormPanel.METHOD_POST); logFileDownloadPanel.setAction(LOG_FILE_DOWNLOAD_ACTION); batchInstanceLogFilePath = new Hidden(BatchInfoConstants.BI_LOG_FILE_PATH); logFliePathPanel.add(batchInstanceIdentifierField); logFliePathPanel.add(batchInstanceLogFilePath); logFileDownloadPanel.addSubmitHandler(new SubmitHandler() { @Override/*w w w. ja v a 2s. c o m*/ public void onSubmit(final SubmitEvent event) { } }); logFileDownloadPanel.addSubmitCompleteHandler(new SubmitCompleteHandler() { @Override public void onSubmitComplete(final SubmitCompleteEvent event) { if (event.getResults().toLowerCase().indexOf(BatchInstanceConstants.ERROR) > -1) { DialogUtil.showMessageDialog( LocaleDictionary.getConstantValue(LocaleCommonConstants.ERROR_TITLE), LocaleDictionary.getMessageValue(BatchInstanceMessages.LOG_FILE_DOWNLOAD_ERROR_MESSAGE), DialogIcon.ERROR); // return; } } }); }
From source file:com.ephesoft.gxt.batchinstance.client.view.TroubleshootView.java
License:Open Source License
public void addSelectedCheckboxToForm() { if (null != hiddenFieldsContainer) { final List<TroubleshootDTO> selectedCheckboxList = tree.getCheckedSelection(); if (CollectionUtil.isEmpty(selectedCheckboxList)) { DialogUtil.showMessageDialog( LocaleDictionary.getConstantValue(BatchInstanceConstants.INFO_TITLE), LocaleDictionary .getMessageValue(BatchInstanceMessages.NO_ARTIFACTS_SELECTED_FOR_TROUBLESHOOTING), DialogIcon.ERROR);//from w ww .j av a 2 s.c om } else { Hidden selectedCheckbox = null; for (final TroubleshootDTO checkbox : selectedCheckboxList) { selectedCheckbox = new Hidden(checkbox.getName()); selectedCheckbox.setName(checkbox.getName()); selectedCheckbox.setValue("true"); hiddenFieldsContainer.add(selectedCheckbox); } } } }
From source file:edu.umn.msi.tropix.webgui.client.widgets.GWTDownloadFormPanel.java
License:Open Source License
private void addExtraParameter(final String extraParameter) { final Hidden item = new Hidden(extraParameter); this.vp.add(item); this.parameters.put(extraParameter, item); }
From source file:n3phele.client.widgets.S3UploadPanel.java
License:Open Source License
protected S3UploadPanel() { this.setWidth("500px"); flow = new FlowPanel(); this.add(flow); this.addStyleName(N3phele.n3pheleResource.css().workspacePanel()); Cell<MenuItem> cell = new IconTextCell<MenuItem>(32, 32); header = new HorizontalPanel(); header.setWidth("100%"); header.addStyleName(N3phele.n3pheleResource.css().workspacePanelHeader()); header.add(new CellWidget<MenuItem>(cell, new MenuItem(N3phele.n3pheleResource.uploadIcon(), "File Upload", null))); flow.add(header);/*from w ww .j av a 2 s . c o m*/ quitWidget = new PushButton(new Image(N3phele.n3pheleResource.dialog_close()), new ClickHandler() { @Override public void onClick(ClickEvent event) { cancelled = true; S3UploadPanel.this.uploadPopup.hide(); } }); quitWidget.setWidth(N3phele.n3pheleResource.dialog_close().getWidth() + 4 + "px"); quitWidget.setHeight(N3phele.n3pheleResource.dialog_close().getHeight() + 4 + "px"); header.add(quitWidget); header.setCellHorizontalAlignment(quitWidget, HorizontalPanel.ALIGN_RIGHT); header.setCellVerticalAlignment(quitWidget, HorizontalPanel.ALIGN_TOP); this.setEncoding(FormPanel.ENCODING_MULTIPART); this.setMethod(FormPanel.METHOD_POST); key = new Hidden("key"); flow.add(key); awsAccessKeyId = new Hidden("AWSAccessKeyId"); flow.add(awsAccessKeyId); acl = new Hidden("acl", "private"); flow.add(acl); success_action = new Hidden("success_action_status", "201"); flow.add(success_action); policy = new Hidden("policy"); flow.add(policy); signature = new Hidden("signature"); flow.add(signature); contentType = new Hidden("Content-Type"); flow.add(contentType); table = new FlexTable(); flow.add(table); table.setWidth("490px"); fileUpload = new FileUpload(); fileUpload.setName("file"); fileUpload.setWidth("100%"); fileUpload.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent event) { filename.setText(getFilename(fileUpload.getFilename())); upload.setEnabled(fileUpload.getFilename() != null && fileUpload.getFilename().length() > 0); } }); InlineHTML step1 = new InlineHTML("Step 1:"); step1.setStyleName(N3phele.n3pheleResource.css().repoContentElementName()); table.setWidget(0, 0, step1); InlineHTML step1Text = new InlineHTML("Choose file to upload"); step1Text.setStyleName(N3phele.n3pheleResource.css().repoContentElementName()); table.setWidget(0, 1, step1Text); table.setWidget(0, 2, fileUpload); InlineHTML step2 = new InlineHTML("Step 2:"); step2.setStyleName(N3phele.n3pheleResource.css().repoContentElementName()); table.setWidget(1, 0, step2); InlineHTML step2Text = new InlineHTML("Set Destination"); step2Text.setStyleName(N3phele.n3pheleResource.css().repoContentElementName()); table.setWidget(1, 1, step2Text); destination = new HTML("/"); table.setWidget(1, 2, destination); destination.setStyleName(N3phele.n3pheleResource.css().repoContentUploadPath()); filename = new TextBox(); table.setWidget(1, 3, filename); upload = new Button("upload"); upload.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { canonicalName = path; if (path == null || path.length() == 0) { canonicalName = filename.getText().trim(); } else { canonicalName = path + filename.getText().trim(); ; } if (activity != null) { upload.setEnabled(false); activity.getSignature(canonicalName); } } }); table.setWidget(2, 3, upload); this.addSubmitHandler(new SubmitHandler() { @Override public void onSubmit(SubmitEvent event) { GWT.log("submit ..." + event.toString()); } }); this.addSubmitCompleteHandler(new SubmitCompleteHandler() { @Override public void onSubmitComplete(SubmitCompleteEvent event) { cancelled = false; S3UploadPanel.this.uploadPopup.hide(); activity.uploadComplete(canonicalName); } }); flow.add(upload); table.getFlexCellFormatter().setColSpan(0, 2, 2); table.getFlexCellFormatter().setWidth(0, 0, "10%"); table.getFlexCellFormatter().setWidth(0, 2, "70%"); // table.getFlexCellFormatter().setWidth(1, 2, "200px"); table.getFlexCellFormatter().setWidth(1, 3, "30%"); }
From source file:n3phele.client.widgets.UploadPanel.java
License:Open Source License
protected UploadPanel() { this.setWidth("500px"); flow = new FlowPanel(); this.add(flow); this.addStyleName(N3phele.n3pheleResource.css().workspacePanel()); Cell<MenuItem> cell = new IconTextCell<MenuItem>(32, 32); header = new HorizontalPanel(); header.setWidth("100%"); header.addStyleName(N3phele.n3pheleResource.css().workspacePanelHeader()); header.add(new CellWidget<MenuItem>(cell, new MenuItem(N3phele.n3pheleResource.uploadIcon(), "File Upload", null))); flow.add(header);/* w w w. j a v a2 s . c o m*/ quitWidget = new PushButton(new Image(N3phele.n3pheleResource.dialog_close()), new ClickHandler() { @Override public void onClick(ClickEvent event) { cancelled = true; UploadPanel.this.uploadPopup.hide(); } }); quitWidget.setWidth(N3phele.n3pheleResource.dialog_close().getWidth() + 4 + "px"); quitWidget.setHeight(N3phele.n3pheleResource.dialog_close().getHeight() + 4 + "px"); header.add(quitWidget); header.setCellHorizontalAlignment(quitWidget, HorizontalPanel.ALIGN_RIGHT); header.setCellVerticalAlignment(quitWidget, HorizontalPanel.ALIGN_TOP); this.setEncoding(FormPanel.ENCODING_MULTIPART); this.setMethod(FormPanel.METHOD_POST); key = new Hidden("key"); flow.add(key); awsAccessKeyId = new Hidden("AWSAccessKeyId"); flow.add(awsAccessKeyId); acl = new Hidden("acl", "private"); flow.add(acl); success_action = new Hidden("success_action_status", "201"); flow.add(success_action); policy = new Hidden("policy"); flow.add(policy); signature = new Hidden("signature"); flow.add(signature); contentType = new Hidden("Content-Type"); flow.add(contentType); table = new FlexTable(); flow.add(table); table.setWidth("490px"); fileUpload = new FileUpload(); fileUpload.setName("file"); fileUpload.setWidth("100%"); fileUpload.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent event) { filename.setText(getFilename(fileUpload.getFilename())); upload.setEnabled(fileUpload.getFilename() != null && fileUpload.getFilename().length() > 0); } }); InlineHTML step1 = new InlineHTML("Step 1:"); step1.setStyleName(N3phele.n3pheleResource.css().repoContentElementName()); table.setWidget(0, 0, step1); InlineHTML step1Text = new InlineHTML("Choose file to upload"); step1Text.setStyleName(N3phele.n3pheleResource.css().repoContentElementName()); table.setWidget(0, 1, step1Text); table.setWidget(0, 2, fileUpload); InlineHTML step2 = new InlineHTML("Step 2:"); step2.setStyleName(N3phele.n3pheleResource.css().repoContentElementName()); table.setWidget(1, 0, step2); InlineHTML step2Text = new InlineHTML("Set Destination"); step2Text.setStyleName(N3phele.n3pheleResource.css().repoContentElementName()); table.setWidget(1, 1, step2Text); destination = new HTML("/"); table.setWidget(1, 2, destination); destination.setStyleName(N3phele.n3pheleResource.css().repoContentUploadPath()); filename = new TextBox(); table.setWidget(1, 3, filename); upload = new Button("upload"); upload.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { canonicalName = path; if (path == null || path.length() == 0) { canonicalName = filename.getText().trim(); } else { canonicalName = path + filename.getText().trim(); ; } if (activity != null) { upload.setEnabled(false); activity.getSignature(canonicalName); } } }); table.setWidget(2, 3, upload); this.addSubmitHandler(new SubmitHandler() { @Override public void onSubmit(SubmitEvent event) { GWT.log("submit ..." + event.toString()); } }); this.addSubmitCompleteHandler(new SubmitCompleteHandler() { @Override public void onSubmitComplete(SubmitCompleteEvent event) { cancelled = false; UploadPanel.this.uploadPopup.hide(); } }); flow.add(upload); table.getFlexCellFormatter().setColSpan(0, 2, 2); table.getFlexCellFormatter().setWidth(0, 0, "10%"); table.getFlexCellFormatter().setWidth(0, 2, "70%"); // table.getFlexCellFormatter().setWidth(1, 2, "200px"); table.getFlexCellFormatter().setWidth(1, 3, "30%"); }
From source file:org.dataconservancy.dcs.access.client.ui.UploadBagDialog.java
License:Apache License
public UploadBagDialog(String bagUrl //, final CaptionPanel researchObjectPanel, final Button ingestButton ) {/*from ww w . j ava2 s. c om*/ dBox = new DialogBox(false, true); Panel panel = new FlowPanel(); dBox.setAnimationEnabled(true); dBox.setText("Upload Bag as a .zip file"); dBox.setWidget(panel); dBox.center(); final HorizontalPanel buttons = new HorizontalPanel(); buttons.setSpacing(5); Button upload = new Button("Upload"); Button cancel = new Button("Cancel"); buttons.add(upload); buttons.add(cancel); final FormPanel form = new FormPanel(); FlowPanel formcontents = new FlowPanel(); form.add(formcontents); Hidden depositurl = new Hidden("bagUrl"); depositurl.setValue(bagUrl); final FileUpload upfile = new FileUpload(); upfile.setName("file"); formcontents.add(upfile); formcontents.add(depositurl); form.setMethod(FormPanel.METHOD_POST); form.setEncoding(FormPanel.ENCODING_MULTIPART); form.setAction(SeadApp.BAG_UPLOAD_URL); panel.add(new Label("Uploaded files will be included in the SIP.")); panel.add(form); panel.add(buttons); upload.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { form.submit(); } }); cancel.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { dBox.hide(); } }); form.addSubmitCompleteHandler(new SubmitCompleteHandler() { public void onSubmitComplete(SubmitCompleteEvent event) { if (event.getResults() == null) { Window.alert("File upload failed"); dBox.hide(); return; } String[] tempString = event.getResults().split(";"); final String sipPath = tempString[tempString.length - 1].split("<")[0]; String jsonString = event.getResults(); jsonString = jsonString.substring(jsonString.indexOf('{'), jsonString.lastIndexOf('}') + 1); dBox.hide(); JsDcp dcp = JsDcp.create(); JsSearchResult result = JsSearchResult.create(jsonString); for (int i = 0; i < result.matches().length(); i++) { Util.add(dcp, result.matches().get(i)); } PublishDataView.EVENT_BUS.fireEvent(new EntityEditEvent(dcp, true, sipPath)); } }); }
From source file:org.dataconservancy.dcs.access.client.ui.UploadFgdcDialog.java
License:Apache License
public UploadFgdcDialog(String fileUploadUrl) { dBox = new DialogBox(false, true); Panel panel = new FlowPanel(); dBox.setAnimationEnabled(true);/*from w w w .j av a 2s. c o m*/ // dBox.setText("Upload local file"); dBox.setStyleName("dialogBox"); dBox.setWidget(panel); dBox.center(); final HorizontalPanel buttons = new HorizontalPanel(); buttons.setSpacing(5); Button upload = new Button("Upload"); Button cancel = new Button("Cancel"); buttons.add(upload); buttons.add(cancel); final FormPanel form = new FormPanel(); FlowPanel formcontents = new FlowPanel(); form.add(formcontents); final FileUpload upfile = new FileUpload(); upfile.setName("file"); Hidden depositurl = new Hidden("depositurl"); depositurl.setValue(fileUploadUrl); //depositConfig.fileUploadUrl()); formcontents.add(upfile); formcontents.add(depositurl); form.setMethod(FormPanel.METHOD_POST); form.setEncoding(FormPanel.ENCODING_MULTIPART); form.setAction(SeadApp.FILE_UPLOAD_URL); panel.add(Util.label("Upload Metadata file to be included in the SIP.", "greenFont")); panel.add(form); panel.add(buttons); upload.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { form.submit(); } }); cancel.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { dBox.hide(); } }); form.addSubmitCompleteHandler(new SubmitCompleteHandler() { public void onSubmitComplete(SubmitCompleteEvent event) { if (event.getResults() == null) { Window.alert("File upload failed"); dBox.hide(); return; } String[] parts = event.getResults().split("\\^"); if (parts.length != 4) { Window.alert("File upload failed: " + event.getResults()); dBox.hide(); return; } String filesrc = parts[1].trim(); MediciIngestPresenter.metadataSrc = filesrc; dBox.hide(); MediciIngestPresenter.mdCb.setText("Uploaded Metadata!"); MediciIngestPresenter.mdCb.setEnabled(false); //Fire an event to update FGDC's successful update } }); }
From source file:org.dataconservancy.dcs.access.client.view.PublishDataView.java
License:Creative Commons License
public PublishDataView() { publishContainer = new VerticalPanel(); publishContainer.addStyleName("PublishContainer"); projectDesciptionPanel = new CaptionPanel("Project Description"); researchObjectPanel = new CaptionPanel("Research Object"); licensePanel = new CaptionPanel("License "); projectDesciptionPanel.setStyleName("CaptionPanelStyle"); researchObjectPanel.setStyleName("CaptionPanelStyle"); licensePanel.setStyleName("CaptionPanelStyle"); publishContainer.add(researchObjectPanel); publishContainer.add(projectDesciptionPanel); publishContainer.add(licensePanel);//from w w w .j av a 2 s . co m Grid project = new Grid(3, 2); Label projectName = new Label("Project Name"); projectList = new ListBox(false); Label projectDescription = new Label("Project Description"); project.setCellSpacing(3); project.setCellPadding(3); projectNameTB = new TextBox(); projectNameTB.setEnabled(false); project.setWidget(0, 0, projectName); project.setWidget(0, 1, projectNameTB); abstractTB = new TextArea(); abstractTB.setEnabled(false); project.setWidget(1, 0, projectDescription); project.setWidget(1, 1, abstractTB); VerticalPanel descriptionPanel = new VerticalPanel(); descriptionPanel.add(project); warningPanel = new VerticalPanel(); descriptionPanel.add(warningPanel); projectDesciptionPanel.add(descriptionPanel); Grid ROGrid = new Grid(4, 2); Label uploadLabel = new Label("Upload Local Bag"); previewButton = new Button("Submit Dataset for Review"); form = new FormPanel(); FlowPanel formcontents = new FlowPanel(); form.add(formcontents); Hidden depositurl = new Hidden("bagUrl"); depositurl.setValue(SeadApp.bagIturl); final FileUpload upfile = new FileUpload(); upfile.setName("file"); formcontents.add(upfile); formcontents.add(depositurl); form.setMethod(FormPanel.METHOD_POST); form.setEncoding(FormPanel.ENCODING_MULTIPART); form.setAction(SeadApp.BAG_UPLOAD_URL); Grid uploadGrid = new Grid(4, 2); uploadGrid.setWidget(1, 0, uploadLabel); uploadGrid.setWidget(1, 1, form); uploadBag = new Button("Upload"); uploadGrid.setWidget(3, 1, uploadBag); ROGrid.setCellSpacing(3); ROGrid.setCellPadding(3); // ROGrid.setWidget(0, 0, ROLabel); //ROGrid.setWidget(0, 1, ROList); //ROGrid.setWidget(1, 1, new HTML("Or")); //ROGrid.setWidget(2, 1, browsePanel); //ROGrid.setWidget(2, 1, uploadBag); researchObjectPanel.add(uploadGrid); Panel innerLicensePanel = new FlowPanel(); errorMessage = new Label(); licenseBox = new CheckBox( "By clicking this checkbox, I certify that I agree to release my research data under the terms of the Creative Commons license."); innerLicensePanel.add(errorMessage); innerLicensePanel.add(licenseBox); licensePanel.add(innerLicensePanel); HorizontalPanel previewButtonPanel = new HorizontalPanel(); previewButtonPanel.setWidth("600px"); previewButtonPanel.setStyleName("Margin"); Button clearButton = new Button("Start over"); clearButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { History.newItem(SeadState.UPLOAD.toToken("new")); } }); previewButtonPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT); previewButtonPanel.add(clearButton); previewButtonPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT); previewButtonPanel.add(previewButton); previewButton.setEnabled(false); publishContainer.add(previewButtonPanel); }