Package org.pentaho.gwt.widgets.client.dialogs

Examples of org.pentaho.gwt.widgets.client.dialogs.MessageDialogBox


          emailValidRequest.setHeader( "accept", "text/plain" );
          try {
            emailValidRequest.sendRequest( null, new RequestCallback() {

              public void onError( Request request, Throwable exception ) {
                MessageDialogBox dialogBox =
                    new MessageDialogBox( Messages.getString( "error" ), exception.toString(), false, false, true ); //$NON-NLS-1$
                dialogBox.center();
                event.setMessage( exception.getLocalizedMessage() );
                EventBusUtil.EVENT_BUS.fireEvent( event );
              }

              public void onResponseReceived( Request request, Response response ) {
                if ( response.getStatusCode() == Response.SC_OK ) {
                  final boolean isEmailConfValid = Boolean.parseBoolean( response.getText() );

                  NewScheduleDialog dialog = new NewScheduleDialog( fileNameWithPath, null, isEmailConfValid );
                  dialog.center();

                  event.setMessage( "Open" );
                  EventBusUtil.EVENT_BUS.fireEvent( event );
                }
              }
            } );
          } catch ( RequestException e ) {
            MessageDialogBox dialogBox =
                new MessageDialogBox( Messages.getString( "error" ), e.toString(), false, false, true ); //$NON-NLS-1$
            dialogBox.center();
            event.setMessage( e.getLocalizedMessage() );
            EventBusUtil.EVENT_BUS.fireEvent( event );
          }
        }
View Full Code Here


        }

        if ( SolutionBrowserPanel.getInstance().getExecutableFileExtensions().contains( extension ) ) {
          showScheduleDialog( repositoryFile.getPath() );
        } else {
          final MessageDialogBox dialogBox =
              new MessageDialogBox(
                  Messages.getString( "open" ), Messages.getString( "scheduleInvalidFileType", repositoryFile.getPath() ), false, false, true ); //$NON-NLS-1$ //$NON-NLS-2$

          dialogBox.setCallback( new IDialogCallback() {
            public void cancelPressed() {
            }

            public void okPressed() {
              dialogBox.hide();
            }
          } );

          dialogBox.center();
          return;
        }

      }

      protected void performOperation() {

        // hit the server and check: isScheduleAllowed
        final String url = GWT.getHostPageBaseURL() + "api/scheduler/isScheduleAllowed?id=" + repositoryFile.getId(); //$NON-NLS-1$
        RequestBuilder requestBuilder = new RequestBuilder( RequestBuilder.GET, url );
        requestBuilder.setHeader( "accept", "text/plain" );
        requestBuilder.setHeader( "If-Modified-Since", "01 Jan 1970 00:00:00 GMT" );
        final MessageDialogBox errorDialog =
            new MessageDialogBox(
                Messages.getString( "error" ), Messages.getString( "noSchedulePermission" ), false, false, true ); //$NON-NLS-1$ //$NON-NLS-2$
        try {
          requestBuilder.sendRequest( null, new RequestCallback() {

            public void onError( Request request, Throwable caught ) {
              errorDialog.center();
            }

            public void onResponseReceived( Request request, Response response ) {
              if ( "true".equalsIgnoreCase( response.getText() ) ) {
                schedule();
              } else {
                errorDialog.center();
              }
            }
          } );
        } catch ( RequestException re ) {
          errorDialog.center();
        }

      }

      protected void performOperation( boolean feedback ) {
View Full Code Here

    try {
      builder.setHeader( "If-Modified-Since", "01 Jan 1970 00:00:00 GMT" );
      builder.sendRequest( null, new RequestCallback() {

        public void onError( Request request, Throwable exception ) {
          MessageDialogBox dialogBox =
              new MessageDialogBox(
                  Messages.getString( "error" ), Messages.getString( "couldNotBackgroundExecute" ), false, false, true ); //$NON-NLS-1$ //$NON-NLS-2$
          dialogBox.center();
        }

        public void onResponseReceived( Request request, Response response ) {
          /*
           * We are checking for this specific string because if the job was scheduled successfully by
           * QuartzBackgroundExecutionHelper then the response is an html that contains the specific string. We
           * have coded this way because we did not want to touch the old way.
           */
          if ( "true".equals( response.getHeader( "background_execution" ) ) ) {
            MessageDialogBox dialogBox =
                new MessageDialogBox(
                    Messages.getString( "info" ), Messages.getString( "backgroundJobScheduled" ), false, false, true ); //$NON-NLS-1$ //$NON-NLS-2$
            dialogBox.center();
          }
        }
      } );
    } catch ( RequestException e ) {
      MessageDialogBox dialogBox = new MessageDialogBox( Messages.getString( "error" ), //$NON-NLS-1$
          Messages.getString( "couldNotBackgroundExecute" ), false, false, true ); //$NON-NLS-1$
      dialogBox.center();
    }
  }
