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

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


        public void onError( Request request, Throwable exception ) {
          // showError(exception);
        }

        public void onResponseReceived( Request request, Response response ) {
          MessageDialogBox dialogBox =
              new MessageDialogBox( Messages.getString( "info" ), response.getText(), true, false, true ); //$NON-NLS-1$
          dialogBox.center();
        }
      } );
    } catch ( RequestException e ) {
      Window.alert( e.getMessage() );
      // showError(e);
View Full Code Here


      try {
        scheduleFileRequestBuilder.sendRequest( scheduleRequest.toString(), new RequestCallback() {

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

          @Override
          public void onResponseReceived( Request request, Response response ) {
            if ( response.getStatusCode() == 200 ) {
              setDone( true );
              ScheduleParamsDialog.this.hide();
              if ( callback != null ) {
                callback.okPressed();
              }

              JSONValue rib = jobSchedule.get( "runInBackground" );
              if ( rib != null && rib.isBoolean() != null && rib.isBoolean().booleanValue() ) {
                MessageDialogBox dialogBox =
                    new MessageDialogBox(
                        Messages.getString( "runInBackground" ), Messages.getString( "backgroundExecutionStarted" ), //$NON-NLS-1$ //$NON-NLS-2$
                        false, false, true );
                dialogBox.center();
              } else if ( !PerspectiveManager.getInstance().getActivePerspective().getId().equals(
                  PerspectiveManager.SCHEDULES_PERSPECTIVE ) ) {
                ScheduleCreateStatusDialog successDialog = new ScheduleCreateStatusDialog();
                successDialog.center();
              } else {
                MessageDialogBox dialogBox =
                    new MessageDialogBox(
                        Messages.getString( "scheduleUpdatedTitle" ), Messages.getString( "scheduleUpdatedMessage" ), //$NON-NLS-1$ //$NON-NLS-2$
                        false, false, true );
                dialogBox.center();
              }
            } else {
              MessageDialogBox dialogBox = new MessageDialogBox( Messages.getString( "error" ), response.getText(), //$NON-NLS-1$
                  false, false, true );
              dialogBox.center();
              setDone( false );
            }
          }

        } );
      } catch ( RequestException e ) {
        MessageDialogBox dialogBox = new MessageDialogBox( Messages.getString( "error" ), e.toString(), //$NON-NLS-1$
            false, false, true );
        dialogBox.center();
        setDone( false );
      }
      setDone( true );
    }
    return false;
