Package editor
Class SmartFixManager
java.lang.Object
editor.SmartFixManager
- All Implemented Interfaces:
KeyListener
,MouseMotionListener
,EventListener
Handles state and functions relating to smart-fix functionality in the Gosu editor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
static class
private class
static enum
private static class
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static boolean
private JTextComponent
private GosuEditor
private IParsedElement
private int
private SmartFixPopup
private SmartFixManager.SmartFixMode
private int
private int
private int
private IParsedElement
private String
(package private) SelectClassToImportPopup
private IParsedElement
private IParseTree
private Timer
private String
private static final String
static final String
private static final Color
private static final Rectangle
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
bufferShowPopup
(boolean restartIfActive) private List<IParseIssue>
findParseIssuesOrderedByDistanceFromCaret
(int maxLines) private void
fixCase()
private void
private void
private void
private void
private void
private void
private void
private void
private void
generateSuperCall
(IConstructorInfo constructor) private double
getDistanceFromPosition
(IParseIssue pi, int line, int col) Returns the cartesian distance of this parse issue from the given column/line in column/line unitsprivate int
int
private Rectangle
getLocationFromOffset
(int i) getMode()
int
private int
getOverrideTarget
(int offset) static SmartFixManager.ReplaceChunk
getReplaceChunk
(IParsedElement sourceOfIssue, String gosuSource) private IType
private int
private Rectangle
private boolean
handlePossibleImportFix
(IParsedElement source, ITypeUsesMap typeUses, Set<String> processed) private void
private boolean
isCaseIssue
(IParseIssue parseIssue) static boolean
isCaseParseIssue
(IParseIssue parseIssue) private boolean
isImplictCoercion
(IParseIssue parseIssue) private boolean
isJavaStyleCast
(IParseIssue parseIssue) private boolean
isMissingConstructor
(IParseIssue parseIssue) private boolean
isMissingOverride
(IParseIssue parseIssue) private boolean
isMissingSuperCall
(IParseIssue parseIssue) private boolean
private boolean
isObsoleteConstructor
(IParseIssue parseIssue) private boolean
private boolean
isVoidReturnTypeIssue
(IParseIssue parseIssue) void
void
void
void
void
private boolean
void
void
void
setEditor
(JTextComponent editor) void
setGosuEditor
(GosuEditor gosuEditor) void
setLength
(int length) private void
void
setOffset
(int offset) void
setSourceOfIssue
(IParsedElement sourceOfIssue) private void
void
showSmartFix
(int offset, int length, String displayText) private void
showSmartFix
(IParsedElement source, String displayText) void
Updates the state of the SmartFixManager, which may display tool tips and offer to fix issues in the gosu program.
-
Field Details
-
TEST_RECTANGLE
-
DISPLAYKEY_START
- See Also:
-
SHORTCUT
- See Also:
-
_timer
-
_gosuEditor
-
_editor
-
_mode
-
_possibleTypesToImport
-
_peToFixWithAsStatement
-
_javaStyleCast
-
_obsoleteCtorStart
private int _obsoleteCtorStart -
_obsoleteCtorEnd
private int _obsoleteCtorEnd -
_possibleDisplayKey
-
_stringLiteralLocationToReplace
-
_sourceOfIssue
-
_typeToCoerceTo
-
_managerPopup
-
_offset
private int _offset -
_length
private int _length -
SMARTFIX_HIGHLIGHT_COLOR
-
_allowUnusedParameterFix
static boolean _allowUnusedParameterFix -
_selectionPopup
SelectClassToImportPopup _selectionPopup
-
-
Constructor Details
-
SmartFixManager
-
-
Method Details
-
performFix
public void performFix() -
getEditor
-
setEditor
-
getSourceOfIssue
-
setSourceOfIssue
-
getOffset
public int getOffset() -
setOffset
public void setOffset(int offset) -
getLength
public int getLength() -
setLength
public void setLength(int length) -
getGosuEditor
-
setGosuEditor
-
fixUnusedElement
private void fixUnusedElement() -
getStartOffsetOfUnused
private int getStartOffsetOfUnused() -
getEndOffsetOfUnused
private int getEndOffsetOfUnused() -
addMissingOverride
private void addMissingOverride() -
fixCase
private void fixCase() -
fixReturnType
private void fixReturnType() -
generateConstructors
private void generateConstructors() -
generateSuperCall
private void generateSuperCall() -
generateSuperCall
-
getOverrideTarget
private int getOverrideTarget(int offset) -
offerPassiveFix
private boolean offerPassiveFix() -
setMode
-
fixImplicitCast
private void fixImplicitCast() -
fixConstructorSyntax
private void fixConstructorSyntax() -
fixJavaStyleCast
private void fixJavaStyleCast() -
fixImport
private void fixImport() -
updateState
public void updateState()Updates the state of the SmartFixManager, which may display tool tips and offer to fix issues in the gosu program. -
isMissingConstructor
-
isMissingSuperCall
-
isCaseIssue
-
isVoidReturnTypeIssue
-
getReturnTypeFromPartialStatement
-
isModeAvailable
-
isMissingOverride
-
isOtherPopupShowing
private boolean isOtherPopupShowing() -
isImplictCoercion
-
isObsoleteConstructor
-
isJavaStyleCast
-
resetSmartHelpState
public void resetSmartHelpState() -
handlePossibleImportFix
private boolean handlePossibleImportFix(IParsedElement source, ITypeUsesMap typeUses, Set<String> processed) -
getLocationFromOffset
- Throws:
BadLocationException
-
showSmartFix
-
showSmartFix
-
findParseIssuesOrderedByDistanceFromCaret
-
getDistanceFromPosition
Returns the cartesian distance of this parse issue from the given column/line in column/line units -
getMode
-
getPossibleTypesToImport
-
getPeToFixWithAsStatement
-
getJavaStyleCast
-
getTypeToCoerceTo
-
mouseDragged
- Specified by:
mouseDragged
in interfaceMouseMotionListener
-
mouseMoved
- Specified by:
mouseMoved
in interfaceMouseMotionListener
-
hidePopup
private void hidePopup() -
bufferShowPopup
private void bufferShowPopup(boolean restartIfActive) -
keyTyped
- Specified by:
keyTyped
in interfaceKeyListener
-
keyPressed
- Specified by:
keyPressed
in interfaceKeyListener
-
keyReleased
- Specified by:
keyReleased
in interfaceKeyListener
-
showPopup
private void showPopup() -
getTargetBounds
-
isCaseParseIssue
-
getReplaceChunk
public static SmartFixManager.ReplaceChunk getReplaceChunk(IParsedElement sourceOfIssue, String gosuSource)
-