use of com.google.gwt.user.client.ui.FileUpload in project che by eclipse.
the class UploadFolderFromZipViewImpl method addFileUploadForm.
private void addFileUploadForm() {
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 AnalysisImportDialogController method createWorkingForm.
private void createWorkingForm() {
if (formPanel == null) {
formPanel = new FormPanel();
formPanel.setMethod(FormPanel.METHOD_POST);
formPanel.setEncoding(FormPanel.ENCODING_MULTIPART);
formPanel.setAction(MONDRIAN_POSTANALYSIS_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);
analysisFileUpload = new FileUpload();
analysisFileUpload.setName("uploadAnalysis");
analysisFileUpload.getElement().setId("analysisFileUpload");
analysisFileUpload.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
schemaNameLabel.setValue(((FileUpload) event.getSource()).getFilename());
importDialogModel.setUploadedFile(((FileUpload) event.getSource()).getFilename());
acceptButton.setDisabled(!isValid());
}
});
mainFormPanel.add(analysisFileUpload);
VerticalPanel vp = (VerticalPanel) hiddenArea.getManagedObject();
vp.add(formPanel);
// addSubmitHandler(); moved to GwtDataSourceEditorEntryPoint
}
}
use of com.google.gwt.user.client.ui.FileUpload in project data-access by pentaho.
the class MetadataImportDialogController method addLocalizedBundle.
@Bindable
public void addLocalizedBundle() {
final FileUpload localizedBundleUpload = new FileUpload();
localizedBundleUpload.setName("localeFiles");
localizedBundleUpload.getElement().setId("propertyFileUpload" + FILE_UPLOAD_SUFFIX++);
localizedBundleUpload.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
String fileName = ((FileUpload) event.getSource()).getFilename();
if (fileName == null || fileName.length() < 1) {
// Trying to detect a cancel
propertiesFileImportPanel.remove(localizedBundleUpload);
} else {
importDialogModel.addLocalizedBundle(fileName, fileName);
}
}
});
propertiesFileImportPanel.add(localizedBundleUpload);
jsClickUpload(localizedBundleUpload.getElement().getId());
}
use of com.google.gwt.user.client.ui.FileUpload in project data-access by pentaho.
the class UploadFileEntryPoint method onModuleLoad.
public void onModuleLoad() {
// Create a FormPanel and point it at a service.
final FormPanel uploadForm = new FormPanel();
uploadForm.setAction(GWT.getModuleBaseURL() + "/UploadService");
// Because we're going to add a FileUpload widget, we'll need to set the
// form to use the POST method, and multipart MIME encoding.
uploadForm.setEncoding(FormPanel.ENCODING_MULTIPART);
uploadForm.setMethod(FormPanel.METHOD_POST);
// Create a panel to hold all of the form widgets.
VerticalPanel panel = new VerticalPanel();
uploadForm.setWidget(panel);
// Create a TextBox, giving it a name so that it will be submitted.
final TextBox tb = new TextBox();
tb.setName("textBoxFormElement");
panel.add(tb);
// Create a FileUpload widget.
FileUpload upload = new FileUpload();
upload.setName("uploadFormElement");
panel.add(upload);
// Add a 'Upload' button.
Button uploadSubmitButton = new Button("Upload");
panel.add(uploadSubmitButton);
uploadSubmitButton.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
uploadForm.submit();
}
});
uploadForm.addFormHandler(new FormHandler() {
public void onSubmit(FormSubmitEvent event) {
}
public void onSubmitComplete(FormSubmitCompleteEvent event) {
Window.alert(event.getResults());
}
});
RootPanel.get().add(uploadForm);
}
use of com.google.gwt.user.client.ui.FileUpload in project ovirt-engine by oVirt.
the class IconEditorWidget method onUploadIconButton.
@UiHandler("uploadButton")
void onUploadIconButton(ClickEvent event) {
hiddenPanel.clear();
final FileUpload inputFileWidget = new FileUpload();
// $NON-NLS-1$ //$NON-NLS-2$
inputFileWidget.getElement().setAttribute("accept", "image/gif,image/jpeg,image/png");
inputFileWidget.addChangeHandler(e -> readUploadedIconFile(inputFileWidget.getElement()));
inputFileWidget.getElement().setTabIndex(-1);
hiddenPanel.add(inputFileWidget);
inputFileWidget.click();
}
Aggregations