Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2005 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
package org.eclipse.ant.internal.ui.launchConfigurations;
Stream monitor implementation for an Ant build process.
public class AntStreamMonitor implements IFlushableStreamMonitor {
	private StringBuffer fContents = new StringBuffer();
	private ListenerList fListeners = new ListenerList(1);
	private boolean fBuffered = true;

	public void addListener(IStreamListener listener) {
		.add(listener);
	}

	public String getContents() {
		return .toString();
	}

	public void removeListener(IStreamListener listener) {
		.remove(listener);
	}

Appends the given message to this stream, and notifies listeners.

Parameters:
message
	public void append(String message) {
		if (isBuffered()) {
			.append(message);
		}
		Object[] listeners = .getListeners();
		for (int i = 0; i < listeners.lengthi++) {
			IStreamListener listener = (IStreamListener)listeners[i];
			listener.streamAppended(messagethis);
		}
	}
	public void flushContents() {
	}

	public boolean isBuffered() {
		return ;
	}

	public void setBuffered(boolean buffer) {
		 = buffer;
	}
New to GrepCode? Check out our FAQ X