public class ConsoleBindings extends java.lang.Object implements IGlossaries, IEditor, IScriptLogger
IEditor.CaretPosition, IEditor.CHANGE_CASE_TO
Constructor and Description |
---|
ConsoleBindings() |
Modifier and Type | Method and Description |
---|---|
void |
activateEntry()
Activate entry for edit.
|
void |
changeCase(IEditor.CHANGE_CASE_TO newCase)
Change case of the selected text or if none is selected, of the current
word.
|
void |
clear() |
void |
commitAndDeactivate()
Commits the translation and deactivate entry.
|
void |
commitAndLeave()
Commits the translation and leave entry activated.
|
IAutoCompleter |
getAutoCompleter()
Access the AutoCompleter
|
SourceTextEntry |
getCurrentEntry()
Get current active entry.
|
int |
getCurrentEntryNumber()
Get current active entry number.
|
java.lang.String |
getCurrentFile()
Get relative path (under
source ) of the source file
currently open in the editor. |
java.lang.String |
getCurrentTargetFile()
Get the relative path (under
target ) of the target file
corresponding to the current source file (per IEditor.getCurrentFile() ). |
java.lang.String |
getCurrentTranslation()
Returns current translation or null.
|
java.util.List<GlossaryEntry> |
getDisplayedEntries() |
IEditorFilter |
getFilter()
Gets a filter for this editor, or null if filter doesn't applied.
|
java.lang.String |
getSelectedText()
Get currently selected text.
|
IEditorSettings |
getSettings()
Get settings instance.
|
void |
gotoEntry(int entryNum)
Goto entry with specified number.
|
void |
gotoEntry(int entryNum,
IEditor.CaretPosition pos)
Goto entry with specified number, and restore caret to specified
position.
|
void |
gotoEntry(java.lang.String srcString,
EntryKey key)
Goto entry based on a string and entry key.
|
void |
gotoEntryAfterFix(int fixedEntry,
java.lang.String fixedSource)
Goto entry with specified number while avoiding clobbering the tag fixes.
|
void |
gotoFile(int fileIndex)
Goto first entry in specified file.
|
void |
gotoHistoryBack()
Go to previous segment from history.
|
void |
gotoHistoryForward()
Go to next segment from history.
|
void |
insertTag(java.lang.String tag)
Inserts tag at the cursor position, probably with adding bidi control chars.
|
void |
insertText(java.lang.String text)
Inserts text at the cursor position.
|
void |
insertTextAndMark(java.lang.String text)
Inserts text at the cursor position and mark as to be changed
by the translator, i.e, background of segment should be marked
Must be called only from UI thread.
|
void |
markActiveEntrySource(SourceTextEntry requiredActiveEntry,
java.util.List<Mark> marks,
java.lang.String markerClassName)
All plugins can call this method for mark something in active entry.
|
void |
nextEntry()
Move to next entry.
|
void |
nextEntryWithNote()
Move to next entry with a note.
|
void |
nextTranslatedEntry()
Move to next translated entry.
|
void |
nextUniqueEntry()
Move to the first non-unique entry.
|
void |
nextUntranslatedEntry()
Move to next untranslated entry.
|
void |
prevEntry()
Move to previous entry.
|
void |
prevEntryWithNote()
Move to previous entry with a note.
|
void |
print(java.lang.Object o) |
void |
println(java.lang.Object o) |
void |
redo()
Redo editing.
|
void |
refreshView(boolean doCommit) |
void |
refreshViewAfterFix(java.util.List<java.lang.Integer> fixedEntries)
Refresh the current editor view while avoiding clobbering any tag fixes.
|
void |
registerEmptyTranslation()
Register as empty.
|
void |
registerIdenticalTranslation()
Register translation to be identical to source.
|
void |
registerPopupMenuConstructors(int priority,
IPopupMenuConstructor constructor)
Register constructor of popup menu.
|
void |
registerUntranslated()
Register untranslated.
|
void |
remarkOneMarker(java.lang.String markerClassName)
Calls specified marker for reprocess all entries.
|
void |
removeFilter()
Removes the current filter.
|
void |
replaceEditText(java.lang.String text)
Replaces the entire edit area with a given text.
|
void |
replaceEditTextAndMark(java.lang.String text)
Inserts text at the cursor position and mark as to be changed
by the translator, i.e, background of segment should be marked
Must be called only from UI thread.
|
void |
requestFocus()
Set current focus to editor.
|
void |
setAlternateTranslationForCurrentEntry(boolean alternate)
Set default/alternate translation for current entry.
|
void |
setFilter(IEditorFilter filter)
Sets a filter to this editor.
|
void |
showCreateGlossaryEntryDialog(java.awt.Frame parent) |
void |
undo()
Undo editing.
|
void |
windowDeactivated()
Perform any necessary actions for window deactivation.
|
public final void print(java.lang.Object o)
print
in interface IScriptLogger
public final void println(java.lang.Object o)
println
in interface IScriptLogger
public void clear()
clear
in interface IScriptLogger
public final java.lang.String getCurrentFile()
IEditor
source
) of the source file
currently open in the editor.
Can be called from any thread.
getCurrentFile
in interface IEditor
public final java.lang.String getCurrentTargetFile()
IEditor
target
) of the target file
corresponding to the current source file (per IEditor.getCurrentFile()
).
This file is what is created upon doing Create Target Documents, but it
may not exist yet.
Can be called from any thread.
getCurrentTargetFile
in interface IEditor
public SourceTextEntry getCurrentEntry()
IEditor
getCurrentEntry
in interface IEditor
public final int getCurrentEntryNumber()
IEditor
getCurrentEntryNumber
in interface IEditor
public void activateEntry()
IEditor
activateEntry
in interface IEditor
public void commitAndDeactivate()
IEditor
commitAndDeactivate
in interface IEditor
public void commitAndLeave()
IEditor
commitAndLeave
in interface IEditor
public void nextEntry()
IEditor
public void prevEntry()
IEditor
public void nextEntryWithNote()
IEditor
nextEntryWithNote
in interface IEditor
public void prevEntryWithNote()
IEditor
prevEntryWithNote
in interface IEditor
public void nextUntranslatedEntry()
IEditor
nextUntranslatedEntry
in interface IEditor
public void nextTranslatedEntry()
IEditor
nextTranslatedEntry
in interface IEditor
public void nextUniqueEntry()
IEditor
nextUniqueEntry
in interface IEditor
public void gotoFile(int fileIndex) throws java.lang.IndexOutOfBoundsException
IEditor
public void gotoEntry(int entryNum)
IEditor
IEditor.gotoEntry(int, CaretPosition)
where the caret position will be
the start of the entry.public void gotoEntry(int entryNum, IEditor.CaretPosition pos)
IEditor
public void gotoEntry(java.lang.String srcString, EntryKey key)
IEditor
public void gotoEntryAfterFix(int fixedEntry, java.lang.String fixedSource)
IEditor
gotoEntryAfterFix
in interface IEditor
fixedEntry
- entry number, starts from 1fixedSource
- The source of the entry that was fixed
Must be called only from UI thread.public void refreshViewAfterFix(java.util.List<java.lang.Integer> fixedEntries)
IEditor
refreshViewAfterFix
in interface IEditor
fixedEntries
- A list of all entries that were altered
Must be called only from UI thread.public void refreshView(boolean doCommit)
refreshView
in interface IEditor
public void requestFocus()
IEditor
requestFocus
in interface IEditor
public void changeCase(IEditor.CHANGE_CASE_TO newCase)
IEditor
changeCase
in interface IEditor
newCase
- : lower, title, upper or cycle
Must be called only from UI thread.public void replaceEditText(java.lang.String text)
IEditor
replaceEditText
in interface IEditor
public void replaceEditTextAndMark(java.lang.String text)
IEditor
replaceEditTextAndMark
in interface IEditor
public void insertText(java.lang.String text)
IEditor
insertText
in interface IEditor
public void insertTextAndMark(java.lang.String text)
IEditor
insertTextAndMark
in interface IEditor
text
- The text to insertpublic void insertTag(java.lang.String tag)
IEditor
public void gotoHistoryForward()
IEditor
gotoHistoryForward
in interface IEditor
public void gotoHistoryBack()
IEditor
gotoHistoryBack
in interface IEditor
public final IEditorSettings getSettings()
IEditor
getSettings
in interface IEditor
public void undo()
IEditor
public void redo()
IEditor
public final java.lang.String getSelectedText()
IEditor
getSelectedText
in interface IEditor
public void setAlternateTranslationForCurrentEntry(boolean alternate)
IEditor
setAlternateTranslationForCurrentEntry
in interface IEditor
public void markActiveEntrySource(SourceTextEntry requiredActiveEntry, java.util.List<Mark> marks, java.lang.String markerClassName)
IEditor
markActiveEntrySource
in interface IEditor
requiredActiveEntry
- entry which should be active. If user moved to other entry,
then marks will be skippedmarks
- list of marksmarkerClassName
- marker's class namepublic void registerPopupMenuConstructors(int priority, IPopupMenuConstructor constructor)
IEditor
registerPopupMenuConstructors
in interface IEditor
priority
- priority of process orderconstructor
- constructor instancepublic void remarkOneMarker(java.lang.String markerClassName)
IEditor
remarkOneMarker
in interface IEditor
public final IEditorFilter getFilter()
IEditor
public void setFilter(IEditorFilter filter)
IEditor
public void removeFilter()
IEditor
removeFilter
in interface IEditor
public final java.lang.String getCurrentTranslation()
IEditor
getCurrentTranslation
in interface IEditor
public void windowDeactivated()
IEditor
windowDeactivated
in interface IEditor
public void registerUntranslated()
IEditor
registerUntranslated
in interface IEditor
public void registerEmptyTranslation()
IEditor
registerEmptyTranslation
in interface IEditor
public void registerIdenticalTranslation()
IEditor
registerIdenticalTranslation
in interface IEditor
public final IAutoCompleter getAutoCompleter()
IEditor
getAutoCompleter
in interface IEditor
public final java.util.List<GlossaryEntry> getDisplayedEntries()
getDisplayedEntries
in interface IGlossaries
public void showCreateGlossaryEntryDialog(java.awt.Frame parent)
showCreateGlossaryEntryDialog
in interface IGlossaries