|
![]() Quark Platform Documentation Version 1.7.0_0 Business Objects |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.text.JTextComponent
javax.swing.JEditorPane
org.openquark.gems.client.caleditor.CALEditor
org.openquark.gems.client.caleditor.AdvancedCALEditor
public class AdvancedCALEditor
This is an extension of the CALEditor class, providing support for interaction with code elements such as supercombinators, class methods, data types, data constructors type classes and arguments. The editor has the following features: - uses metadata to display descriptive tooltips for code elements - facilitates identification and resolution of ambiguous elements (these are unqualified elements which belong to multiple external modules) - provides accessibility for custom menus
| Nested Class Summary | |
|---|---|
static class |
AdvancedCALEditor.AmbiguityOffset
A convenience class for storing an ambiguous identifier and its position. |
static class |
AdvancedCALEditor.EditorLocation
A convenience class for locating a portion of cal code within the buffer of the text editor. |
static interface |
AdvancedCALEditor.IdentifierPopupMenuProvider
Interface to define a provider for a popup menu for interacting with identifiers. |
static class |
AdvancedCALEditor.PositionlessIdentifier
Class representing an analysed identifier without position. |
class |
AdvancedCALEditor.SymbolHighlighter
Maintains highlights over the specified symbols in the current editor. |
static interface |
AdvancedCALEditor.SymbolRenamerListener
Listener notified when symbol renaming completes. |
static class |
AdvancedCALEditor.UnderlineHighlightPainter
This class draws a little squiggly underline as the highlight. |
| Nested classes/interfaces inherited from class javax.swing.JEditorPane |
|---|
JEditorPane.AccessibleJEditorPane, JEditorPane.AccessibleJEditorPaneHTML, JEditorPane.JEditorPaneAccessibleHypertextSupport |
| Nested classes/interfaces inherited from class javax.swing.text.JTextComponent |
|---|
JTextComponent.AccessibleJTextComponent, JTextComponent.KeyBinding |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JEditorPane |
|---|
HONOR_DISPLAY_PROPERTIES, W3C_LENGTH_UNITS |
| Fields inherited from class javax.swing.text.JTextComponent |
|---|
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
AdvancedCALEditor(ModuleTypeInfo workingModuleTypeInfo,
CALWorkspace workspace)
Constructor with module |
|
| Method Summary | |
|---|---|
org.openquark.util.Pair<AdvancedCALEditor.SymbolHighlighter,AdvancedCALEditor.SymbolHighlighter> |
createLocalVariableHighlighters(CodeAnalyser.AnalysedIdentifier identifier)
Create highlighters for a local variable reference or definition. |
void |
enterRenameMode(CodeAnalyser.AnalysedIdentifier identifier,
AdvancedCALEditor.SymbolRenamerListener renameListener)
Causes the editor to switch interaction mode to rename the specified identifier. |
List<AdvancedCALEditor.AmbiguityOffset> |
getAmbiguityOffsets()
Retrieves the list of ambiguities highlighted in the editor |
AdvancedCALEditor.EditorLocation |
getEditorTokenOffset(int codeLine,
int codeColumn,
int length)
Given a code line and column, calculates the position of a code token within the editor text buffer. |
CodeAnalyser.AnalysedIdentifier |
getIdentifierAtPosition(int textOffset)
|
String |
getMetadataToolTipText(String unqualifiedName,
ModuleName moduleName,
SourceIdentifier.Category type,
ModuleTypeInfo workingModuleTypeInfo)
Retrieve formatted metadata tooltip for the specified qualification. |
static String |
getMetadataToolTipText(String unqualifiedName,
ModuleName moduleName,
SourceIdentifier.Category type,
ModuleTypeInfo workingModuleTypeInfo,
CALWorkspace workspace,
JComponent parent)
Retrieve formatted metadata tooltip for the specified qualification. |
AdvancedCALEditor.IdentifierPopupMenuProvider |
getPopupMenuProvider()
|
String |
getQualifiedCodeText(int offsetStart,
int offsetEnd,
CodeAnalyser codeAnalyser)
Returns the fully qualified text which can be produced from the specified editor text. |
List<CodeAnalyser.AnalysedIdentifier> |
getSelectedIdentifiers(int offsetStart,
int offsetEnd)
Returns list of identifiers contained by the specified offsets of editor selection. |
int |
getTabSize()
|
String |
getToolTipText(MouseEvent e)
Retrieves tooltip text from the metadata of the identifier pointed to. |
void |
setModuleTypeInfo(ModuleTypeInfo moduleTypeInfo)
Sets the module type info used |
void |
setPopupMenuProvider(AdvancedCALEditor.IdentifierPopupMenuProvider popupProvider)
Set the provider for popup menus |
void |
setSourceIdentifiers(List<CodeAnalyser.AnalysedIdentifier> analysedIdentifiers)
Sets the source identifiers |
void |
updateAmbiguityIndicators()
Clears ambiguity identifiers, then repopulates the list of ambiguities from the analyzed identifiers. |
| Methods inherited from class org.openquark.gems.client.caleditor.CALEditor |
|---|
addCALSyntaxStyleListener, removeCALSyntaxStyleListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AdvancedCALEditor(ModuleTypeInfo workingModuleTypeInfo,
CALWorkspace workspace)
| Method Detail |
|---|
public String getToolTipText(MouseEvent e)
getToolTipText in class JTextComponent
public String getMetadataToolTipText(String unqualifiedName,
ModuleName moduleName,
SourceIdentifier.Category type,
ModuleTypeInfo workingModuleTypeInfo)
unqualifiedName - unqualified name of identifiermoduleName - identifier module name. Can be null.type - identifier typeworkingModuleTypeInfo - type info for the current module.
public static String getMetadataToolTipText(String unqualifiedName,
ModuleName moduleName,
SourceIdentifier.Category type,
ModuleTypeInfo workingModuleTypeInfo,
CALWorkspace workspace,
JComponent parent)
unqualifiedName - unqualified name of identifiermoduleName - identifier module name. Can be null.type - identifier typeworkingModuleTypeInfo - type info for the current module.workspace - the related workspace.parent - component displaying the tooltip
public int getTabSize()
public CodeAnalyser.AnalysedIdentifier getIdentifierAtPosition(int textOffset)
textOffset - text offset of the item
public void setSourceIdentifiers(List<CodeAnalyser.AnalysedIdentifier> analysedIdentifiers)
analysedIdentifiers - public void setModuleTypeInfo(ModuleTypeInfo moduleTypeInfo)
moduleTypeInfo - public void updateAmbiguityIndicators()
public List<AdvancedCALEditor.AmbiguityOffset> getAmbiguityOffsets()
public List<CodeAnalyser.AnalysedIdentifier> getSelectedIdentifiers(int offsetStart,
int offsetEnd)
offsetStart - offsetEnd -
public String getQualifiedCodeText(int offsetStart,
int offsetEnd,
CodeAnalyser codeAnalyser)
offsetStart - offsetEnd - codeAnalyser -
public AdvancedCALEditor.EditorLocation getEditorTokenOffset(int codeLine,
int codeColumn,
int length)
throws BadLocationException
codeLine - codeColumn - length - length of text to select (-1 will auto-detect end bound)
BadLocationException - if supplied location is invalidpublic void setPopupMenuProvider(AdvancedCALEditor.IdentifierPopupMenuProvider popupProvider)
popupProvider - public AdvancedCALEditor.IdentifierPopupMenuProvider getPopupMenuProvider()
public void enterRenameMode(CodeAnalyser.AnalysedIdentifier identifier,
AdvancedCALEditor.SymbolRenamerListener renameListener)
identifier - identifier to renamepublic org.openquark.util.Pair<AdvancedCALEditor.SymbolHighlighter,AdvancedCALEditor.SymbolHighlighter> createLocalVariableHighlighters(CodeAnalyser.AnalysedIdentifier identifier)
identifier - local variable to highlight
| |||