本文整理汇总了Java中com.google.gwt.user.client.ui.FormPanel.SubmitCompleteHandler类的典型用法代码示例。如果您正苦于以下问题:Java SubmitCompleteHandler类的具体用法?Java SubmitCompleteHandler怎么用?Java SubmitCompleteHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SubmitCompleteHandler类属于com.google.gwt.user.client.ui.FormPanel包,在下文中一共展示了SubmitCompleteHandler类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSubmitCompleteHandler
import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteHandler; //导入依赖的package包/类
public static SubmitCompleteHandler createSubmitCompleteHandler(final UIObject ui, final EventListenerGVO ev, final List<InputVariableGVO> inputVariables) {
SubmitCompleteHandler submitCompleteHandler = new SubmitCompleteHandler() {
public void onSubmitComplete(SubmitCompleteEvent event) {
String uuId = event.getResults();
boolean success = false;
if ((uuId != null) && (uuId.indexOf("=") > 0)) {
uuId = uuId.substring(uuId.indexOf("=") + 1);
success = true;
}
FormPanel fp = (FormPanel) ui;
if (fp instanceof HasWidgets) {
HasWidgets hasWidgets = (HasWidgets) fp;
Iterator<Widget> itr = hasWidgets.iterator();
while (itr.hasNext()) {
Widget widget = itr.next();
if (widget instanceof Grid) {
Grid gridPanel = (Grid) widget;
FileUpload fileUpload = (FileUpload) gridPanel.getWidget(0, 0);
if (success) {
DOM.setElementAttribute(fileUpload.getElement(), "fu-uuid", uuId);
CallbackHandler.createCallBack(ui, QAMLConstants.EVENT_ONFINISH, ev, inputVariables);
} else {
Label fileNameLabel = new Label("Uploading unsuccessfull.");// (Hyperlink)
// gridPanel.getWidget(1,
// 0);
fileNameLabel.setText("Uploading unsuccessfull.");
fileNameLabel.setVisible(true);
gridPanel.add(fileNameLabel);
}
}
}
}
}
};
return submitCompleteHandler;
}
示例2: addSubmitCompleteHandler
import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteHandler; //导入依赖的package包/类
@Override
public void addSubmitCompleteHandler(SubmitCompleteHandler handler) {
formPanel.addSubmitCompleteHandler(handler);
}
示例3: fileUploadCompleteHandler
import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteHandler; //导入依赖的package包/类
private SubmitCompleteHandler fileUploadCompleteHandler() {
return new SubmitCompleteHandler() {
@Override
public void onSubmitComplete(SubmitCompleteEvent event) {
String fn = fileUpload.getFilename();
// chrome workaround
final String fileName = fn.replace("C:\\fakepath\\", "");
String res = event.getResults();
try {
JSONValue js = JSONParser.parseStrict(res);
JSONObject obj = js.isObject();
if (obj.get("jobEdit") != null && obj.get("jobEdit").isString() != null) {
String val = obj.get("jobEdit").isString().stringValue();
job = new String(org.ow2.proactive_grid_cloud_portal.common.shared.Base64Utils.fromBase64(val));
// if the job has an EXECUTION_CALENDAR Generic Information defined, the startAccordingToPlanningRadioButton becomes visible, and invisible otherwise
setStartAccordingPlanningRadioButtonState(job);
variables = readVars(job);
} else {
GWT.log("JSON parse ERROR");
displayErrorMessage(res);
//Force disable check&submit buttons to prevent confusion if a valid job was uploaded first but not submitted
setEnabledStartAtPart(false);
startAccordingPlanningRadioButton.setVisible(false);
return;
}
} catch (JSONException t) {
GWT.log("JSON parse ERROR");
displayErrorMessage(res);
//Force disable check&submit buttons to prevent confusion if a valid job was uploaded first but not submitted
setEnabledStartAtPart(false);
startAccordingPlanningRadioButton.setVisible(false);
return;
}
redrawVariables();
}
};
}
示例4: RecordPanel
import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteHandler; //导入依赖的package包/类
/**
* Instantiates a new RecordPanel.
*/
public RecordPanel(AvroWidgetsConfig config, boolean showCaption, String title,
HasErrorMessage hasErrorMessage, boolean optional, boolean readOnly) {
this.showCaption = showCaption;
this.optional = optional;
this.readOnly = readOnly;
this.hasErrorMessage = hasErrorMessage;
FlexTable table = new FlexTable();
table.setWidth("100%");
if (config == null) {
config = new AvroWidgetsConfig.Builder().createConfig();
}
recordFieldWidget = new RecordFieldWidget(config, readOnly);
if (showCaption) {
recordCaption = new CaptionPanel();
setTitle(title);
recordCaption.setContentWidget(recordFieldWidget);
table.setWidget(0, 0, recordCaption);
} else {
table.setWidget(0, 0, recordFieldWidget);
}
recordFileUpload = new FileUploadForm();
recordFileUpload.addSubmitCompleteHandler(new SubmitCompleteHandler() {
@Override
public void onSubmitComplete(SubmitCompleteEvent event) {
loadRecordFromFile();
}
});
recordFileUpload.addChangeHandler(this);
recordFileItemName = recordFileUpload.getFileItemName();
uploadButton = new Button(Utils.constants.upload(), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
recordFileUpload.submit();
}
});
uploadButton.addStyleName(Utils.kaaAdminStyle.bAppButtonSmall());
uploadButton.setEnabled(false);
uploadTable = new FlexTable();
Label uploadLabel = new Label(Utils.constants.uploadFromFile());
uploadTable.setWidget(0, 0, uploadLabel);
uploadTable.setWidget(0, 1, recordFileUpload);
uploadTable.setWidget(0, 2, uploadButton);
uploadTable.getFlexCellFormatter()
.setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);
uploadTable.getFlexCellFormatter()
.setVerticalAlignment(0, 2, HasVerticalAlignment.ALIGN_MIDDLE);
table.setWidget(1, 0, uploadTable);
setWidget(table);
setUploadVisible(!readOnly);
formDataLoader = new DefaultFormDataLoader();
}
示例5: addSubmitCompleteHandler
import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteHandler; //导入依赖的package包/类
/**
* addSubmitCompleteHandler
*
* @param submitCompleHandler
*/
public void addSubmitCompleteHandler(SubmitCompleteHandler submitCompleHandler) {
uploadForm.addSubmitCompleteHandler(submitCompleHandler);
}
示例6: addSubmitCompleteHandler
import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteHandler; //导入依赖的package包/类
void addSubmitCompleteHandler(SubmitCompleteHandler handler);