Java 类com.google.gwt.user.client.ui.FormPanel 实例源码

项目:scheduling-portal    文件:SubmitWindow.java   
private Layout initVariablesActualForm() {
    // actual form used to POST
    variablesActualForm = new FormPanel();
    variablesActualForm.setMethod(FormPanel.METHOD_POST);
    variablesActualForm.setAction(URL_SUBMIT_XML);
    hiddenPane = new VerticalPanel();
    _fields = new Hidden[variables.size()];

    int i = 0;
    for (Entry<String, JobVariable> var : variables.entrySet()) {
        _fields[i] = new Hidden("var_" + var.getKey());
        hiddenPane.add(_fields[i]);
        i++;
    }

    hiddenPane.add(new Hidden("job", job));
    hiddenPane.add(new Hidden(SESSION_ID_PARAMETER_NAME, LoginModel.getInstance().getSessionId()));
    hiddenPane.add(validate);
    variablesActualForm.setWidget(hiddenPane);
    Layout fpanelWra = new Layout();
    fpanelWra.addMember(variablesActualForm);
    return fpanelWra;
}
项目:che    文件:UploadFilePresenter.java   
@Inject
public UploadFilePresenter(
    UploadFileView view,
    AppContext appContext,
    EventBus eventBus,
    NotificationManager notificationManager,
    CoreLocalizationConstant locale,
    EditorAgent editorAgent) {
  this.appContext = appContext;
  this.eventBus = eventBus;
  this.view = view;
  this.locale = locale;
  this.notificationManager = notificationManager;
  this.editorAgent = editorAgent;
  this.view.setDelegate(this);

  this.view.setEnabledUploadButton(false);
  this.view.setEncoding(FormPanel.ENCODING_MULTIPART);
}
项目:appformer    文件:DefaultEditorFileUploadBase.java   
void initForm() {
    form.setEncoding(FormPanel.ENCODING_MULTIPART);
    form.setMethod(FormPanel.METHOD_POST);

    formEncoder.addUtf8Charset(form);

    // Validation is not performed in a SubmitHandler as it fails to be invoked with GWT-Bootstrap3. See:-
    // - https://issues.jboss.org/browse/GUVNOR-2302 and
    // - the underlying cause https://github.com/gwtbootstrap3/gwtbootstrap3/issues/375
    // Validation is now performed prior to the form being submitted.

    form.addSubmitCompleteHandler(event -> {
        if (isUploadSuccessful(event)) {
            Window.alert(CoreConstants.INSTANCE.UploadSuccess());
            executeCallback(successCallback);
        } else {
            Window.alert(CoreConstants.INSTANCE.UploadFail());
            executeCallback(errorCallback);
        }
    });
}
项目:qafe-platform    文件:BuiltinHandlerHelper.java   
private static String getValue(FormPanel formPanel) {
    String value = null;

       if (formPanel instanceof HasWidgets) {
           HasWidgets hasWidgets = formPanel;
           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);
                   value = DOM.getElementAttribute(fileUpload.getElement(), "fu-uuid");
                   handleSimpleValue(formPanel, value);
               }
           }
       }

       return value;
}
项目:qafe-platform    文件:BuiltinHandlerHelper.java   
private static void fillDataContainerMapForGroup(DataMap dataMap, String groupName, UIObject uiObject,
        final UIObject sender) throws RequiredFieldException {

    if (uiObject instanceof Widget) {

        Widget widget = (Widget) uiObject;
        if (widget instanceof HasWidgets && !(widget instanceof ValueSpinner)
                && !(widget instanceof FormPanel) && !(widget instanceof HasDataGridMethods)) {

            HasWidgets innerHasWidget = (HasWidgets) widget;
            processWidgets(innerHasWidget, dataMap, sender);
        } else {
            processNamedComponent(widget, dataMap, sender, groupName);
        }
    }

}
项目:qafe-platform    文件:BuiltinHandlerHelper.java   
private static void processWidgets(HasWidgets hasWidgets, DataMap dataMap, final UIObject sender) 
        throws RequiredFieldException {
    for (Widget widget : hasWidgets) {

        processNamedComponent(widget, dataMap, sender, null);
        if (widget instanceof HasWidgets && !(widget instanceof ValueSpinner)
                && !(widget instanceof FormPanel) && !(widget instanceof HasDataGridMethods)) {
            // not clear what is this code was meant for.
            /*
             * DataContainerGVO dtc = new DataContainerGVO(); dtc.setKind(DataContainerGVO.KIND_MAP);
             * DataMap innerMap = new DataMap(); dtc.setDataMap(innerMap);
             * 
             * if (RendererHelper.isNamedComponent(widget)) { String name =
             * RendererHelper.getNamedComponentName(widget); dtc.setParameterName(name); dataMap.put(name,
             * dtc); }
             */
            HasWidgets innerHasWidget = (HasWidgets) widget;
            processWidgets(innerHasWidget, dataMap, sender);
        }
    }
}
项目:iambookmaster    文件:RemotePanel.java   
public RemotePanel(String serverUrl,RemotePanelListener listener) {
    this.listener = listener;
    this.serverUrl = serverUrl;
    CALLBACK = GWT.getHostPageBaseURL()+appConstants.remoteProgressPage();
    if (CALLBACK.startsWith("file:///")) {
        CALLBACK = CALLBACK.replace("file://", "file://///");
    }
    CALLBACK_BASE64 = Base64Coder.encodeString(CALLBACK);
    setSize("100%", "100%");
    framName = "RemotePanel"+String.valueOf(++COUNTER);
    frame = new NamedFrame(framName);
    frame.setUrl(CALLBACK);
    frame.setSize("100%", "100%");
    add(frame);
    setCellHeight(frame, "100%");
    setCellWidth(frame, "100%");
    form = new FormPanel(frame);
    form.setVisible(false);
    add(form);
    setCellHeight(form, "1px");
    setCellWidth(form, "100%");
    formElements = new FlowPanel();
    form.add(formElements);
}
项目:kaa    文件:FileUploadForm.java   
/**
 * Instantiates a new FileUploadForm.
 */
