Package org.pentaho.gwt.widgets.client.utils.string

Examples of org.pentaho.gwt.widgets.client.utils.string.StringTokenizer


  }

  protected void performOperation() {

    if this.getSolutionPath() != null && this.getFileNames() != null && this.getFileIds() != null ) {
      StringTokenizer pathTk = new StringTokenizer( this.getSolutionPath(), "\n" );
      StringTokenizer nameTk = new StringTokenizer( this.getFileNames(), "\n" );
      StringTokenizer idTk = new StringTokenizer( this.getFileIds(), "\n" );
      //Build Arrays since we cannot pass complex objects from the js bus
      for ( int i = 0; i < pathTk.countTokens(); i++ ) {
        filesToDelete.add( new SolutionBrowserFile( idTk.tokenAt( i ), nameTk.tokenAt( i ), pathTk.tokenAt( i ) ) );
      }
      performOperation( true );
    } else {
      performOperation( true );
    }
View Full Code Here


      JsArray<JsJobParam> jparams = editJob.getJobParams();
      for ( int i = 0; i < jparams.length(); i++ ) {
        urlParams += i == 0 ? "?" : "&";
        if ( jparams.get( i ).getValue().startsWith( "[" ) && jparams.get( i ).getValue().indexOf( "," ) >= 0 ) {
          // it's an array!
          StringTokenizer st = new StringTokenizer( jparams.get( i ).getValue(), "[]," );
          int tokens = st.countTokens();
          int numParamsAdded = 0;
          for ( int j = 0; j < tokens; j++ ) {
            String token = st.tokenAt( j );
            if ( !StringUtils.isEmpty( token ) ) {
              if ( numParamsAdded > 0 ) {
                urlParams += "&";
              }
              numParamsAdded++;
View Full Code Here

  protected void performOperation() {
    event.setMessage( "Click" );
    EventBusUtil.EVENT_BUS.fireEvent( event );

    if ( this.getSolutionPath() != null && this.getFileNames() != null && this.getFileIds() != null ) {
      StringTokenizer pathTk = new StringTokenizer( this.getSolutionPath(), "\n" );
      StringTokenizer nameTk = new StringTokenizer( this.getFileNames(), "\n" );
      StringTokenizer idTk = new StringTokenizer( this.getFileIds(), "\n" );
      //Build Arrays since we cannot pass complex objects from the js bus
      for ( int i = 0; i < pathTk.countTokens(); i++ ) {
        filesToCopy.add( new SolutionBrowserFile( idTk.tokenAt( i ), nameTk.tokenAt( i ), pathTk.tokenAt( i ) ) );
      }
      performOperation( false );
    } else {
      performOperation( true );
    }
View Full Code Here

          if ( jsSettings == null ) {
            return;
          }
          for ( int i = 0; i < jsSettings.length(); i++ ) {
            String content = jsSettings.get( i ).getValue();
            StringTokenizer nameValuePairs = new StringTokenizer( content, ";" ); //$NON-NLS-1$
            String perspective = null, content_panel_id = null, content_url = null;
            for ( int j = 0; j < nameValuePairs.countTokens(); j++ ) {
              String currentToken = nameValuePairs.tokenAt( j ).trim();
              if ( currentToken.startsWith( "perspective=" ) ) { //$NON-NLS-1$
                perspective = currentToken.substring( "perspective=".length() ); //$NON-NLS-1$
              }
              if ( currentToken.startsWith( "content-panel-id=" ) ) { //$NON-NLS-1$
                content_panel_id = currentToken.substring( "content-panel-id=".length() ); //$NON-NLS-1$
View Full Code Here

  protected void performOperation() {
    event.setMessage( "Click" );
    EventBusUtil.EVENT_BUS.fireEvent( event );

    if ( this.getSolutionPath() != null && this.getFileNames() != null && this.getFileIds() != null ) {
      StringTokenizer pathTk = new StringTokenizer( this.getSolutionPath(), "\n" );
      StringTokenizer nameTk = new StringTokenizer( this.getFileNames(), "\n" );
      StringTokenizer idTk = new StringTokenizer( this.getFileIds(), "\n" );
      //Build Arrays since we cannot pass complex objects from the js bus
      for ( int i = 0; i < pathTk.countTokens(); i++ ) {
        filesToCut.add( new SolutionBrowserFile( idTk.tokenAt( i ), nameTk.tokenAt( i ), pathTk.tokenAt( i ) ) );
      }
      performOperation( false );
    } else {
      performOperation( true );
    }
View Full Code Here

  public final int[] convertJsArrayStringToIntArray( JsArrayString jsArrayString ) {
    if ( jsArrayString == null ) {
      return null;
    } else {
      int[] intArray = new int[jsArrayString.length()];
      StringTokenizer tokenizer = new StringTokenizer( jsArrayString.toString(), "," );
      for ( int i = 0; i < tokenizer.countTokens(); i++ ) {
        try {
          String value = tokenizer.tokenAt( i );
          intArray[i] = Integer.parseInt( value );
        } catch ( Throwable t ) {
          Window.alert( t.getMessage() );
        }
      }
View Full Code Here

    ArrayList<String> pathSegments = new ArrayList<String>();
    if ( path != null ) {
      if ( path.startsWith( "/" ) ) { //$NON-NLS-1$
        path = path.substring( 1 );
      }
      StringTokenizer st = new StringTokenizer( path, '/' );
      for ( int i = 0; i < st.countTokens(); i++ ) {
        String token = st.tokenAt( i );
        pathSegments.add( token );
      }
    }
    TreeItem item = getTreeItem( pathSegments );
    selectedItem = item;
View Full Code Here

    ArrayList<String> pathSegments = new ArrayList<String>();
    if ( path != null ) {
      if ( path.startsWith( "/" ) ) { //$NON-NLS-1$
        path = path.substring( 1 );
      }
      StringTokenizer st = new StringTokenizer( path, '/' );
      for ( int i = 0; i < st.countTokens(); i++ ) {
        pathSegments.add( st.tokenAt( i ) );
      }
    }
    return pathSegments;
  }
View Full Code Here

    String showNewWindowOverride = Window.Location.getParameter( "showNewWindowOption" ); //$NON-NLS-1$
    if ( showNewWindowOverride != null && !"".equals( showNewWindowOverride ) ) { //$NON-NLS-1$
      // if the override is set, we MUST obey it above all else
      reallyShowNewWindowOption = "true".equals( showNewWindowOverride ); //$NON-NLS-1$
    } else if ( getReturnLocation() != null && !"".equals( getReturnLocation() ) ) { //$NON-NLS-1$
      StringTokenizer st = new StringTokenizer( getReturnLocation(), "?&" ); //$NON-NLS-1$
      // first token will be ignored, it is 'up to the ?'
      for ( int i = 1; i < st.countTokens(); i++ ) {
        StringTokenizer paramTokenizer = new StringTokenizer( st.tokenAt( i ), "=" ); //$NON-NLS-1$
        if ( paramTokenizer.countTokens() == 2 ) {
          // we've got a name=value token
          if ( paramTokenizer.tokenAt( 0 ).equalsIgnoreCase( "showNewWindowOption" ) ) { //$NON-NLS-1$
            reallyShowNewWindowOption = "true".equals( paramTokenizer.tokenAt( 1 ) ); //$NON-NLS-1$
            break;
          }
        }
      }
    }
View Full Code Here

  public final native String getValue() /*-{ return this.value; }-*/; //

  public final int getPriority() {
    String value = getValue();
    StringTokenizer st = new StringTokenizer( value, ',' );
    return Integer.parseInt( st.tokenAt( 0 ).trim() );
  }
View Full Code Here

TOP

Related Classes of org.pentaho.gwt.widgets.client.utils.string.StringTokenizer

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.