throws PreprocessException
throws BuildException
	private boolean processStyle(String styleNames, StringList lines, String className) 	throws PreprocessException	{		int styleDirectiveLine = lines.getCurrentIndex() + 1;		// get the style-name:		String[] styles = TextUtil.splitAndTrim(styleNames, ',');		String style = null;		for (int i = 0; i < styles.length; i++) {			String name = styles[i];			if (this.styleSheet.isDefined(name)) {				style = name;				break;			}		}		if (style == null) {			throw new PreprocessException(					className + " line " + styleDirectiveLine					+ ": unable to process #style directive: the style(s) [" + styleNames + "] is/are not defined."					);		}		// when the #style directive is followed by a new operator, then		// the defined style will be included as last argument in the new operator,		// otherwise the defined style will be set as the current style in the stylesheet:		String nextLine = null;		if (lines.next()) {			nextLine = lines.getCurrent();		}		if ( (nextLine != null) && (nextLine.indexOf("new ") != -1) && (!containsDirective( nextLine )) ) {			uncommentLine( nextLine, lines );			while ( nextLine.indexOf(';') == -1) {				if (!lines.next()) {					throw new PreprocessException(							className + " line " + styleDirectiveLine							+ ": unable to process #style directive: there is a new operator without closing semicolon in the following line(s)."							);				}				if ( containsDirective( nextLine) ) {					throw new PreprocessException(							className + " line " + styleDirectiveLine							+ ": unable to process #style directive: there is a new operator without closing semicolon in the following line(s)."					);				}				nextLine = lines.getCurrent();								uncommentLine( nextLine, lines );			}			// get uncommented line:			nextLine = lines.getCurrent();			int parenthesisPos = nextLine.indexOf(')');			if ( parenthesisPos == -1 ) {				throw new PreprocessException(						className + " line " + styleDirectiveLine						+ ": unable to process #style directive: there is a new operator without closing parenthesis in the following line(s). " 						+ "The closing parenthesis needs to be on the same line as the semicolon!" 				);			}			// append the style-parameter as the last argument:			StringBuffer buffer = new StringBuffer();			buffer.append( nextLine.substring(0, parenthesisPos ) )					.append( ", StyleSheet.getStyle( \"")					.append( style )					.append( "\") " )					.append( nextLine.substring( parenthesisPos ) );			lines.setCurrent( buffer.toString() );		} else { // either there is no next line or the next line has no new operator			lines.prev();			lines.insert( "\tStyleSheet.setCurrentStyle( \"" + style + "\" );"  );		}		// mark the style as beeing used:		//TODO allow usage of favourite styles #style myStyle, okStyle, baseStyle		this.styleSheet.addUsedStyle( style );		return true;	}