blob: 6dad415a6ef308c3c1ae960923298447a68bc231 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
/*******************************************************************************
* Copyright (c) 2002, 2010 QNX Software Systems 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:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.make.internal.ui.editor;
import java.util.ArrayList;
import org.eclipse.jface.text.reconciler.DirtyRegion;
import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
import org.eclipse.jface.text.reconciler.MonoReconciler;
/**
* NotifyingReconciler
*/
public class NotifyingReconciler extends MonoReconciler {
private ArrayList<IReconcilingParticipant> fReconcilingParticipants= new ArrayList<IReconcilingParticipant>();
/**
* Constructor for NotifyingReconciler.
*/
public NotifyingReconciler(IReconcilingStrategy strategy, boolean isIncremental) {
super(strategy, isIncremental);
}
/*
* @see org.eclipse.jface.text.reconciler.AbstractReconciler#process(org.eclipse.jface.text.reconciler.DirtyRegion)
*/
@Override
protected void process(DirtyRegion dirtyRegion) {
super.process(dirtyRegion);
notifyReconcilingParticipants();
}
public void addReconcilingParticipant(IReconcilingParticipant participant) {
fReconcilingParticipants.add(participant);
}
public void removeReconcilingParticipant(IReconcilingParticipant participant) {
fReconcilingParticipants.remove(participant);
}
protected void notifyReconcilingParticipants() {
for (IReconcilingParticipant participant : fReconcilingParticipants) {
participant.reconciled();
}
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.reconciler.AbstractReconciler#initialProcess()
*/
@Override
protected void initialProcess() {
super.initialProcess();
notifyReconcilingParticipants();
}
}
|