View Full Code Here

   */
  private void doLogin( final boolean feedback ) {
    MantleLoginDialog.performLogin( new AsyncCallback<Boolean>() {

      public void onFailure( Throwable caught ) {
        MessageDialogBox dialogBox =
            new MessageDialogBox( Messages.getString( "error" ), Messages.getString( "invalidLogin" ), false, false,
                true ) {

            }; //$NON-NLS-1$ //$NON-NLS-2$

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

          public void okPressed() {
            doLogin( feedback );
          }
        } );

        dialogBox.center();
      }

      public void onSuccess( Boolean result ) {
        if ( commandCallback != null ) {
          execute( commandCallback, feedback );
View Full Code Here

      public void run() {

        MantleLoginDialog.performLogin( new AsyncCallback<Boolean>() {

          public void onFailure( Throwable caught ) {
            MessageDialogBox dialogBox =
                new MessageDialogBox(
                    Messages.getString( "error" ), Messages.getString( "invalidLogin" ), false, false, true ); //$NON-NLS-1$ //$NON-NLS-2$
            dialogBox.setCallback( new IDialogCallback() {
              public void cancelPressed() {
                // do nothing
              }

              public void okPressed() {
                doLogin();
              }

            } );
            dialogBox.center();
          }

          public void onSuccess( Boolean result ) {
            if ( commandCallback != null ) {
              execute( commandCallback );
View Full Code Here

        } else if ( IMantleUserSettingsConstants.MANTLE_SHOW_HIDDEN_FILES.equals( setting.getName() ) ) {
          boolean checked = "true".equals( setting.getValue() ); //$NON-NLS-1$
          ( (PentahoMenuItem) showHiddenFilesMenuItem.getManagedObject() ).setChecked( checked );
        }
      } catch ( Exception e ) {
        MessageDialogBox dialogBox =
            new MessageDialogBox(
                Messages.getString( "error" ), Messages.getString( "couldNotGetUserSettings" ), false, false, true ); //$NON-NLS-1$ //$NON-NLS-2$
        dialogBox.center();
      }
    }

  }
View Full Code Here

    try {
      scheduleFileRequestBuilder.sendRequest( scheduleRequest.toString(), new RequestCallback() {

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

        @Override
        public void onResponseReceived( Request request, Response response ) {
          if ( response.getStatusCode() == 200 ) {
            setDone( true );
            ScheduleEmailDialog.this.hide();
            if ( callback != null ) {
              callback.okPressed();
            }

            JSONValue rib = scheduleRequest.get( "runInBackground" );
            if ( rib != null && rib.isBoolean() != null && rib.isBoolean().booleanValue() ) {
              MessageDialogBox dialogBox =
                  new MessageDialogBox(
                      Messages.getString( "runInBackground" ), Messages.getString( "backgroundExecutionStarted" ), //$NON-NLS-1$ //$NON-NLS-2$
                      false, false, true );
              dialogBox.center();
            } else if ( !PerspectiveManager.getInstance().getActivePerspective().getId().equals(
                PerspectiveManager.SCHEDULES_PERSPECTIVE ) ) {
              ScheduleCreateStatusDialog successDialog = new ScheduleCreateStatusDialog();
              successDialog.center();
            } else {
              MessageDialogBox dialogBox =
                  new MessageDialogBox(
                      Messages.getString( "scheduleUpdatedTitle" ), Messages.getString( "scheduleUpdatedMessage" ), //$NON-NLS-1$ //$NON-NLS-2$
                      false, false, true );
              dialogBox.center();
            }
          } else {
            MessageDialogBox dialogBox = new MessageDialogBox( Messages.getString( "error" ), response.getText(), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-2$
                false, false, true );
            dialogBox.center();
            setDone( false );
          }
        }
      } );
    } catch ( RequestException e ) {
      MessageDialogBox dialogBox = new MessageDialogBox( Messages.getString( "error" ), e.toString(), //$NON-NLS-1$
          false, false, true );
      dialogBox.center();
      setDone( false );
    }
    setDone( true );
    return true;
  }
View Full Code Here

        public void onError( Request request, Throwable exception ) {
          // showError(exception);
        }

        public void onResponseReceived( Request request, Response response ) {
          MessageDialogBox dialogBox =
              new MessageDialogBox(
                  Messages.getString( "info" ), Messages.getString( "refreshSystemSettingsSuccess" ), false, false, true ); //$NON-NLS-1$ //$NON-NLS-2$
          dialogBox.center();
        }
      } );
    } catch ( RequestException e ) {
      Window.alert( e.getMessage() );
      // showError(e);
View Full Code Here

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

        @Override
        public void onError( Request request, Throwable exception ) {
          MessageDialogBox dialogBox =
              new MessageDialogBox(
                  Messages.getString( "cannotRestore" ), Messages.getString( "couldNotRestoreItem", type ), //$NON-NLS-1$ //$NON-NLS-2$
                  false, false, true );
          dialogBox.center();
          event.setMessage( "cannotRestore" );
          EventBusUtil.EVENT_BUS.fireEvent( event );
        }

        @Override
        public void onResponseReceived( Request request, Response response ) {
          if ( response.getStatusCode() == 200 ) {
            new RefreshRepositoryCommand().execute( false );
            event.setMessage( "Success" );
            EventBusUtil.EVENT_BUS.fireEvent( event );
          } else {
            MessageDialogBox dialogBox =
                new MessageDialogBox(
                    Messages.getString( "cannotRestore" ), Messages.getString( "couldNotRestoreItem", type ), //$NON-NLS-1$ //$NON-NLS-2$
                    false, false, true, Messages.getString( "close" ) );
            dialogBox.center();
            event.setMessage( "Success" );
            FileChooserDialog.setIsDirty( Boolean.TRUE );
            setBrowseRepoDirty( Boolean.TRUE );
            EventBusUtil.EVENT_BUS.fireEvent( event );
          }
        }
      } );
    } catch ( RequestException e ) {
      MessageDialogBox dialogBox =
          new MessageDialogBox( Messages.getString( "error" ), Messages.getString( "restoreError" ), //$NON-NLS-1$ //$NON-NLS-2$
              false, false, true );
      dialogBox.center();
      event.setMessage( Messages.getString( "restoreError" ) );
      EventBusUtil.EVENT_BUS.fireEvent( event );
    }
  }
