use of com.google.gwt.user.client.ui.FormPanel in project data-access by pentaho.
the class GwtDatasourceEditorEntryPoint method showEditAnalysisDialog.
public void showEditAnalysisDialog(final DialogListener listener, final IDatasourceInfo datasourceInfo) {
final DialogListener<AnalysisImportDialogModel> importDialoglistener = new DialogListener<AnalysisImportDialogModel>() {
public void onDialogCancel() {
final AnalysisImportDialogController controller = importDialog.getAnalysisImportDialogController();
final FormPanel analysisDataFormPanel = controller.getFormPanel();
controller.removeHiddenPanels();
controller.buildAndSetParameters();
analysisDataFormPanel.removeFromParent();
RootPanel.get().add(analysisDataFormPanel);
}
public void onDialogAccept(final AnalysisImportDialogModel importDialogModel) {
final AnalysisImportDialogController controller = importDialog.getAnalysisImportDialogController();
final FormPanel analysisDataFormPanel = controller.getFormPanel();
controller.removeHiddenPanels();
controller.buildAndSetParameters(true);
analysisDataFormPanel.removeFromParent();
RootPanel.get().add(analysisDataFormPanel);
analysisDataFormPanel.addSubmitCompleteHandler(new SubmitCompleteHandler() {
@Override
public void onSubmitComplete(SubmitCompleteEvent event) {
String results = event.getResults();
String message = controller.convertToNLSMessage(results, controller.getFileName());
if (!SUCCESS_3.equals(results)) {
if (OVERWRITE_8.equals(results) || OVERWRITE__CATALOG_7.equals(results)) {
overwriteFileDialog(analysisDataFormPanel, message, controller);
} else {
listener.onDialogError(message);
}
} else {
analysisDataFormPanel.removeFromParent();
listener.onDialogAccept(null);
}
}
});
analysisDataFormPanel.submit();
}
public void onDialogReady() {
}
public void onDialogError(String errorMessage) {
listener.onDialogError(errorMessage);
}
};
final AsyncConstructorListener<GwtImportDialog> constructorListener = new AsyncConstructorListener<GwtImportDialog>() {
public void asyncConstructorDone(GwtImportDialog dialog) {
dialog.showAnalysisImportDialog(importDialoglistener, datasourceInfo);
}
};
if (importDialog == null) {
importDialog = new GwtImportDialog(constructorListener);
} else {
importDialog.showAnalysisImportDialog(importDialoglistener, datasourceInfo);
}
}
use of com.google.gwt.user.client.ui.FormPanel in project data-access by pentaho.
the class GwtDatasourceEditorEntryPoint method showMetadataImportDialog.
public void showMetadataImportDialog(final DialogListener listener) {
final DialogListener<MetadataImportDialogModel> importDialoglistener = new DialogListener<MetadataImportDialogModel>() {
public void onDialogCancel() {
final MetadataImportDialogController controller = importDialog.getMetadataImportDialogController();
final FormPanel analysisDataFormPanel = controller.getFormPanel();
controller.removeHiddenPanels();
controller.buildAndSetParameters();
analysisDataFormPanel.removeFromParent();
RootPanel.get().add(analysisDataFormPanel);
}
public void onDialogAccept(final MetadataImportDialogModel importDialogModel) {
final MetadataImportDialogController controller = importDialog.getMetadataImportDialogController();
final FormPanel metaDataFormPanel = controller.getFormPanel();
controller.removeHiddenPanels();
controller.buildAndSetParameters();
metaDataFormPanel.removeFromParent();
RootPanel.get().add(metaDataFormPanel);
controller.setImportCompleteCallback(new MetadataImportDialogController.ImportCompleteCallback() {
@Override
public void onImportSuccess() {
listener.onDialogAccept(null);
}
@Override
public void onImportCancel() {
listener.onDialogCancel();
}
});
metaDataFormPanel.submit();
}
public void onDialogReady() {
}
@Override
public void onDialogError(String errorMessage) {
listener.onDialogError(errorMessage);
}
};
final AsyncConstructorListener<GwtImportDialog> constructorListener = new AsyncConstructorListener<GwtImportDialog>() {
public void asyncConstructorDone(GwtImportDialog dialog) {
dialog.showMetadataImportDialog(importDialoglistener);
}
};
if (importDialog == null) {
importDialog = new GwtImportDialog(constructorListener);
} else {
importDialog.showMetadataImportDialog(importDialoglistener);
}
}
use of com.google.gwt.user.client.ui.FormPanel 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);
}
}
use of com.google.gwt.user.client.ui.FormPanel in project gwt-test-utils by gwt-test-utils.
the class FormPanelPatcher method submit.
@PatchMethod
static void submit(FormPanel formPanel) {
FormPanel.SubmitEvent event = new FormPanel.SubmitEvent();
formPanel.fireEvent(event);
if (!event.isCanceled()) {
FormPanelImpl impl = GwtReflectionUtils.getPrivateFieldValue(formPanel, "impl");
Element synthesizedFrame = GwtReflectionUtils.getPrivateFieldValue(formPanel, "synthesizedFrame");
FormPanel.SubmitCompleteEvent completeEvent = createCompleteSubmitEvent(getResultsHtml(impl, synthesizedFrame));
formPanel.fireEvent(completeEvent);
}
}
use of com.google.gwt.user.client.ui.FormPanel in project pentaho-platform by pentaho.
the class ExecuteUrlInNewTabCommand method performOperation.
protected void performOperation() {
MantleTabPanel contentTabPanel = SolutionBrowserPanel.getInstance().getContentTabPanel();
// $NON-NLS-1$
contentTabPanel.showNewURLTab(this.tabName, this.tabToolTip, "about:blank", false);
NamedFrame namedFrame = ((IFrameTabPanel) contentTabPanel.getSelectedTab().getContent()).getFrame();
final FormPanel form = new FormPanel(namedFrame);
RootPanel.get().add(form);
form.setMethod(FormPanel.METHOD_POST);
form.setAction(url);
// $NON-NLS-1$
form.add(new Hidden("reportXml", URL.encode(xml)));
form.submit();
((IFrameTabPanel) contentTabPanel.getSelectedTab().getContent()).setForm(form);
}
Aggregations