use of com.google.gwt.user.client.ui.FileUpload in project che by eclipse.
the class UploadFileViewImpl method addFile.
private void addFile() {
file = new FileUpload();
file.setHeight("22px");
file.setWidth("100%");
file.setName("file");
file.ensureDebugId("file-uploadFile-ChooseFile");
file.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
delegate.onFileNameChanged();
}
});
uploadPanel.insert(file, 0);
}
use of com.google.gwt.user.client.ui.FileUpload in project data-access by pentaho.
the class MetadataImportDialogController method createWorkingForm.
private void createWorkingForm() {
if (formPanel == null) {
formPanel = new FormPanel();
formPanel.setMethod(FormPanel.METHOD_POST);
formPanel.setEncoding(FormPanel.ENCODING_MULTIPART);
formPanel.setAction(UPLOAD_URL);
formPanel.getElement().getStyle().setProperty("position", "absolute");
formPanel.getElement().getStyle().setProperty("visibility", "hidden");
formPanel.getElement().getStyle().setProperty("overflow", "hidden");
formPanel.getElement().getStyle().setProperty("clip", "rect(0px,0px,0px,0px)");
mainFormPanel = new FlowPanel();
formPanel.add(mainFormPanel);
propertiesFileImportPanel = new FlowPanel();
mainFormPanel.add(propertiesFileImportPanel);
formDomainIdText = new TextBox();
formDomainIdText.setName("domainId");
mainFormPanel.add(formDomainIdText);
metadataFileUpload = new FileUpload();
metadataFileUpload.setName("metadataFile");
metadataFileUpload.getElement().setId("metaFileUpload");
metadataFileUpload.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
String filename = ((FileUpload) event.getSource()).getFilename();
if (filename != null && filename.trim().length() > 0) {
metaFileLocation.setValue(filename);
importDialogModel.setUploadedFile(filename);
acceptButton.setDisabled(!isValid());
} else {
metaFileLocation.setValue(resBundle.getString("importDialog.SELECT_METAFILE_LABEL", "browse for metadata file"));
importDialogModel.setUploadedFile(null);
acceptButton.setDisabled(!isValid());
}
}
});
mainFormPanel.add(metadataFileUpload);
formPanel.addSubmitCompleteHandler(createSubmitCompleteHandler());
VerticalPanel vp = (VerticalPanel) hiddenArea.getManagedObject();
vp.add(formPanel);
}
}
Aggregations