View Full Code Here

    try {
      deleteFilesRequestBuilder.sendRequest( filesList, new RequestCallback() {

        @Override
        public void onError( Request request, Throwable exception ) {
          MessageDialogBox dialogBox =
              new MessageDialogBox( Messages.getString( "error" ), Messages.getString( "couldNotDeleteFile" ), //$NON-NLS-1$ //$NON-NLS-2$
                  false, false, true );
          dialogBox.center();

          event.setMessage( Messages.getString( "couldNotDeleteFile" ) );
          EventBusUtil.EVENT_BUS.fireEvent( event );
        }

        @Override
        public void onResponseReceived( Request request, Response response ) {
          if ( response.getStatusCode() == 200 ) {
            event.setMessage( "Success" );
            EventBusUtil.EVENT_BUS.fireEvent( event );
            new RefreshRepositoryCommand().execute( false );
            FileChooserDialog.setIsDirty( Boolean.TRUE );
            setBrowseRepoDirty( Boolean.TRUE );
            for ( SolutionBrowserFile file : filesToDelete ) {
              if ( file.getPath() != null ) {
                SolutionBrowserPanel.getInstance().removeRecent( file.getPath() );
                SolutionBrowserPanel.getInstance().removeFavorite( file.getPath() );
              }
            }
          } else {
            event.setMessage( Messages.getString( "couldNotDeleteFile" ) );
            EventBusUtil.EVENT_BUS.fireEvent( event );
          }
        }

      } );
    } catch ( RequestException e ) {
      MessageDialogBox dialogBox =
          new MessageDialogBox( Messages.getString( "error" ), Messages.getString( "couldNotDeleteFile" ), //$NON-NLS-1$ //$NON-NLS-2$
              false, false, true );
      dialogBox.center();
      event.setMessage( Messages.getString( "couldNotDeleteFile" ) );
      EventBusUtil.EVENT_BUS.fireEvent( event );
    }

  }
View Full Code Here

   *
   * @param title
   * @param message
   */
  private void showMessage( String title, String message ) {
    MessageDialogBox dialog = new MessageDialogBox( title, message, true, false, true );
    dialog.center();
  }
