Package org.omegat.core
Class Core
- java.lang.Object
-
- org.omegat.core.Core
-
public final class Core extends java.lang.Object
Class 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 interface
Core.RunnableWithException
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
executeExclusively(boolean waitForUnlock, Core.RunnableWithException run)
Use this to perform operations that must not be run concurrently.static IAutoSave
getAutoSave()
static IComments
getComments()
Get comments areastatic IDictionaries
getDictionaries()
static IEditor
getEditor()
Get editor instance.static FilterMaster
getFilterMaster()
static IGlossaries
getGlossary()
Get glossary instance.static GlossaryManager
getGlossaryManager()
static IIssues
getIssues()
static MachineTranslateTextArea
getMachineTranslatePane()
static IMainWindow
getMainWindow()
Get main window instance.static java.util.List<IMarker>
getMarkers()
static IMatcher
getMatcher()
Get matcher component instance.static INotes
getNotes()
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 IProject
getProject()
Get project instance.static Segmenter
getSegmenter()
static ISpellChecker
getSpellChecker()
Get spell checker instance.static ITagValidation
getTagValidation()
Get tag validation component instance.static void
initializeConsole(java.util.Map<java.lang.String,java.lang.String> params)
Initialize application components.static void
initializeGUI(java.lang.ClassLoader classLoader, java.util.Map<java.lang.String,java.lang.String> params)
Initialize application components.static void
pluginLoadingError(java.lang.String errorText)
Any plugin can call this method for say about error on loading.static void
registerFilterClass(java.lang.Class<? extends IFilter> clazz)
static void
registerMachineTranslationClass(java.lang.Class<? extends IMachineTranslation> clazz)
static void
registerMarker(IMarker marker)
Register class for calculate marks.static void
registerMarkerClass(java.lang.Class<? extends IMarker> clazz)
static void
registerTokenizerClass(java.lang.Class<? extends ITokenizer> clazz)
static void
setFilterMaster(FilterMaster newFilterMaster)
static void
setProject(IProject newCurrentProject)
Set new current project.static void
setSegmenter(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.Exception
Initialize application components.- Throws:
java.lang.Exception
-
initializeConsole
public static void initializeConsole(java.util.Map<java.lang.String,java.lang.String> params) throws java.lang.Exception
Initialize 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.Exception
Use 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
-
-