Package org.omegat.gui.editor
Class EditorSettings
- java.lang.Object
-
- org.omegat.gui.editor.EditorSettings
-
- All Implemented Interfaces:
IEditorSettings
public class EditorSettings extends java.lang.Object implements IEditorSettings
Editor behavior control settings.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DISPLAY_MODIFICATION_INFO_ALL
static java.lang.String
DISPLAY_MODIFICATION_INFO_NONE
static java.lang.String
DISPLAY_MODIFICATION_INFO_SELECTED
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description char
getAdvancerChar()
javax.swing.text.AttributeSet
getAttributeSet(boolean isSource, boolean isPlaceholder, boolean isRemoveText, SourceTextEntry.DUPLICATE duplicate, boolean active, boolean translationExists, boolean hasNote, boolean isNBSP)
Choose segment's attributes based on rules.java.lang.String
getDisplayModificationInfo()
returns the setting for display the modification information or not Either DISPLAY_MODIFICATION_INFO_NONE, DISPLAY_MODIFICATION_INFO_SELECTED, DISPLAY_MODIFICATION_INFO_ALLjavax.swing.text.AttributeSet
getModificationInfoAttributeSet()
Returns font attributes for the modification info line.javax.swing.text.AttributeSet
getOtherLanguageTranslationAttributeSet()
Returns font attributes for other languages translation.javax.swing.text.AttributeSet
getParagraphStartAttributeSet()
Returns font attributes for paragraph startjavax.swing.text.AttributeSet
getSegmentMarkerAttributeSet()
Returns font attributes for the segment marker.boolean
isAutoSpellChecking()
need to check spell or notboolean
isDisplaySegmentSources()
display the segment sources or notboolean
isDoFontFallback()
boolean
isHideDuplicateSegments()
boolean
isMarkAutoPopulated()
boolean
isMarkBidi()
mark Bidirectional control charactersboolean
isMarkGlossaryMatches()
boolean
isMarkLanguageChecker()
boolean
isMarkNBSP()
mark non-breakable spaces?boolean
isMarkNonUniqueSegments()
boolean
isMarkNotedSegments()
boolean
isMarkParagraphDelimitations()
boolean
isMarkTranslated()
boolean
isMarkUntranslated()
boolean
isMarkWhitespace()
mark whitespace?boolean
isUseTabForAdvance()
void
setAutoSpellChecking(boolean autoSpellChecking)
void
setDisplayModificationInfo(java.lang.String displayModificationInfo)
Sets the setting for display the modification information or notvoid
setDisplaySegmentSources(boolean displaySegmentSources)
void
setDoFontFallback(boolean doFontFalback)
void
setMarkAutoPopulated(boolean val)
void
setMarkBidi(boolean markBidi)
void
setMarkGlossaryMatches(boolean markGlossaryMatches)
void
setMarkLanguageChecker(boolean markLanguageChecker)
void
setMarkNBSP(boolean markNBSP)
void
setMarkNonUniqueSegments(boolean markNonUniqueSegments)
void
setMarkNotedSegments(boolean markNotedSegments)
void
setMarkParagraphDelimitations(boolean delimitations)
void
setMarkTranslated(boolean markTranslated)
void
setMarkUntranslated(boolean markUntranslated)
void
setMarkWhitespace(boolean markWhitespace)
void
setUseTabForAdvance(boolean useTabForAdvance)
void
updateTagValidationPreferences()
repaint segments in editor according to new view tag validation options.void
updateViewPreferences()
repaint segments in editor according to new view options.
-
-
-
Field Detail
-
DISPLAY_MODIFICATION_INFO_NONE
public static final java.lang.String DISPLAY_MODIFICATION_INFO_NONE
- See Also:
- Constant Field Values
-
DISPLAY_MODIFICATION_INFO_SELECTED
public static final java.lang.String DISPLAY_MODIFICATION_INFO_SELECTED
- See Also:
- Constant Field Values
-
DISPLAY_MODIFICATION_INFO_ALL
public static final java.lang.String DISPLAY_MODIFICATION_INFO_ALL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAdvancerChar
public char getAdvancerChar()
-
isUseTabForAdvance
public boolean isUseTabForAdvance()
- Specified by:
isUseTabForAdvance
in interfaceIEditorSettings
-
setUseTabForAdvance
public void setUseTabForAdvance(boolean useTabForAdvance)
- Specified by:
setUseTabForAdvance
in interfaceIEditorSettings
-
isMarkTranslated
public boolean isMarkTranslated()
- Specified by:
isMarkTranslated
in interfaceIEditorSettings
-
setMarkTranslated
public void setMarkTranslated(boolean markTranslated)
- Specified by:
setMarkTranslated
in interfaceIEditorSettings
-
isMarkUntranslated
public boolean isMarkUntranslated()
- Specified by:
isMarkUntranslated
in interfaceIEditorSettings
-
isMarkAutoPopulated
public boolean isMarkAutoPopulated()
- Specified by:
isMarkAutoPopulated
in interfaceIEditorSettings
-
setMarkAutoPopulated
public void setMarkAutoPopulated(boolean val)
- Specified by:
setMarkAutoPopulated
in interfaceIEditorSettings
-
setMarkUntranslated
public void setMarkUntranslated(boolean markUntranslated)
- Specified by:
setMarkUntranslated
in interfaceIEditorSettings
-
isDisplaySegmentSources
public boolean isDisplaySegmentSources()
display the segment sources or not- Specified by:
isDisplaySegmentSources
in interfaceIEditorSettings
-
isMarkNonUniqueSegments
public boolean isMarkNonUniqueSegments()
- Specified by:
isMarkNonUniqueSegments
in interfaceIEditorSettings
-
isHideDuplicateSegments
public boolean isHideDuplicateSegments()
-
isMarkNotedSegments
public boolean isMarkNotedSegments()
- Specified by:
isMarkNotedSegments
in interfaceIEditorSettings
-
isMarkNBSP
public boolean isMarkNBSP()
mark non-breakable spaces?- Specified by:
isMarkNBSP
in interfaceIEditorSettings
- Returns:
- true when set, false otherwise
-
isMarkWhitespace
public boolean isMarkWhitespace()
mark whitespace?- Specified by:
isMarkWhitespace
in interfaceIEditorSettings
- Returns:
- true when set, false otherwise
-
isMarkBidi
public boolean isMarkBidi()
mark Bidirectional control characters- Specified by:
isMarkBidi
in interfaceIEditorSettings
- Returns:
- true when set, false otherwise
-
isDoFontFallback
public boolean isDoFontFallback()
- Specified by:
isDoFontFallback
in interfaceIEditorSettings
-
setDisplaySegmentSources
public void setDisplaySegmentSources(boolean displaySegmentSources)
- Specified by:
setDisplaySegmentSources
in interfaceIEditorSettings
-
setMarkNonUniqueSegments
public void setMarkNonUniqueSegments(boolean markNonUniqueSegments)
- Specified by:
setMarkNonUniqueSegments
in interfaceIEditorSettings
-
setMarkNotedSegments
public void setMarkNotedSegments(boolean markNotedSegments)
- Specified by:
setMarkNotedSegments
in interfaceIEditorSettings
-
setMarkNBSP
public void setMarkNBSP(boolean markNBSP)
- Specified by:
setMarkNBSP
in interfaceIEditorSettings
-
setMarkWhitespace
public void setMarkWhitespace(boolean markWhitespace)
- Specified by:
setMarkWhitespace
in interfaceIEditorSettings
-
setMarkParagraphDelimitations
public void setMarkParagraphDelimitations(boolean delimitations)
- Specified by:
setMarkParagraphDelimitations
in interfaceIEditorSettings
-
isMarkParagraphDelimitations
public boolean isMarkParagraphDelimitations()
- Specified by:
isMarkParagraphDelimitations
in interfaceIEditorSettings
-
setMarkBidi
public void setMarkBidi(boolean markBidi)
- Specified by:
setMarkBidi
in interfaceIEditorSettings
-
setDoFontFallback
public void setDoFontFallback(boolean doFontFalback)
- Specified by:
setDoFontFallback
in interfaceIEditorSettings
-
isMarkGlossaryMatches
public boolean isMarkGlossaryMatches()
- Specified by:
isMarkGlossaryMatches
in interfaceIEditorSettings
-
setMarkGlossaryMatches
public void setMarkGlossaryMatches(boolean markGlossaryMatches)
- Specified by:
setMarkGlossaryMatches
in interfaceIEditorSettings
-
isMarkLanguageChecker
public boolean isMarkLanguageChecker()
- Specified by:
isMarkLanguageChecker
in interfaceIEditorSettings
-
setMarkLanguageChecker
public void setMarkLanguageChecker(boolean markLanguageChecker)
- Specified by:
setMarkLanguageChecker
in interfaceIEditorSettings
-
getDisplayModificationInfo
public java.lang.String getDisplayModificationInfo()
returns the setting for display the modification information or not Either DISPLAY_MODIFICATION_INFO_NONE, DISPLAY_MODIFICATION_INFO_SELECTED, DISPLAY_MODIFICATION_INFO_ALL- Specified by:
getDisplayModificationInfo
in interfaceIEditorSettings
-
setDisplayModificationInfo
public void setDisplayModificationInfo(java.lang.String displayModificationInfo)
Sets the setting for display the modification information or not- Specified by:
setDisplayModificationInfo
in interfaceIEditorSettings
- Parameters:
displayModificationInfo
- Either DISPLAY_MODIFICATION_INFO_NONE , DISPLAY_MODIFICATION_INFO_SELECTED , DISPLAY_MODIFICATION_INFO_ALL
-
isAutoSpellChecking
public boolean isAutoSpellChecking()
need to check spell or not- Specified by:
isAutoSpellChecking
in interfaceIEditorSettings
-
setAutoSpellChecking
public void setAutoSpellChecking(boolean autoSpellChecking)
- Specified by:
setAutoSpellChecking
in interfaceIEditorSettings
-
updateViewPreferences
public void updateViewPreferences()
repaint segments in editor according to new view options. Use when options change to make them effective immediately.- Specified by:
updateViewPreferences
in interfaceIEditorSettings
-
updateTagValidationPreferences
public void updateTagValidationPreferences()
repaint segments in editor according to new view tag validation options. Use when options change to make them effective immediately.- Specified by:
updateTagValidationPreferences
in interfaceIEditorSettings
-
getAttributeSet
public javax.swing.text.AttributeSet getAttributeSet(boolean isSource, boolean isPlaceholder, boolean isRemoveText, SourceTextEntry.DUPLICATE duplicate, boolean active, boolean translationExists, boolean hasNote, boolean isNBSP)
Choose segment's attributes based on rules.- Parameters:
isSource
- is it a source segment or a target segmentisPlaceholder
- is it for a placeholder (OmegaT tag or sprintf-variable etc.) or regular text inside the segment?isRemoveText
- is it text that should be removed from translation?duplicate
- is the sourceTextEntry a duplicate or not? values: DUPLICATE.NONE, DUPLICATE.FIRST or DUPLICATE.NEXT. See sourceTextEntryste.getDuplicate()active
- is it an active segment?translationExists
- does a translation already existisNBSP
- is the text a non-breakable space- Returns:
- proper AttributeSet to use on displaying the segment.
-
getParagraphStartAttributeSet
public javax.swing.text.AttributeSet getParagraphStartAttributeSet()
Returns font attributes for paragraph start- Returns:
-
getModificationInfoAttributeSet
public javax.swing.text.AttributeSet getModificationInfoAttributeSet()
Returns font attributes for the modification info line.- Returns:
-
getSegmentMarkerAttributeSet
public javax.swing.text.AttributeSet getSegmentMarkerAttributeSet()
Returns font attributes for the segment marker.- Returns:
-
getOtherLanguageTranslationAttributeSet
public javax.swing.text.AttributeSet getOtherLanguageTranslationAttributeSet()
Returns font attributes for other languages translation.- Returns:
-
-