public FileUploadForm() {
  this.setEncoding(FormPanel.ENCODING_MULTIPART);
  this.setMethod(FormPanel.METHOD_POST);
  fu.setName(Guid.get());
  fu.setHeight("30px");
  this.add(fu);
  addSubmitHandler(new FormPanel.SubmitHandler() {
    public void onSubmit(SubmitEvent event) {
      if ("".equalsIgnoreCase(fu.getFilename())) {
        event.cancel();
      }
    }
  });
  this.setAction(GWT.getModuleBaseURL() + KAA_FILE_UPLOAD_SERVLET_PATH);
}
项目:gwt-upload    文件:Uploader.java   
/**
 * Initialize widget components and layout elements. 
 * 
 * @param type
 *   file input to use
 * @param form
 *   An existing form panel to use
 */
public Uploader(FileInputType type, FormPanel form) {
  thisInstance = this;
  this.fileInputType = type;

  if (form == null) {
    form = new FormFlowPanel();
  }
  uploadForm = form;
  uploadForm.setEncoding(FormPanel.ENCODING_MULTIPART);
  uploadForm.setMethod(FormPanel.METHOD_POST);
  uploadForm.setAction(servletPath);
  uploadForm.addSubmitHandler(onSubmitFormHandler);
  uploadForm.addSubmitCompleteHandler(onSubmitCompleteHandler);

  uploaderPanel = getUploaderPanel();
  uploaderPanel.add(uploadForm);
  uploaderPanel.setStyleName(STYLE_MAIN);

  setFileInput(fileInputType.getInstance());

  setStatusWidget(statusWidget);

  super.initWidget(uploaderPanel);
}
项目:kie-wb-common    文件:DocumentFieldRendererViewImpl.java   
protected void initForm() {
    documentForm.clear();
    uploader = new FileUpload(() -> {
        if (uploader.getFilename() != null && !uploader.getFilename().isEmpty()) {
            documentForm.submit();
        }
    });
    uploader.setName("document");
    documentForm.setEncoding(FormPanel.ENCODING_MULTIPART);
    documentForm.setMethod(FormPanel.METHOD_POST);
    documentForm.setAction(UPLOAD_FILE_SERVLET_URL_PATTERN);
    formEncoder.addUtf8Charset(documentForm);
    documentForm.add(uploader);
    documentForm.addSubmitCompleteHandler(event -> {
        onSubmit(event.getResults());
    });
}
项目:x-cure-chat    文件:UserLoginDialogUI.java   
private UserLoginDialogUI(){
    super( false, true, true, null);

    //Set the dialog's caption.
    this.setText( titlesI18N.userLoginDialogTitle() );

    //Set a style name so we can style it with CSS.
    this.setStyleName( CommonResourcesContainer.USER_DIALOG_STYLE_NAME );

       //Get a handle to the form and set its action to our jsni method
       form = FormPanel.wrap(Document.get().getElementById(LOGINFORM_ID), false);

       //Get the cancel button for text localization
       cancel = (ButtonElement) Document.get().getElementById(CANCELBUTTON_ID);
       cancel.setInnerText( getLeftButtonText() );

       //Get the submit button for text localization
       submit = (ButtonElement) Document.get().getElementById(LOGINBUTTON_ID);
       submit.setInnerText( getRightButtonText() );

       //Get the user login input
       userLoginInput = (InputElement) Document.get().getElementById(USERNAME_ID);

       //Get the user password input
       userPasswordInput = (InputElement) Document.get().getElementById(PASSWORD_ID);

    //Fill dialog with data
    populateDialog();

    //Enable the action buttons and hot key
    setLeftEnabled( true );
    setRightEnabled( true );
}
项目:scheduling-portal    文件:SubmitWindow.java   
private void initSelectWorkflowFromFilePanel() {
    fromFilePanel = new VLayout();
    fromFilePanel.setHeight("30px");

    fileUpload = new FileUpload();
    fileUpload.setName("job");

    VerticalPanel formContent = new VerticalPanel();
    formContent.setHeight("30px");

    Hidden hiddenField = new Hidden();
    hiddenField.setName(SESSION_ID_PARAMETER_NAME);
    hiddenField.setValue(LoginModel.getInstance().getSessionId());
    formContent.add(hiddenField);
    formContent.add(fileUpload);

    final FormPanel importFromFileformPanel = new FormPanel();
    importFromFileformPanel.setEncoding(FormPanel.ENCODING_MULTIPART);
    importFromFileformPanel.setMethod(FormPanel.METHOD_POST);
    importFromFileformPanel.setAction(URL_UPLOAD_FILE);
    importFromFileformPanel.add(formContent);
    importFromFileformPanel.addSubmitCompleteHandler(fileUploadCompleteHandler());
    importFromFileformPanel.setHeight("30px");
    fromFilePanel.addMember(importFromFileformPanel);

    sendFromFileButton = new Button("Upload file");
    sendFromFileButton.addClickHandler(clickHandlerForUploadFromFileButton(importFromFileformPanel));

}
项目:che    文件:UploadSshKeyPresenter.java   
/** {@inheritDoc} */
@Override
public void onUploadClicked() {
  String host = view.getHost();
  if (host.isEmpty()) {
    view.setMessage(constant.hostValidationError());
    return;
  }
  view.setEncoding(FormPanel.ENCODING_MULTIPART);

  String action = restContext + "/ssh";
  StringBuilder queryParametersBuilder = new StringBuilder();

  String csrfToken = appContext.getProperties().get("X-CSRF-Token");
  if (!isNullOrEmpty(csrfToken)) {
    queryParametersBuilder.append("&X-CSRF-Token=").append(csrfToken);
  }

  String machineToken = appContext.getWorkspace().getRuntime().getMachineToken();
  if (!isNullOrEmpty(machineToken)) {
    queryParametersBuilder.append("&token=").append(machineToken);
  }

  String queryParameters = queryParametersBuilder.toString();
  if (!isNullOrEmpty(queryParameters)) {
    action += queryParameters.replaceFirst("&", "?");
  }

  view.setAction(action);
  view.submit();
}
项目:che    文件:UploadFolderFromZipViewImpl.java   
/** Bind handlers. */
private void bind() {
  submitForm.addSubmitCompleteHandler(
      new FormPanel.SubmitCompleteHandler() {
        @Override
        public void onSubmitComplete(FormPanel.SubmitCompleteEvent event) {
          delegate.onSubmitComplete(event.getResults());
        }
      });
}
项目:che    文件:UploadFolderFromZipPresenter.java   
@Inject
public UploadFolderFromZipPresenter(
    UploadFolderFromZipView view,
    AppContext appContext,
    NotificationManager notificationManager,
    CoreLocalizationConstant locale) {
  this.view = view;
  this.appContext = appContext;
  this.locale = locale;
  this.view.setDelegate(this);
  this.view.setEnabledUploadButton(false);
  this.notificationManager = notificationManager;

  view.setEncoding(FormPanel.ENCODING_MULTIPART);
}
项目:che    文件:UploadFileViewImpl.java   
/** Bind handlers. */
private void bind() {
  submitForm.addSubmitCompleteHandler(
      new FormPanel.SubmitCompleteHandler() {
        @Override
        public void onSubmitComplete(FormPanel.SubmitCompleteEvent event) {
          delegate.onSubmitComplete(event.getResults());
        }
      });
}
项目:che    文件:UploadFileViewImplTest.java   
@Test
public void submitShouldBeExecuted() {
  view.submitForm = mock(FormPanel.class);

  view.submit();

  verify(view.submitForm).submit();
}
项目:che    文件:UploadFileViewImplTest.java   
@Test
public void setActionShouldBeExecuted() {
  view.submitForm = mock(FormPanel.class);
  final String url = "url";
  when(agentURLModifier.modify(url)).thenReturn(url);
  view.setAction(url);

  verify(view.submitForm).setAction(eq(url));
  verify(view.submitForm).setMethod(eq(FormPanel.METHOD_POST));
}
项目:che    文件:UploadFileViewImplTest.java   
@Test
public void setEncodingShouldBeExecuted() {
  view.submitForm = mock(FormPanel.class);

  view.setEncoding(FormPanel.ENCODING_MULTIPART);

  verify(view.submitForm).setEncoding(eq(FormPanel.ENCODING_MULTIPART));
}
项目:che    文件:UploadSshKeyPresenter.java   
@Override
public void onUploadClicked() {
  String host = view.getHost();
  if (host.isEmpty()) {
    view.setMessage(constant.hostValidationError());
    return;
  }
  view.setEncoding(FormPanel.ENCODING_MULTIPART);

  String action = restContext + "/ssh";
  StringBuilder queryParametersBuilder = new StringBuilder();

  String csrfToken = appContext.getProperties().get("X-CSRF-Token");
  if (!isNullOrEmpty(csrfToken)) {
    queryParametersBuilder.append("&X-CSRF-Token=").append(csrfToken);
  }

  String machineToken = appContext.getWorkspace().getRuntime().getMachineToken();
  if (!isNullOrEmpty(machineToken)) {
    queryParametersBuilder.append("&token=").append(machineToken);
  }

  String queryParameters = queryParametersBuilder.toString();
  if (!isNullOrEmpty(queryParameters)) {
    action += queryParameters.replaceFirst("&", "?");
  }

  view.setAction(action);
  view.submit();
}
项目:qafe-platform    文件:EventFactory.java   
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;
}
项目:qafe-platform    文件:BuiltinHandlerHelper.java   
public static Object getValue(UIObject uiObject, final UIObject sender, boolean idValueOnly
        , String groupName) {
    Object returnObject = null;
    if (uiObject instanceof QPagingScrollTable) {
        returnObject = getValue((QPagingScrollTable) uiObject, groupName);
    } else if (uiObject instanceof QRadioButton) {
        returnObject = getValue((QRadioButton) uiObject);
    } else if (uiObject instanceof HasData) {
        returnObject = getValue((HasData) uiObject);
    } else if (uiObject instanceof CheckBox) {
        returnObject = getValue((CheckBox) uiObject);
    } else if (uiObject instanceof FormPanel) {
        returnObject = getValue((FormPanel) uiObject);
    } else if (uiObject instanceof ListBox) {
        returnObject = getValue((ListBox) uiObject, idValueOnly);
    } else if (uiObject instanceof QDatePicker) {
        returnObject = getValue((QDatePicker) uiObject);
    } else if (uiObject instanceof HasText) {
        returnObject = getValue((HasText) uiObject);
    } else if (uiObject instanceof MapWidget) {
        returnObject = getValue((MapWidget) uiObject, sender);
    } else if (uiObject instanceof Image) {
        returnObject = getValue((Image) uiObject);
    } else if (uiObject instanceof ValueSpinner) {
        returnObject = getValue((ValueSpinner) uiObject);
    } else if (uiObject instanceof Tiles) {
        returnObject = getValue((Tiles) uiObject, sender);
    } else if (uiObject instanceof SliderBar) {
        returnObject = getValue((SliderBar) uiObject);
    } else if (isDataGridField(uiObject)) {
        returnObject = getDataGridValue(sender);
    }

    return returnObject;
}
项目:qafe-platform    文件:SearchBoxViewGwtImpl.java   
public SearchBoxViewGwtImpl() {

        FormPanel formPanel = new FormPanel("");
        formPanel.addSubmitHandler(new SubmitHandler() {

            @Override
            public void onSubmit(SubmitEvent event) {
                event.cancel();

            }
        });
        MSearchBox searchBox = new MSearchBox();
        formPanel.setWidget(searchBox);
        scrollPanel.setWidget(formPanel);
    }
