public interface IEditor
Modifier and Type | Interface and Description |
---|---|
static class |
IEditor.CaretPosition
Storage for caret position and selection.
|
static class |
IEditor.CHANGE_CASE_TO |
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 |
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 getCurrentFile() ). |
java.lang.String |
getCurrentTranslation()
Returns current translation or null.
|
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 |
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 |
undo()
Undo editing.
|
void |
windowDeactivated()
Perform any necessary actions for window deactivation.
|
java.lang.String getCurrentFile()
source
) of the source file
currently open in the editor.
Can be called from any thread.
java.lang.String getCurrentTargetFile()
target
) of the target file
corresponding to the current source file (per getCurrentFile()
).
This file is what is created upon doing Create Target Documents, but it
may not exist yet.
Can be called from any thread.
SourceTextEntry getCurrentEntry()
int getCurrentEntryNumber()
void activateEntry()
void commitAndDeactivate()
void commitAndLeave()
void nextEntry()
void prevEntry()
void nextEntryWithNote()
void prevEntryWithNote()
void nextUntranslatedEntry()
void nextTranslatedEntry()
void nextUniqueEntry()
void gotoFile(int fileIndex) throws java.lang.IndexOutOfBoundsException
fileIndex
- file index in projectjava.lang.IndexOutOfBoundsException
- If there is no file for the given indexvoid gotoEntry(int entryNum)
gotoEntry(int, CaretPosition)
where the caret position will be
the start of the entry.entryNum
- entry number, starts from 1
Must be called only from UI thread.void gotoEntry(int entryNum, IEditor.CaretPosition pos)
entryNum
- entry number, starts from 1
Must be called only from UI thread.void gotoEntry(java.lang.String srcString, EntryKey key)
srcString
- entry source stringkey
- entry key (can be null)
Must be called only from UI thread.void gotoEntryAfterFix(int fixedEntry, java.lang.String fixedSource)
fixedEntry
- entry number, starts from 1fixedSource
- The source of the entry that was fixed
Must be called only from UI thread.void refreshViewAfterFix(java.util.List<java.lang.Integer> fixedEntries)
fixedEntries
- A list of all entries that were altered
Must be called only from UI thread.void refreshView(boolean doCommit)
void requestFocus()
void changeCase(IEditor.CHANGE_CASE_TO newCase)
newCase
- : lower, title, upper or cycle
Must be called only from UI thread.void replaceEditText(java.lang.String text)
void replaceEditTextAndMark(java.lang.String text)
void insertText(java.lang.String text)
void insertTextAndMark(java.lang.String text)
text
- The text to insertvoid insertTag(java.lang.String tag)
void gotoHistoryForward()
void gotoHistoryBack()
IEditorSettings getSettings()
void undo()
void redo()
java.lang.String getSelectedText()
void setAlternateTranslationForCurrentEntry(boolean alternate)
void markActiveEntrySource(SourceTextEntry requiredActiveEntry, java.util.List<Mark> marks, java.lang.String markerClassName)
requiredActiveEntry
- entry which should be active. If user moved to other entry,
then marks will be skippedmarks
- list of marksmarkerClassName
- marker's class namevoid registerPopupMenuConstructors(int priority, IPopupMenuConstructor constructor)
priority
- priority of process orderconstructor
- constructor instancevoid remarkOneMarker(java.lang.String markerClassName)
IEditorFilter getFilter()
void setFilter(IEditorFilter filter)
filter
- Filter instancevoid removeFilter()
java.lang.String getCurrentTranslation()
void windowDeactivated()
void registerUntranslated()
void registerEmptyTranslation()
void registerIdenticalTranslation()
IAutoCompleter getAutoCompleter()