package bluej.stride.framedjava.errors;
import java.io.File;
import bluej.collect.DiagnosticWithShown;
import bluej.compiler.CompilerAPICompiler;
import bluej.compiler.Diagnostic;
import bluej.compiler.Diagnostic.DiagnosticOrigin;
import bluej.stride.framedjava.ast.SlotFragment;
import bluej.stride.framedjava.ast.StringSlotFragment;
import bluej.stride.slots.EditableSlot;
import threadchecker.OnThread;
import threadchecker.Tag;
import javafx.application.Platform;
| A class for errors which are directly targeted at a given slot,
| like our own unknown-variable errors or extra semi-colon error
| (as distinct from JavaCompileError, which is targeted at Java code, which maps to a slot)
|
public abstract class DirectSlotError
extends CodeError{
@OnThread(Tag.Any)
private final DiagnosticOrigin origin;
| Creates a new DirectSlotError
| @param code The SlotFragment which this error refers to
| @param origin The origin of the error (typically, STRIDE_EARLY or STRIDE_LATE)
|
@OnThread(Tag.FXPlatform)
public DirectSlotError(SlotFragment code, DiagnosticOrigin origin)
{
super(code, CompilerAPICompiler.getNewErrorIdentifer());
this.origin = origin;
}
@OnThread(Tag.FXPlatform)
public synchronized DiagnosticWithShown toDiagnostic(String javaFileName, File strideFileName)
{
final Diagnostic diagnostic = new Diagnostic(Diagnostic.ERROR, getMessage(), javaFileName, -1, -1, -1, -1, origin, getIdentifier());
diagnostic.setXPath(path, -1, -1);
return new DiagnosticWithShown(diagnostic, false, strideFileName);
}
}
top,
use,
map,
abstract class DirectSlotError
. DirectSlotError
. toDiagnostic
39 neLoCode
+ 6 LoComm