项目:iambookmaster    文件:RemotePanel.java   
public void execute() {
    setFrameWindowName(frame.getElement(), framName);
    formElements.clear();
    form.setAction(currentRequest.getUrl());
    form.setMethod(currentRequest.isPost() ? FormPanel.METHOD_POST : FormPanel.METHOD_GET);
    form.setEncoding(FormPanel.ENCODING_URLENCODED);
    final HashMap<String,String> params = currentRequest.getParameters();
    if (params != null && params.size()>0) {
        addParameters(params,CALLBACK_BASE64);
    } else {
        addParameter(FIELD_CALLBACK,CALLBACK_BASE64);
    }
    if (currentRequest.isWaitForAnswer()) {
        //wait for answer
        timeoutChecher = new Timer() {
            @Override
            public void run() {
                String name;
                try {
                    name = getFrameWindowName(frame.getElement());
                    if (framName.equals(name)) {
                        //nothing
                    } else if (name.length()>0) {
                        //found
                        timeoutChecher.cancel();
                        parseAnswer(name);
                    }
                } catch (Throwable e) {
                }
            }
        };
        timeoutChecher.scheduleRepeating(300);
    } else {
        listener.success();
    }
    form.submit();
}
项目:ineform    文件:LoginBox.java   
/**
 * this method initializes the protected fields: labels and button
 */
