public class SourcePreview extends Object
Modifier and Type | Field and Description |
---|---|
int |
lineToHighlight
Index of the line to highlight in LogMX, or
-1 if unknown (first line is 1) |
boolean |
ok
Flag indicating if the source code is available in this object (
false if the source code couldn't be retrieved) |
static int |
PREVIEW_LINES_RANGE
Number of lines that should be displayed before and after the line to highlight (
PREVIEW_LINES_RANGE lines before and PREVIEW_LINES_RANGE lines after) |
String |
text
Lines of source code, or error message if attribute
ok is false |
Constructor and Description |
---|
SourcePreview()
Empty default constructor
|
SourcePreview(boolean pOk,
String pText,
int pLineToHighlight)
Create a
SourcePreview with a value for each of its attributes |
Modifier and Type | Method and Description |
---|---|
static SourcePreview |
fromString(String pStr)
Creates a
SourcePreview from a string.The given string must match the pattern |
String |
toString() |
public boolean ok
false
if the source code couldn't be retrieved)public String text
ok
is false
public int lineToHighlight
-1
if unknown (first line is 1)public static final int PREVIEW_LINES_RANGE
PREVIEW_LINES_RANGE
lines before and PREVIEW_LINES_RANGE
lines after)public SourcePreview()
public SourcePreview(boolean pOk, String pText, int pLineToHighlight)
SourcePreview
with a value for each of its attributespOk
- true
if pText
contains the actual source code, or false
if the source code couldn't be retrieved (in this case, an error message may be specified using pText
)pText
- Source code excerpt (if pOk == true
) or error message if (pOk == false
)pLineToHighlight
- Index of the line to highlight in LogMX, or -1
if unknown (first line is 1)public static SourcePreview fromString(String pStr)
SourcePreview
from a string."return_code;num_line_to_highlight;source_code"
pStr
- String describing a SourcePreview
SourcePreview
created from the given stringCopyright © 2017 LightySoft. All rights reserved. [v1.0.0 (June 29th, 2015)]