Package org.kie.uberfire.client.common

Examples of org.kie.uberfire.client.common.FileUpload


        form = new WellForm();
        form.setAction( getWebContext() + "/maven2" );
        form.setEncoding( FormPanel.ENCODING_MULTIPART );
        form.setMethod( FormPanel.METHOD_POST );

        final FileUpload up = new FileUpload( new Command() {
            @Override
            public void execute() {
                showUploadingBusy();
                form.submit();
            }
        } );
        up.setName( HTMLFileManagerFields.UPLOAD_FIELD_NAME_ATTACH );

        form.addSubmitHandler( new Form.SubmitHandler() {
            @Override
            public void onSubmit( final Form.SubmitEvent event ) {
                String fileName = up.getFilename();
                if ( fileName == null || "".equals( fileName ) ) {
                    BusyPopup.close();
                    Window.alert( M2RepoEditorConstants.INSTANCE.SelectFileUpload() );
                    event.cancel();
                }
            }
        } );

        form.addSubmitCompleteHandler( new Form.SubmitCompleteHandler() {
            public void onSubmitComplete( final Form.SubmitCompleteEvent event ) {
                if ( "OK".equalsIgnoreCase( event.getResults() ) ) {
                    BusyPopup.close();
                    Window.alert( M2RepoEditorConstants.INSTANCE.UploadedSuccessfully() );
                    hiddenFieldsPanel.setVisible( false );
                    hiddenArtifactIdField.setText( null );
                    hiddenGroupIdField.setText( null );
                    hiddenVersionIdField.setText( null );

                    searchEvent.fire( new M2RepoSearchEvent() );

                    up.getElement().setPropertyString( "value", "" );
                    hide();
                } else if ( "NO VALID POM".equalsIgnoreCase( event.getResults() ) ) {
                    BusyPopup.close();
                    Window.alert( M2RepoEditorConstants.INSTANCE.InvalidJarNotPom() );
                    hiddenFieldsPanel.setVisible( true );
View Full Code Here


        form = new WellForm();
        form.setAction( getWebContext() + "/maven2" );
        form.setEncoding( FormPanel.ENCODING_MULTIPART );
        form.setMethod( FormPanel.METHOD_POST );

        final FileUpload up = new FileUpload( new Command() {
            @Override
            public void execute() {
                showUploadingBusy();
                form.submit();
            }
        } );
        up.setName( HTMLFileManagerFields.UPLOAD_FIELD_NAME_ATTACH );

        form.addSubmitHandler( new Form.SubmitHandler() {
            @Override
            public void onSubmit( final Form.SubmitEvent event ) {
                String fileName = up.getFilename();
                if ( fileName == null || "".equals( fileName ) ) {
                    BusyPopup.close();
                    Window.alert( M2RepoEditorConstants.INSTANCE.SelectFileUpload() );
                    event.cancel();
                }
            }
        } );

        form.addSubmitCompleteHandler( new Form.SubmitCompleteHandler() {
            public void onSubmitComplete( final Form.SubmitCompleteEvent event ) {
                if ( "OK".equalsIgnoreCase( event.getResults() ) ) {
                    BusyPopup.close();
                    Window.alert( M2RepoEditorConstants.INSTANCE.UploadedSuccessfully() );
                    hiddenFieldsPanel.setVisible( false );
                    hiddenArtifactIdField.setText( null );
                    hiddenGroupIdField.setText( null );
                    hiddenVersionIdField.setText( null );

                    searchEvent.fire( new M2RepoSearchEvent() );

                    up.getElement().setPropertyString( "value", "" );
                    hide();
                } else if ( "NO VALID POM".equalsIgnoreCase( event.getResults() ) ) {
                    BusyPopup.close();
                    Window.alert( M2RepoEditorConstants.INSTANCE.InvalidJarNotPom() );
                    hiddenFieldsPanel.setVisible( true );
View Full Code Here

TOP

Related Classes of org.kie.uberfire.client.common.FileUpload

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.