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);
}
}
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);
}
}
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());
}
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();
}
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());
}
Aggregations