package bluej.editor;
import java.util.Collection;
import java.util.List;
import bluej.collect.DiagnosticWithShown;
import bluej.collect.StrideEditReason;
import bluej.compiler.CompileReason;
import bluej.compiler.CompileType;
import bluej.editor.stride.FrameCatalogue;
import bluej.stride.generic.Frame;
| Interface between the editor and the rest of BlueJ
| The editor uses this class
| @author Michael Kolling
|
public interface EditorWatcher
{
public final static String NAVIVIEW_EXPANDED_PROPERTY="naviviewExpandedProperty";
| Called by Editor when a file is changed
|
p.public void modificationEvent(Editor editor);
| Called by Editor when a file is saved
|
p.public void saveEvent(Editor editor);
| Called by Editor when it is closed
|
p.public void closeEvent(Editor editor);
| Called by Editor to set/clear a breakpoint
| @param lineNo the line number of the breakpoint
| @param set whether the breakpoint is set (true) or cleared
| @return An error message or null if okay.
|
p.public String breakpointToggleEvent(int lineNo, boolean set);
| Called by Editor when documentation is to be compiled
|
void generateDoc();
| Sets a property
|
p.public void setProperty(String key, String value);
| Gets a property
|
p.public String getProperty(String key);
| Schedule compilation due to reload or modification
| @param immediate True if compilation should be performed immediately; false if compilation should be
| postponed until the user VM is idle
| @param reason Reason for compilation, used for data recording purposes
| @param type The type of compilation, used to decide whether to keep or discard the generated .class files.
|
public void scheduleCompilation(boolean immediate, CompileReason reason, CompileType type);
| Records an edit to the Java code. Will only be called for Java classes, not for Stride classes.
| @param javaSource The current Java source
| @param includeOneLineEdits Whether to record if the edit (diff) only affects one line
|
p.public void recordJavaEdit(String javaSource, boolean includeOneLineEdits);
| Records an edit to the Stride code. Will only be called for Stride classes, not for Java classes.
| @param javaSource The current Java source
| @param strideSource The current Stride source
| @param reason The reason for the edit (may be null if unknown)
|
p.public void recordStrideEdit(String javaSource, String strideSource, StrideEditReason reason);
void clearAllBreakpoints();
| Record that the editor was opened
|
void recordOpen();
| Record that the editor was selected (i.e. its tab was made visible in the tabbed editor)
|
void recordSelected();
| Record that the editor was closed
|
void recordClose();
| Record that the given error indicator(s) (i.e. red error underlines) were shown in the editor,
| e.g. frame became non-fresh in Stride and so its underlines got shown.
| @param identifiers Integer ids of the errors
|
void recordShowErrorIndicators(Collection<Integer> identifiers);
| Record that the given error message was shown to the user.
| @param identifier Integer id of the error
| @param quickFixes The quick fixes shown with the error, if any (empty list if none)
|
p.public void recordShowErrorMessage(int identifier, List<String> quickFixes);
| Record a list of early errors that were found.
|
void recordEarlyErrors(List<DiagnosticWithShown> diagnostics, int compilationIdentifier);
| Record a list of late errors that were found.
|
void recordLateErrors(List<DiagnosticWithShown> diagnostics, int compilationIdentifier);
| Record that a given quick fix was selected
| @param errorIdentifier Integer id of the error
| @param fixIndex The index in the quick fix list, corresponding to the list passed earlier to recordShowErrorMessage for this error id
|
p.public void recordFix(int errorIdentifier, int fixIndex);
p.public void recordCodeCompletionStarted(Integer lineNumber, Integer columnNumber, String xpath, Integer elementOffset, String stem, int codeCompletionId);
p.public void recordCodeCompletionEnded(Integer lineNumber, Integer columnNumber, String xpath, Integer elementOffset, String stem, String replacement, int codeCompletionId);
p.public void recordUnknownCommandKey(String enclosingFrameXpath, int cursorIndex, char key);
| Records the reason and other parameters when showing or hiding the FrameCatalogue of this object.
|
| @param enclosingFrameXpath the path for the frame that include the focused cursor, if any.
| @param cursorIndex the focused cursor's index (if any) within the enclosing frame.
| @param show true for showing and false for hiding
| @param reason The user interaction which triggered the change.
|
p.public void recordShowHideFrameCatalogue(String enclosingFrameXpath, int cursorIndex, boolean show, FrameCatalogue.ShowReason reason);
| Records the view change of a Stride editor, between Stride, Java or Birdseye view.
|
| @param enclosingFrameXpath The path for the frame that include the focused cursor, if any. May be <code>null</code>.
| @param cursorIndex The focused cursor's index (if any) within the enclosing frame.
| @param oldView The old view mode that been switch from.
| @param newView The new view mode that been switch to.
| @param reason The user interaction which triggered the change.
|
p.public void recordViewModeChange(String enclosingFrameXpath, int cursorIndex, Frame.View oldView, Frame.View newView, Frame.ViewChangeReason reason);
| Notifies watcher whether we are showing the interface (docs) or not
|
p.public void showingInterface(boolean showingInterface);
| Shows the preferences pane, and makes the given pane index (i.e. given tab index
| in the preferences) the active showing tab. 0 is general, 1 is key bindings, and so on.
| If in doubt, pass 0.
|
p.public void showPreferences(int paneIndex);
}
top,
use,
map,
interface EditorWatcher
. modificationEvent
. saveEvent
. closeEvent
. breakpointToggleEvent
. generateDoc
. setProperty
. getProperty
. scheduleCompilation
. recordJavaEdit
. recordStrideEdit
. clearAllBreakpoints
. recordOpen
. recordSelected
. recordClose
. recordShowErrorIndicators
. recordShowErrorMessage
. recordEarlyErrors
. recordLateErrors
. recordFix
. recordCodeCompletionStarted
. recordCodeCompletionEnded
. recordUnknownCommandKey
. recordShowHideFrameCatalogue
. recordViewModeChange
. showingInterface
. showPreferences
92 neLoCode
+ 54 LoComm