本文整理汇总了Java中com.google.gwt.user.client.ui.FileUpload.ensureDebugId方法的典型用法代码示例。如果您正苦于以下问题:Java FileUpload.ensureDebugId方法的具体用法?Java FileUpload.ensureDebugId怎么用?Java FileUpload.ensureDebugId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.FileUpload
的用法示例。
在下文中一共展示了FileUpload.ensureDebugId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showDialog
import com.google.gwt.user.client.ui.FileUpload; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public void showDialog() {
errorMessage.setText("");
fileContent = null;
fileUpload = new FileUpload();
fileUpload.setHeight("22px");
fileUpload.setWidth("100%");
fileUpload.setName("file");
fileUpload.ensureDebugId("import-from-config-ChooseFile");
addHandler(fileUpload.getElement());
fileUpload.addChangeHandler(event -> buttonImport.setEnabled(fileUpload.getFilename() != null));
uploadForm.add(fileUpload);
this.show();
}
示例2: addFileUploadForm
import com.google.gwt.user.client.ui.FileUpload; //导入方法依赖的package包/类
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);
}
示例3: addFile
import com.google.gwt.user.client.ui.FileUpload; //导入方法依赖的package包/类
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);
}
示例4: onInitialize
import com.google.gwt.user.client.ui.FileUpload; //导入方法依赖的package包/类
/**
* Initialize this example.
*/
@ShowcaseSource
@Override
public Widget onInitialize() {
// Create a vertical panel to align the content
VerticalPanel vPanel = new VerticalPanel();
// Add a label
vPanel.add(new HTML(constants.cwFileUploadSelectFile()));
// Add a file upload widget
final FileUpload fileUpload = new FileUpload();
fileUpload.ensureDebugId("cwFileUpload");
vPanel.add(fileUpload);
// Add a button to upload the file
Button uploadButton = new Button(constants.cwFileUploadButton());
uploadButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
String filename = fileUpload.getFilename();
if (filename.length() == 0) {
Window.alert(constants.cwFileUploadNoFileError());
} else {
Window.alert(constants.cwFileUploadSuccessful());
}
}
});
vPanel.add(new HTML("<br>"));
vPanel.add(uploadButton);
// Return the layout panel
return vPanel;
}