protected void createUI() {
    ObjectDesc desc = new ObjectDesc(
        loginObjectDesc,
        new StringFDesc(email, IneFrameI18n.USERNAME()),
        new StringFDesc(pass, IneFrameI18n.PASSWORD()),
        new StringFDesc(captcha, IneFrameI18n.CAPTCHA()));
    descriptorStore.registerObjectDesc(Marker.registered, desc);
    FormRDesc fDesc = new FormRDesc(loginObjectDesc);
    fDesc.getRootNode().addChild(
        email,
        new WidgetRDesc(FWTypes.TEXTBOXBYDOMID).prop(IneFormProperties.domId, "username"));
    fDesc.getRootNode().addChild(
        pass,
        new WidgetRDesc(FWTypes.PASSWORDTEXTBOXBYDOMID)
            .prop(IneFormProperties.domId, "password"));
    fDesc.getRootNode().addChild(
        captcha,
        new WidgetRDesc(FWTypes.CAPTCHA)
            .width(100)
            .prop(CaptchaFW.PROP_RENDERING, CaptchaFW.HORIZONTAL));
    descriptorStore.addDefaultTypedDesc(Marker.registered, loginObjectDesc, fDesc);

    ineForm = formFactory.createSimple(loginObjectDesc, null);
    ineForm.renderForm();
    formContent.add(ineForm.asWidget());
    ButtonElement submitEl = (ButtonElement) Document.get().getElementById("loginSubmit");
    Element formEl = DOM.getElementById("loginform");
    loginButton = new IneButton(Color.GREEN, IneFrameI18n.LOGIN(), submitEl);

    formContent.add(loginButton);

    formPanel = (formEl == null ? new FormPanel() : FormPanel.wrap(formEl));
    formEl.getStyle().setDisplay(Display.BLOCK);
    formPanel.add(formContent);
    mainPanel.add(formPanel);
}
项目:QMAClone    文件:PanelSettingIcon.java   
public PanelSettingIcon() {
  setHorizontalAlignment(ALIGN_CENTER);
  add(new HTML("オリジナルアイコンをアップロードできます</br>" + "ファイルサイズは64KBまで</br>" + "画像形式はブラウザで表示可能なもの</br>"
      + "画像サイズは自動的に正方形に圧縮されて表示されます</br>" + "公序良俗に反する画像の使用はお止めください"));

  image.setPixelSize(96, 96);
  add(image);

  VerticalPanel panelForm = new VerticalPanel();

  Hidden hiddenUserCode = new Hidden();
  hiddenUserCode.setName(Constant.FORM_NAME_USER_CODE);
  hiddenUserCode.setValue(UserData.get().getUserCode() + "");
  panelForm.add(hiddenUserCode);

  fileUpload.setName(Constant.FORM_NAME_ICON);
  panelForm.add(fileUpload);

  form.setAction("icon");
  form.setEncoding(FormPanel.ENCODING_MULTIPART);
  form.setMethod(FormPanel.METHOD_POST);
  form.addSubmitCompleteHandler(this);
  form.setWidget(panelForm);
  add(form);

  add(buttonSubmit);

  htmlMessage.addStyleDependentName("settingMessage");
  add(htmlMessage);

  checkForm();
}
项目:gwt-upload    文件:SingleUploader.java   
/**
 * This constructor allows to use an existing form panel.
 * 
 * @param type
 *        file input to use
 * @param status
 *        Customized status widget to use
 * @param submitButton
 *        Customized button which submits the form
 * @param form
 *        Customized form panel
 */
