Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: d6bdf217146f8cc604b395923ab4b90dafce8bfd (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
/*******************************************************************************
 * Copyright (c) 2017 Red Hat, Inc. 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:
 *    Red Hat Inc. - initial API and implementation
 *******************************************************************************/
package org.eclipse.linuxtools.internal.rpm.ui.editor;

import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.presentation.PresentationReconciler;
import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
import org.eclipse.linuxtools.internal.rpm.ui.editor.scanners.SpecfileChangelogScanner;
import org.eclipse.linuxtools.internal.rpm.ui.editor.scanners.SpecfilePackagesScanner;
import org.eclipse.linuxtools.internal.rpm.ui.editor.scanners.SpecfilePartitionScanner;
import org.eclipse.linuxtools.internal.rpm.ui.editor.scanners.SpecfileScanner;

public class SpecfilePrecentationReconciler extends PresentationReconciler {

	public SpecfilePrecentationReconciler() {
		SpecfileScanner scanner = new SpecfileScanner();
		DefaultDamagerRepairer dr = new DefaultDamagerRepairer(scanner);
		setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
		setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);

		dr = new DefaultDamagerRepairer(new SpecfilePackagesScanner());
		setDamager(dr, SpecfilePartitionScanner.SPEC_PACKAGES);
		setRepairer(dr, SpecfilePartitionScanner.SPEC_PACKAGES);

		dr = new DefaultDamagerRepairer(scanner);
		setDamager(dr, SpecfilePartitionScanner.SPEC_PREP);
		setRepairer(dr, SpecfilePartitionScanner.SPEC_PREP);

		dr = new DefaultDamagerRepairer(scanner);
		setDamager(dr, SpecfilePartitionScanner.SPEC_SCRIPT);
		setRepairer(dr, SpecfilePartitionScanner.SPEC_SCRIPT);

		dr = new DefaultDamagerRepairer(scanner);
		setDamager(dr, SpecfilePartitionScanner.SPEC_FILES);
		setRepairer(dr, SpecfilePartitionScanner.SPEC_FILES);

		dr = new DefaultDamagerRepairer(scanner);
		setDamager(dr, SpecfilePartitionScanner.SPEC_GROUP);
		setRepairer(dr, SpecfilePartitionScanner.SPEC_GROUP);

		dr = new DefaultDamagerRepairer(new SpecfileChangelogScanner());
		setDamager(dr, SpecfilePartitionScanner.SPEC_CHANGELOG);
		setRepairer(dr, SpecfilePartitionScanner.SPEC_CHANGELOG);
	}

}

Back to the top