View Full Code Here

        public void onError( Request request, Throwable exception ) {
          // showError(exception);
        }

        public void onResponseReceived( Request request, Response response ) {
          MessageDialogBox dialogBox =
              new MessageDialogBox(
                  Messages.getString( "info" ), Messages.getString( "reportingDataCacheFlushedSuccessfully" ), false, false, true ); //$NON-NLS-1$ //$NON-NLS-2$
          dialogBox.center();
        }
      } );
    } catch ( RequestException e ) {
      Window.alert( e.getMessage() );
      // showError(e);
View Full Code Here

    try {
      rb.sendRequest( null, new RequestCallback() {

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

        @Override
        public void onResponseReceived( Request request, Response response ) {
          if ( response.getStatusCode() == 200 ) {
            JsArray<JsCreateNewConfig> jsarray = parseJson( JsonUtils.escapeJsonForEval( response.getText() ) );
            final ArrayList<JsCreateNewConfig> sorted = new ArrayList<JsCreateNewConfig>();
            for ( int i = 0; i < jsarray.length(); i++ ) {
              sorted.add( jsarray.get( i ) );
            }
            Collections.sort( sorted, new JsCreateNewConfigComparator() );
            popup.setStyleName( "newToolbarDropdown" );
            VerticalPanel buttonPanel = new VerticalPanel();
            popup.add( buttonPanel );
            for ( int i = 0; i < sorted.size(); i++ ) {
              final int finali = i;
              Button button = new Button( Messages.getString( sorted.get( i ).getLabel() ) );
              button.setStyleName( "pentaho-button" );
              button.getElement().addClassName( "newToolbarDropdownButton" );
              button.addClickHandler( new ClickHandler() {
                public void onClick( ClickEvent event ) {
                    if (sorted.get( finali ).getActionUrl().startsWith("javascript:")) {
                      doEvalJS(sorted.get( finali ).getActionUrl().substring("javascript:".length()));
                    } else {
                      SolutionBrowserPanel.getInstance().getContentTabPanel().showNewURLTab(
                        Messages.getString( sorted.get( finali ).getTabName() ),
                        Messages.getString( sorted.get( finali ).getTabName() ), sorted.get( finali ).getActionUrl(),
                        false );
                    }
                  popup.hide();
                }
              } );
              String name = sorted.get( i ).getName();
              if ("data-access".equals(name)) {
                  buttonPanel.add(new HTML("<hr style='color: #a7a7a7' />"));
              }
              buttonPanel.add( button );
            }
            popup.setPopupPosition( anchorWidget.getAbsoluteLeft(), anchorWidget.getAbsoluteTop()
                + anchorWidget.getOffsetHeight() );
            popup.show();
          } else {
            MessageDialogBox dialogBox =
                new MessageDialogBox( Messages.getString( "error" ), Messages.getString( "error" ), //$NON-NLS-1$ //$NON-NLS-2$
                    false, false, true );
            dialogBox.center();
          }
        }

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

  }
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.