View Full Code Here

      requestBuilder.setHeader( "If-Modified-Since", "01 Jan 1970 00:00:00 GMT" );
      requestBuilder.sendRequest( null, new RequestCallback() {

        @Override
        public void onError( Request arg0, Throwable arg1 ) {
          MessageDialogBox dialogBox =
              new MessageDialogBox( Messages.getString( "error" ), arg1.getLocalizedMessage(), false, false, true ); //$NON-NLS-1$
          dialogBox.center();
        }

        @Override
        public void onResponseReceived( Request arg0, Response response ) {
          Boolean isAdministrator = Boolean.parseBoolean( response.getText() );
          SolutionBrowserPanel.getInstance().setAdministrator( isAdministrator );

          try {
            String restUrl2 = GWT.getHostPageBaseURL() + "api/scheduler/canSchedule"; //$NON-NLS-1$
            RequestBuilder requestBuilder2 = new RequestBuilder( RequestBuilder.GET, restUrl2 );
            requestBuilder2.setHeader( "If-Modified-Since", "01 Jan 1970 00:00:00 GMT" );
            requestBuilder2.sendRequest( null, new RequestCallback() {
              @Override
              public void onError( Request arg0, Throwable arg1 ) {
                MessageDialogBox dialogBox =
                    new MessageDialogBox( Messages.getString( "error" ), arg1.getLocalizedMessage(), false, false, true ); //$NON-NLS-1$
                dialogBox.center();
              }

              public void onResponseReceived( Request arg0, Response response ) {
                Boolean isScheduler = Boolean.parseBoolean( response.getText() );
                SolutionBrowserPanel.getInstance().setScheduler( isScheduler );

                String numStartupURLsSetting = settings.get( "num-startup-urls" );
                if ( numStartupURLsSetting != null ) {
                  int numStartupURLs = Integer.parseInt( numStartupURLsSetting ); //$NON-NLS-1$
                  for ( int i = 0; i < numStartupURLs; i++ ) {
                    String url = settings.get( "startup-url-" + ( i + 1 ) ); //$NON-NLS-1$
                    String name = settings.get( "startup-name-" + ( i + 1 ) ); //$NON-NLS-1$
                    if ( StringUtils.isEmpty( url ) == false ) { //$NON-NLS-1$
                      url = URL.decodeQueryString( url );
                      name = URL.decodeQueryString( name );
                      SolutionBrowserPanel.getInstance().getContentTabPanel().showNewURLTab( name != null ? name : url,
                          url, url, false );
                    }
                  }
                }
                if ( SolutionBrowserPanel.getInstance().getContentTabPanel().getWidgetCount() > 0 ) {
                  SolutionBrowserPanel.getInstance().getContentTabPanel().selectTab( 0 );
                }

                // startup-url on the URL for the app, wins over settings
                String startupURL = Window.Location.getParameter( "startup-url" ); //$NON-NLS-1$
                if ( startupURL != null && !"".equals( startupURL ) ) { //$NON-NLS-1$
                  // Spaces were double encoded so that they wouldn't be replaced with '+' when creating a deep
                  // link so when following a deep link we need to replace '%20' with a space even after decoding
                  String title = Window.Location.getParameter( "name" ).replaceAll( "%20", " " ); //$NON-NLS-1$
                  SolutionBrowserPanel.getInstance().getContentTabPanel().showNewURLTab( title, title, startupURL,
                      false );
                }
              }
            } );
          } catch ( RequestException e ) {
            MessageDialogBox dialogBox =
                new MessageDialogBox( Messages.getString( "error" ), e.getLocalizedMessage(), false, false, true ); //$NON-NLS-1$
            dialogBox.center();
          }
        }
      } );
    } catch ( RequestException e ) {
      MessageDialogBox dialogBox =
          new MessageDialogBox( Messages.getString( "error" ), e.getLocalizedMessage(), false, false, true ); //$NON-NLS-1$
      dialogBox.center();
    }

    if ( !StringUtils.isEmpty( startupPerspective ) ) {
      if ( PerspectiveManager.getInstance().isLoaded() ) {
        PerspectiveManager.getInstance().setPerspective( startupPerspective );
View Full Code Here

    triggerNowButton.setToolTip( Messages.getString( "executeNow" ) );
    triggerNowButton.setCommand( new Command() {
      public void execute() {
        Set<JsJob> selectedJobs = getSelectedJobs();
        if ( selectedJobs != null && selectedJobs.size() > 0 ) {
          MessageDialogBox messageDialog =
              new MessageDialogBox( Messages.getString( "executeNow" ), Messages.getString( "executeNowStarted" ),
                  false, true, true );
          messageDialog.setCallback( new IDialogCallback() {
            public void okPressed() {
              // wait a little to refresh to give schedule time to update the last run
              Timer t = new Timer() {
                public void run() {
                  refresh();
                }
              };
              t.schedule( 2000 );
            }

            public void cancelPressed() {
            }
          } );
          messageDialog.center();
          controlJobs( selectedJobs, "triggerNow", RequestBuilder.POST, false );
        }
      }
    } );
    triggerNowButton.setEnabled( false );
View Full Code Here

            emailValidRequest.setHeader( "accept", "text/plain" );
            try {
              emailValidRequest.sendRequest( null, new RequestCallback() {

                public void onError( Request request, Throwable exception ) {
                  MessageDialogBox dialogBox =
                      new MessageDialogBox( Messages.getString( "error" ), exception.toString(), false, false, true ); //$NON-NLS-1$
                  dialogBox.center();
                }

                public void onResponseReceived( Request request, Response response ) {
                  if ( response.getStatusCode() == Response.SC_OK ) {
                    final boolean isEmailConfValid = Boolean.parseBoolean( response.getText() );
                    final NewScheduleDialog schedDialog =
                        new NewScheduleDialog( jsJob, scheduleDialogCallback, isEmailConfValid );
                    schedDialog.center();
                  }
                }
              } );
            } catch ( RequestException e ) {
              // showError(e);
            }

          } else {
            MessageDialogBox dialogBox =
                new MessageDialogBox(
                    Messages.getString( "error" ), Messages.getString( "serverErrorColon" ) + " " + response.getStatusCode(), false, false, true ); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
            dialogBox.center();
          }
        }
      } );
    } catch ( RequestException e ) {
      // showError(e);
View Full Code Here

  }

  private void showValidateOutputLocationError() {
    String title = Messages.getString( "outputLocationErrorTitle" );
    String message = Messages.getString( "outputLocationErrorMessage" );
    MessageDialogBox dialogBox =
        new MessageDialogBox( title, message, false, false, true, Messages.getString( "close" ), null, null ); //$NON-NLS-1$
    dialogBox.addStyleName( "pentaho-dialog-small" );
    dialogBox.center();
  }
View Full Code Here

    try {
      builder.setHeader( "If-Modified-Since", "01 Jan 1970 00:00:00 GMT" );
      builder.sendRequest( toJson().toString(), new RequestCallback() {

        public void onError( Request request, Throwable exception ) {
          MessageDialogBox dialog =
              new MessageDialogBox(
                  Messages.getString( "error" ), Messages.getString( "couldNotSetUserSettings" ), true, false, true ); //$NON-NLS-1$ //$NON-NLS-2$
          dialog.center();
        }

        public void onResponseReceived( Request request, Response response ) {
          fireOnSavedEvent();
        }
View Full Code Here

TOP

Related Classes of org.pentaho.gwt.widgets.client.dialogs.MessageDialogBox

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.