1
/*******************************************************************************
2
* Copyright (c) 2008 ARM Limited and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* ARM Limited - Initial API and implementation
10
*******************************************************************************/
12
package org.eclipse.cdt.debug.internal.ui.disassembly.viewer;
14
import java.util.ArrayList;
15
import java.util.List;
17
import org.eclipse.cdt.debug.ui.disassembly.IDocumentElementAnnotationUpdate;
18
import org.eclipse.cdt.debug.ui.disassembly.IDocumentPresentation;
19
import org.eclipse.jface.text.source.Annotation;
22
* org.eclipse.cdt.debug.internal.ui.disassembly.viewer.DocumentAnnotationUpdate:
23
* //TODO Add description.
25
public class DocumentAnnotationUpdate extends DocumentUpdate implements IDocumentElementAnnotationUpdate {
26
private DocumentAnnotationProvider fAnnotationProvider;
27
private int fIndex = 0;
28
private List<Annotation> fAnnotations;
30
public DocumentAnnotationUpdate( DocumentAnnotationProvider annotationProvider, IDocumentPresentation presentationContext, Object root, Object base, Object element, int index ) {
31
super( presentationContext, root, base, element );
32
fAnnotationProvider = annotationProvider;
34
fAnnotations = new ArrayList<Annotation>();
38
* @see com.arm.eclipse.rvd.ui.disassembly.IDocumentElementAnnotationUpdate#addAnnotation(org.eclipse.jface.text.source.Annotation)
40
public void addAnnotation( Annotation annotation ) {
41
fAnnotations.add( annotation );
44
public int getIndex() {
48
public Annotation[] getAnnotations() {
49
return fAnnotations.toArray( new Annotation[fAnnotations.size()] );
52
protected DocumentAnnotationProvider getAnnotationProvider() {
53
return fAnnotationProvider;
57
* @see com.arm.eclipse.rvd.internal.ui.disassembly.DocumentUpdate#done()
62
getAnnotationProvider().completed( this );
66
* @see com.arm.eclipse.rvd.internal.ui.disassembly.DocumentUpdate#startRequest()