public SingleUploader(FileInputType type, IUploadStatus status, Widget submitButton, FormPanel form) {
  super(type, form);

  final Uploader thisInstance = this;

  if (status == null) {
    status = new BaseUploadStatus();
    super.add(status.getWidget());
  }
  super.setStatusWidget(status);

  this.button = submitButton;
  if (submitButton != null) {
    submitButton.addStyleName("submit");
    if (submitButton instanceof HasClickHandlers) {
      ((HasClickHandlers)submitButton).addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
          thisInstance.submit();
        }
      });
    }
    if (submitButton instanceof HasText) {
      ((HasText)submitButton).setText(I18N_CONSTANTS.uploaderSend());
    }
    // The user could have attached the button anywhere in the page.
    if (!submitButton.isAttached()) {
      super.add(submitButton);
    }
  }
}
项目:plugin-datasource    文件:UploadSslKeyDialogPresenter.java   
@Override
public void onUploadClicked() {
    String alias = view.getAlias();
    if (alias.isEmpty()) {
        view.setMessage(constant.aliasValidationError());
        return;
    }
    view.setEncoding(FormPanel.ENCODING_MULTIPART);
    view.setAction(sslKeyStoreService.getUploadClientKeyAction(alias));
    view.submit();
}
项目:plugin-datasource    文件:UploadSslTrustCertDialogViewImpl.java   
private void bind() {
    uploadForm.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() {
        @Override
        public void onSubmitComplete(FormPanel.SubmitCompleteEvent event) {
            delegate.onSubmitComplete(event.getResults());
        }
    });
}
项目:plugin-datasource    文件:UploadSslKeyDialogViewImpl.java   
private void bind() {
    uploadForm.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() {
        @Override
        public void onSubmitComplete(FormPanel.SubmitCompleteEvent event) {
            delegate.onSubmitComplete(event.getResults());
        }
    });
}
项目:plugin-datasource    文件:UploadSslTrustCertDialogPresenter.java   
@Override
public void onUploadClicked() {
    String alias = view.getAlias();
    if (alias.isEmpty()) {
        view.setMessage(constant.aliasValidationError());
        return;
    }
    view.setEncoding(FormPanel.ENCODING_MULTIPART);
    view.setAction(sslKeyStoreService.getUploadServerCertAction(alias));
    view.submit();
}
项目:che    文件:UploadSshKeyViewImpl.java   
/** {@inheritDoc} */
@Override
public void setAction(@NotNull String url) {
  uploadForm.setAction(url);
  uploadForm.setMethod(FormPanel.METHOD_POST);
}
项目:che    文件:UploadSshKeyViewImpl.java   
/** {@inheritDoc} */
@Override
public void submit() {
  uploadForm.setEncoding(FormPanel.ENCODING_MULTIPART);
  uploadForm.submit();
}
项目:che    文件:UploadFolderFromZipViewImpl.java   
/** {@inheritDoc} */
@Override
public void setAction(@NotNull String url) {
  submitForm.setAction(agentURLModifier.modify(url));
  submitForm.setMethod(FormPanel.METHOD_POST);
}
项目:che    文件:UploadFileViewImpl.java   
/** {@inheritDoc} */
@Override
public void setAction(@NotNull String url) {
  submitForm.setAction(agentURLModifier.modify(url));
  submitForm.setMethod(FormPanel.METHOD_POST);
}
项目:che    文件:UploadSshKeyViewImpl.java   
/** {@inheritDoc} */
@Override
public void setAction(@NotNull String url) {
  uploadForm.setAction(url);
  uploadForm.setMethod(FormPanel.METHOD_POST);
}
项目:che    文件:UploadSshKeyViewImpl.java   
/** {@inheritDoc} */
@Override
public void submit() {
  uploadForm.setEncoding(FormPanel.ENCODING_MULTIPART);
  uploadForm.submit();
}
项目:gerrit    文件:NewAgreementScreen.java   
@Override
protected void onInitUI() {
  super.onInitUI();
  setPageTitle(Util.C.newAgreement());

  final FlowPanel formBody = new FlowPanel();
  radios = new VerticalPanel();
  formBody.add(radios);

  agreementGroup = new FlowPanel();
  agreementGroup.add(new SmallHeading(Util.C.newAgreementReviewLegalHeading()));

  agreementHtml = new HTML();
  agreementHtml.setStyleName(Gerrit.RESOURCES.css().contributorAgreementLegal());
  agreementGroup.add(agreementHtml);
  formBody.add(agreementGroup);

  finalGroup = new VerticalPanel();
  finalGroup.add(new SmallHeading(Util.C.newAgreementCompleteHeading()));
  final FlowPanel fp = new FlowPanel();
  yesIAgreeBox = new NpTextBox();
  yesIAgreeBox.setVisibleLength(Util.C.newAgreementIAGREE().length() + 8);
  yesIAgreeBox.setMaxLength(Util.C.newAgreementIAGREE().length());
  fp.add(yesIAgreeBox);
  fp.add(new InlineLabel(Util.M.enterIAGREE(Util.C.newAgreementIAGREE())));
  finalGroup.add(fp);
  submit = new Button(Util.C.buttonSubmitNewAgreement());
  submit.addClickHandler(
      new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          doSign();
        }
      });
  finalGroup.add(submit);
  formBody.add(finalGroup);
  new OnEditEnabler(submit, yesIAgreeBox);

  final FormPanel form = new FormPanel();
  form.add(formBody);
  add(form);
}
项目:qafe-platform    文件:ClearHandler.java   
private void processClearForInputComponents(UIObject uiObject, BuiltInFunctionGVO builtInFunction) {
    if (uiObject instanceof TextBoxBase) {
        TextBoxBase textBoxBase = (TextBoxBase) uiObject;
        textBoxBase.setText("");
    }

    if (uiObject instanceof QDatePicker) {
        QDatePicker qDatePicker = (QDatePicker) uiObject;
        qDatePicker.getTextBox().setText("");
    }

    if (uiObject instanceof HasDataGridMethods) {
        ((HasDataGridMethods) uiObject).insertData(null, false,
                builtInFunction.getSenderId(),
                builtInFunction.getListenerType());
        ((HasDataGridMethods) uiObject).redraw();
    }
    if (uiObject instanceof ListBox) {
        ListBox listBox = (ListBox) uiObject;
        boolean hasEmptyItem = DropDownRenderer.hasEmptyItem(listBox);
        int indexOfValue = hasEmptyItem ? 0 : -1;
        listBox.setSelectedIndex(indexOfValue);
        if (builtInFunction instanceof ClearGVO) {
            int offset = hasEmptyItem ? 1 : 0;
            while (listBox.getItemCount() > offset) {
                listBox.removeItem(listBox.getItemCount() - 1);
            }
        }
    }

    if (uiObject instanceof CheckBox) {
        CheckBox checkbox = (CheckBox) uiObject;
        checkbox.setValue(false);
        if (uiObject instanceof QRadioButton) {
            ((QRadioButton) uiObject).reset();
        }
    }

    if (uiObject instanceof FileUpload) {
        FileUpload fileUpload = (FileUpload) uiObject;
        Widget fup = fileUpload.getParent();
        // fup will be the layout component
        if (fup != null) {
            Widget fupp = fup.getParent();

            if (fupp instanceof FormPanel) {
                ((FormPanel) fupp).reset();
            }
        }
    }

    if(uiObject instanceof QSuggestBox){
        QSuggestBox suggestTextField = (QSuggestBox)uiObject;
        suggestTextField.getTextBox().setText("");
    }
}