Package org.omegat.core
Class Core
- java.lang.Object
-
- org.omegat.core.Core
-
public final class Core extends java.lang.ObjectClass which contains all components instances. Note about threads synchronization: each component must have only local synchronization. It mustn't synchronize around other components or some other objects. Components which works in Swing UI thread can have other synchronization idea: it can not be synchronized to access to some data which changed only in UI thread.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCore.RunnableWithException
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidexecuteExclusively(boolean waitForUnlock, Core.RunnableWithException run)Use this to perform operations that must not be run concurrently.static IAutoSavegetAutoSave()static ICommentsgetComments()Get comments areastatic IDictionariesgetDictionaries()static IEditorgetEditor()Get editor instance.static FilterMastergetFilterMaster()static IGlossariesgetGlossary()Get glossary instance.static GlossaryManagergetGlossaryManager()static IIssuesgetIssues()static MachineTranslateTextAreagetMachineTranslatePane()static IMainWindowgetMainWindow()Get main window instance.static java.util.List<IMarker>getMarkers()static IMatchergetMatcher()Get matcher component instance.static INotesgetNotes()Get notes instance.static java.util.Map<java.lang.String,java.lang.String>getParams()static java.util.List<java.lang.String>getPluginsLoadingErrors()Get all plugin loading errors.static IProjectgetProject()Get project instance.static SegmentergetSegmenter()static ISpellCheckergetSpellChecker()Get spell checker instance.static ITagValidationgetTagValidation()Get tag validation component instance.static voidinitializeConsole(java.util.Map<java.lang.String,java.lang.String> params)Initialize application components.static voidinitializeGUI(java.lang.ClassLoader classLoader, java.util.Map<java.lang.String,java.lang.String> params)Initialize application components.static voidpluginLoadingError(java.lang.String errorText)Any plugin can call this method for say about error on loading.static voidregisterFilterClass(java.lang.Class<? extends IFilter> clazz)static voidregisterMachineTranslationClass(java.lang.Class<? extends IMachineTranslation> clazz)static voidregisterMarker(IMarker marker)Register class for calculate marks.static voidregisterMarkerClass(java.lang.Class<? extends IMarker> clazz)static voidregisterTokenizerClass(java.lang.Class<? extends ITokenizer> clazz)static voidsetFilterMaster(FilterMaster newFilterMaster)static voidsetProject(IProject newCurrentProject)Set new current project.static voidsetSegmenter(Segmenter newSegmenter)
-
-
-
Method Detail
-
getProject
public static IProject getProject()
Get project instance.
-
setProject
public static void setProject(IProject newCurrentProject)
Set new current project.
-
getMainWindow
public static IMainWindow getMainWindow()
Get main window instance.
-
getEditor
public static IEditor getEditor()
Get editor instance.
-
getTagValidation
public static ITagValidation getTagValidation()
Get tag validation component instance.
-
getIssues
public static IIssues getIssues()
-
getMatcher
public static IMatcher getMatcher()
Get matcher component instance.
-
getSpellChecker
public static ISpellChecker getSpellChecker()
Get spell checker instance.
-
getFilterMaster
public static FilterMaster getFilterMaster()
-
setFilterMaster
public static void setFilterMaster(FilterMaster newFilterMaster)
-
getMachineTranslatePane
public static MachineTranslateTextArea getMachineTranslatePane()
-
getAutoSave
public static IAutoSave getAutoSave()
-
getGlossary
public static IGlossaries getGlossary()
Get glossary instance.
-
getGlossaryManager
public static GlossaryManager getGlossaryManager()
-
getNotes
public static INotes getNotes()
Get notes instance.
-
getComments
public static IComments getComments()
Get comments area- Returns:
- the comment area
-
getDictionaries
public static IDictionaries getDictionaries()
-
getSegmenter
public static Segmenter getSegmenter()
-
setSegmenter
public static void setSegmenter(Segmenter newSegmenter)
-
initializeGUI
public static void initializeGUI(java.lang.ClassLoader classLoader, java.util.Map<java.lang.String,java.lang.String> params) throws java.lang.ExceptionInitialize application components.- Throws:
java.lang.Exception
-
initializeConsole
public static void initializeConsole(java.util.Map<java.lang.String,java.lang.String> params) throws java.lang.ExceptionInitialize application components.- Throws:
java.lang.Exception
-
registerMarker
public static void registerMarker(IMarker marker)
Register class for calculate marks.- Parameters:
marker- marker implementation
-
getMarkers
public static java.util.List<IMarker> getMarkers()
-
getParams
public static java.util.Map<java.lang.String,java.lang.String> getParams()
-
registerFilterClass
public static void registerFilterClass(java.lang.Class<? extends IFilter> clazz)
-
registerMachineTranslationClass
public static void registerMachineTranslationClass(java.lang.Class<? extends IMachineTranslation> clazz)
-
registerMarkerClass
public static void registerMarkerClass(java.lang.Class<? extends IMarker> clazz)
-
registerTokenizerClass
public static void registerTokenizerClass(java.lang.Class<? extends ITokenizer> clazz)
-
getPluginsLoadingErrors
public static java.util.List<java.lang.String> getPluginsLoadingErrors()
Get all plugin loading errors.
-
pluginLoadingError
public static void pluginLoadingError(java.lang.String errorText)
Any plugin can call this method for say about error on loading.
-
executeExclusively
public static void executeExclusively(boolean waitForUnlock, Core.RunnableWithException run) throws java.lang.ExceptionUse this to perform operations that must not be run concurrently.For instance project load/save/compile/autosave operations must not be executed in parallel because it will break project files, especially during team synchronization. For guaranteed non-parallel execution, all such operations must be executed via this method.
- Parameters:
waitForUnlock- should execution wait for unlock 3 minutesrun- code for execute- Throws:
java.lang.Exception
-
-