forked from microsoft/copilot-for-eclipse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGhostText.java
More file actions
45 lines (36 loc) · 1006 Bytes
/
Copy pathGhostText.java
File metadata and controls
45 lines (36 loc) · 1006 Bytes
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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package com.microsoft.copilot.eclipse.ui.completion;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.GC;
/**
* Represents a ghost text.
*/
public abstract class GhostText {
protected String text;
protected int modelOffset;
protected GhostTextType type;
/**
* Creates a new instance of the {@link GhostText} class.
*
* @param text The text of the ghost text.
* @param modelOffset The offset of the ghost text in the document.
* @param type The type of the ghost text.
*/
protected GhostText(String text, int modelOffset, GhostTextType type) {
super();
this.text = text;
this.modelOffset = modelOffset;
this.type = type;
}
/**
* Draws the ghost text.
*/
public abstract void draw(StyledText styledText, int widgetOffset, GC gc);
public String getText() {
return text;
}
public int getModelOffset() {
return modelOffset;
}
}