Search in sources :

Example 1 with StringTokenizer

use of org.pentaho.gwt.widgets.client.utils.string.StringTokenizer in project pentaho-platform by pentaho.

the class CopyFilesCommand method performOperation.

/*
         * (non-Javadoc)
         *
         * @see org.pentaho.mantle.client.commands.AbstractCommand#performOperation()
         */
@Override
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);
    }
}
Also used : SolutionBrowserFile(org.pentaho.mantle.client.solutionbrowser.SolutionBrowserFile) StringTokenizer(org.pentaho.gwt.widgets.client.utils.string.StringTokenizer)

Example 2 with StringTokenizer

use of org.pentaho.gwt.widgets.client.utils.string.StringTokenizer in project pentaho-platform by pentaho.

the class CutFilesCommand method performOperation.

/*
     * (non-Javadoc)
     *
     * @see org.pentaho.mantle.client.commands.AbstractCommand#performOperation()
     */
@Override
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);
    }
}
Also used : SolutionBrowserFile(org.pentaho.mantle.client.solutionbrowser.SolutionBrowserFile) StringTokenizer(org.pentaho.gwt.widgets.client.utils.string.StringTokenizer)

Example 3 with StringTokenizer

use of org.pentaho.gwt.widgets.client.utils.string.StringTokenizer in project pentaho-platform by pentaho.

the class JsCreateNewConfig method getPriority.

public final int getPriority() {
    String value = getValue();
    StringTokenizer st = new StringTokenizer(value, ',');
    return Integer.parseInt(st.tokenAt(0).trim());
}
Also used : StringTokenizer(org.pentaho.gwt.widgets.client.utils.string.StringTokenizer)

Example 4 with StringTokenizer

use of org.pentaho.gwt.widgets.client.utils.string.StringTokenizer in project pentaho-platform by pentaho.

the class JsCreateNewConfig method getTabName.

public final String getTabName() {
    String value = getValue();
    StringTokenizer st = new StringTokenizer(value, ',');
    return st.tokenAt(2).trim();
}
Also used : StringTokenizer(org.pentaho.gwt.widgets.client.utils.string.StringTokenizer)

Example 5 with StringTokenizer

use of org.pentaho.gwt.widgets.client.utils.string.StringTokenizer in project data-access by pentaho.

the class CsvUtilsTest method testGetLines.

@Test
public void testGetLines() throws Exception {
    prepareFile(new String[] { "col1", "col2" });
    String lines = utils.getLines(tempFile.getAbsolutePath(), LINES_FOR_READ, "UTF-8");
    StringTokenizer tokenizer = new StringTokenizer(lines, DELIMETR);
    assertNotNull(lines);
    assertEquals(LINES_FOR_READ, tokenizer.countTokens());
}
Also used : StringTokenizer(org.pentaho.gwt.widgets.client.utils.string.StringTokenizer) Test(org.junit.Test)

Aggregations

StringTokenizer (org.pentaho.gwt.widgets.client.utils.string.StringTokenizer)11 SolutionBrowserFile (org.pentaho.mantle.client.solutionbrowser.SolutionBrowserFile)3 Request (com.google.gwt.http.client.Request)1 RequestBuilder (com.google.gwt.http.client.RequestBuilder)1 RequestCallback (com.google.gwt.http.client.RequestCallback)1 RequestException (com.google.gwt.http.client.RequestException)1 Response (com.google.gwt.http.client.Response)1 TreeItem (com.google.gwt.user.client.ui.TreeItem)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 JsSetting (org.pentaho.mantle.client.usersettings.JsSetting)1 GwtMessageBox (org.pentaho.ui.xul.gwt.tags.GwtMessageBox)1