// Path: java/collabode/ChangeSetOpIterator.java
// public static final Color CLEAR = new Color(null, new RGB(255, 255, 255));
// 
// Path: java/collabode/ChangeSetOpIterator.java
// public static final int AS_IS = -1;


import static collabode.ChangeSetOpIterator.CLEAR;
import static collabode.ChangeSetOpIterator.AS_IS;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.text.*;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import collabode.*;
package collabode.collab;





/**
 * Generates collaboration UI feedback.
 */
public class CollabFeedback implements CollabListener {
    
    private static final Color MINE = new Color(null, new RGB(255, 255, 155));
    private static final Color OTHER = new Color(null, new RGB(200, 200, 200));
    
    public CollabFeedback(Collab collab) {
    }
    
    public void updated(PadDocument updated) {
        List<ChangeSetOpIterator> styles = new ArrayList<ChangeSetOpIterator>();
        for (PadDocument doc : updated.collab) {
            try {
                styles.add(update(doc, new TextPresentation()));
            } catch (BadLocationException ble) {
                ble.printStackTrace(); // XXX
            }
        }
        updated.collab.syncStyles(styles);
    }
    
    public void committed(CollabDocument doc) {
        List<ChangeSetOpIterator> styles = new ArrayList<ChangeSetOpIterator>();
        for (PadDocument padDoc : doc) {
            TextPresentation base = new TextPresentation();
// Path: java/collabode/ChangeSetOpIterator.java
// public static final Color CLEAR = new Color(null, new RGB(255, 255, 255));
// 
// Path: java/collabode/ChangeSetOpIterator.java
// public static final int AS_IS = -1;


// Path: java/collabode/collab/CollabFeedback.java
import static collabode.ChangeSetOpIterator.CLEAR;
import static collabode.ChangeSetOpIterator.AS_IS;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.text.*;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import collabode.*;

package collabode.collab;





/**
 * Generates collaboration UI feedback.
 */
public class CollabFeedback implements CollabListener {
    
    private static final Color MINE = new Color(null, new RGB(255, 255, 155));
    private static final Color OTHER = new Color(null, new RGB(200, 200, 200));
    
    public CollabFeedback(Collab collab) {
    }
    
    public void updated(PadDocument updated) {
        List<ChangeSetOpIterator> styles = new ArrayList<ChangeSetOpIterator>();
        for (PadDocument doc : updated.collab) {
            try {
                styles.add(update(doc, new TextPresentation()));
            } catch (BadLocationException ble) {
                ble.printStackTrace(); // XXX
            }
        }
        updated.collab.syncStyles(styles);
    }
    
    public void committed(CollabDocument doc) {
        List<ChangeSetOpIterator> styles = new ArrayList<ChangeSetOpIterator>();
        for (PadDocument padDoc : doc) {
            TextPresentation base = new TextPresentation();
            base.mergeStyleRange(new StyleRange(0, doc.union.getLength(), null, CLEAR, AS_IS));