KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > contentassist > TypeContentProposal


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation 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
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.pde.internal.ui.editor.contentassist;
13
14 import org.eclipse.jface.fieldassist.IContentProposal;
15 import org.eclipse.swt.graphics.Image;
16
17 /**
18  * TypeContentProposal
19  *
20  */

21 public class TypeContentProposal implements IContentProposal {
22
23     private String JavaDoc fLabel;
24     
25     private String JavaDoc fContent;
26     
27     private String JavaDoc fDescription;
28     
29     private Image fImage;
30     
31     /**
32      *
33      */

34     public TypeContentProposal(String JavaDoc label, String JavaDoc content,
35             String JavaDoc description, Image image) {
36         fLabel = label;
37         fContent = content;
38         fDescription = description;
39         fImage = image;
40     }
41
42     /* (non-Javadoc)
43      * @see org.eclipse.jface.fieldassist.IContentProposal#getContent()
44      */

45     public String JavaDoc getContent() {
46         return fContent;
47     }
48
49     /* (non-Javadoc)
50      * @see org.eclipse.jface.fieldassist.IContentProposal#getCursorPosition()
51      */

52     public int getCursorPosition() {
53         if (fContent != null) {
54             return fContent.length();
55         }
56         return 0;
57     }
58
59     /* (non-Javadoc)
60      * @see org.eclipse.jface.fieldassist.IContentProposal#getDescription()
61      */

62     public String JavaDoc getDescription() {
63         return fDescription;
64     }
65
66     /* (non-Javadoc)
67      * @see org.eclipse.jface.fieldassist.IContentProposal#getLabel()
68      */

69     public String JavaDoc getLabel() {
70         return fLabel;
71     }
72     
73     /**
74      * @return
75      */

76     public Image getImage() {
77         return fImage;
78     }
79
80     /* (non-Javadoc)
81      * @see java.lang.Object#toString()
82      */

83     public String JavaDoc toString() {
84         return fLabel;
85     }
86     
87 }
88
Popular Tags