line = line.substring(0, startPos) + ".setPolishTicker" + line.substring( startPos + 10 ); this.isTickerUsed = true; lines.setCurrent( line );
Matcher matcher = SET_TICKER_PATTERN.matcher( line ); boolean matchFound = false; while (matcher.find()) { matchFound = true; String group = matcher.group(); String replacement = TextUtil.replace( group, "setTicker", "setPolishTicker"); line = TextUtil.replace( line, group, replacement ); } if (matchFound) { this.isTickerUsed = true; lines.setCurrent( line );  }
	public void processClass(StringList lines, String className) {		if (!this.isUsingPolishGui) {			return;		}		while (lines.next() ) {			// check for ticker:			String line = lines.getCurrent();						// check for style-property-usage:			int startPos = -1;			String methodName = "style.getProperty(";			startPos = line.indexOf(methodName);			if (startPos == -1) {				methodName = "style.getIntProperty(";				startPos = line.indexOf(methodName);				if (startPos == -1) {					methodName = "style.getBooleanProperty(";					startPos = line.indexOf(methodName);				}			}			if (startPos != -1) {				int endPos = line.indexOf( ')', startPos );				if (endPos == -1) {					throw new BuildException ("Invalid style-usage in class [" 							+ className + "] at line [" + lines.getCurrentIndex()							+ "]: style.getProperty( \"name\" ); always needs to be on a single line. "							+ " This line is invalid: " + line );				}								String property = line.substring( startPos + methodName.length(),						endPos ).trim();				if (property.charAt(0) != '"' || property.charAt( property.length() - 1) != '"') {					throw new BuildException ("Invalid style-usage in class [" 							+ className + "] at line [" + lines.getCurrentIndex()							+ "]: style.getProperty( \"name\" ); always needs to use the property-name directly (not a variable). "							+ " This line is invalid: " + line );				}				String key = property.substring( 1, property.length() - 1);				int id = this.idGenerator.getId(						key, this.preprocessor.hasSymbol("polish.css." + key) );				// check if this property is used at all:				if ( id == -1 ) {					//System.out.println("skipping attribute [" + key + "]");					continue;				}				line = TextUtil.replace( line, property, "" + id );				lines.setCurrent( line );				continue;			}						if (this.isInJ2MEPolishPackage) {				// skip the next checks, when the J2ME Polish package is preprocessed:				continue;			}						startPos = line.indexOf(".getTicker"); 			if ( startPos != -1) {				int commentPos = line.indexOf("//");				if (commentPos != -1 && commentPos < startPos) {					continue;				}				line = line.substring(0, startPos)					+ ".getPolishTicker"					+ line.substring( startPos + 10 );				this.isTickerUsed = true;				lines.setCurrent( line );				continue;			}			startPos = line.indexOf(".setTicker");			if ( startPos != -1) {				int commentPos = line.indexOf("//");				if (commentPos != -1 && commentPos < startPos) {					continue;				}				line = line.substring(0, startPos)					+ ".setPolishTicker"					+ line.substring( startPos + 10 );				this.isTickerUsed = true;				lines.setCurrent( line );				continue;			}						// check for Choice.POPUP:			startPos = line.indexOf(".POPUP");			if (startPos != -1) {				this.isPopupUsed = true;				continue;			}		}	}