Package org.omegat.core
Class Core
java.lang.Object
org.omegat.core.Core
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 that work in Swing UI thread can have another synchronization idea: it cannot be synchronized to access to some data that changed only in UI thread.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic voidexecuteExclusively(boolean waitForUnlock, Core.RunnableWithException run) Use this to perform operations that must not be run concurrently.static IAutoSavestatic ICommentsGet comments areastatic IDictionariesstatic IEditorGet editor instance.static FilterMasterstatic IGlossariesGet glossary instance.static GlossaryManagerstatic IIssuesstatic LongProcessExecutorstatic MachineTranslateTextAreastatic @Nullable IMainWindowGet main window instance.static IMatcherGet matcher component instance.static INotesgetNotes()Get notes instance.Get all plugin loading errors.static IProjectGet project instance.static IProjectFilesListstatic Segmenterstatic SegmentPropertiesAreaGet segment properties areastatic ISpellCheckerGet spell checker instance.static ITagValidationGet tag validation component instance.static voidinitializeConsole(Map<String, String> params) Initialize application components.static voidinitializeGUI(ClassLoader cl, Map<String, String> params) Deprecated, for removal: This API element is subject to removal in a future version.since 6.1.0static voidinitializeGUI(Map<String, String> params) Initialize application components.static voidpluginLoadingError(String errorText) Any plugin can call this method for say about error on loading.static voidregisterAutoCompleterClass(Class<? extends AbstractAutoCompleterView> clazz) Register autocompleter.static voidregisterConsoleCommand(String name, Class<? extends BaseSubCommand> subcommand) Registers a console command by associating a command name with its corresponding subcommand class.static voidregisterFilterClass(Class<? extends IFilter> clazz) static voidregisterMachineTranslationClass(Class<? extends IMachineTranslation> clazz) static voidregisterMarker(IMarker marker) Register class for calculate marks.static voidregisterMarkerClass(Class<? extends IMarker> clazz) static voidregisterSpellCheckClass(Class<? extends ISpellChecker> clazz) Register spellchecker plugin.static voidregisterTokenizerClass(Class<? extends ITokenizer> clazz) static voidsetFilterMaster(FilterMaster newFilterMaster) static voidsetProject(IProject newCurrentProject) Set new current project.static voidsetSegmenter(Segmenter newSegmenter)
-
Method Details
-
getProject
Get project instance. -
setProject
Set new current project. -
getMainWindow
Get main window instance. -
getEditor
Get editor instance. -
getTagValidation
Get tag validation component instance. -
getIssues
-
getMatcher
Get matcher component instance. -
getSpellChecker
Get spell checker instance. -
getFilterMaster
-
setFilterMaster
-
getProjectFilesList
-
getMachineTranslatePane
-
getAutoSave
-
getGlossary
Get glossary instance. -
getGlossaryManager
-
getNotes
Get notes instance. -
getSegmentPropertiesArea
Get segment properties area -
getComments
Get comments area- Returns:
- the comment area
-
getDictionaries
-
getSegmenter
-
setSegmenter
-
initializeGUI
@Deprecated(since="6.1.0", forRemoval=true) public static void initializeGUI(ClassLoader cl, Map<String, String> params) throws ExceptionDeprecated, for removal: This API element is subject to removal in a future version.since 6.1.0initialize GUI.An interface that was introduced in v5.6.0 when supporting theme plugin.
- Parameters:
cl- class loader.params- CLI parameters.- Throws:
Exception- when error occurred.
-
initializeGUI
Initialize application components.- Throws:
Exception
-
getLongProcessExecutor
-
initializeConsole
Initialize application components. -
registerMarker
Register class for calculate marks.- Parameters:
marker- marker implementation
-
getMarkers
-
getParams
-
registerFilterClass
-
registerMachineTranslationClass
-
registerMarkerClass
-
registerTokenizerClass
-
registerSpellCheckClass
Register spellchecker plugin.- Parameters:
clazz- spellchecker class.
-
registerAutoCompleterClass
Register autocompleter. -
registerConsoleCommand
Registers a console command by associating a command name with its corresponding subcommand class. This method adds the specified command to a collection of subcommands, enabling it to be later utilized or executed through the command-line interface.- Parameters:
name- the subcommand name of the console command to be registered.subcommand- the class representing the subcommand implementation associated with the given name.
-
getPluginsLoadingErrors
Get all plugin loading errors. -
pluginLoadingError
Any plugin can call this method for say about error on loading. -
executeExclusively
public static void executeExclusively(boolean waitForUnlock, Core.RunnableWithException run) throws 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:
Exception- Throw an exception from runnable if received.
-