Class AsyncConverter
java.lang.Object
com.e1c.langtool.internal.converter.AsyncConverter
Asynchronous converter for coordinating the conversion process between language projects.
The AsyncConverter class provides a mechanism for scheduling and performing asynchronous language
project conversions using a specified IConverterService and IConverterEngine.
Usage example:
// Create an instance of IConverterService and IConverterEngine
IConverterEngine engine = ...; // Implement or obtain the instance through dependency injection
// Create an instance of AsyncConverter
AsyncConverter asyncConverter = new AsyncConverter(engine);
// Schedule asynchronous conversion
asyncConverter.scheduleCompute();
// Add projects to the conversion queue
IProject translatedProject = ...; // Specify the translated project
IProject sourceLangProject = ...; // Specify the source language project
IProject targetLangProject = ...; // Specify the target language project
asyncConverter.addToConvert(translatedProject, sourceLangProject, targetLangProject);
// Clean the conversion queue for a specific project
IProject projectToClean = ...; // Specify the project to clean the queue
asyncConverter.cleanQueue(projectToClean);
Note: All projects used in this class are assumed to be non-null.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAsyncConverter(IConverterEngine engine) Creates a new instance ofAsyncConverterwith the specifiedIConverterEngine. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToConvert(org.eclipse.core.resources.IProject project, org.eclipse.core.resources.IProject sourceLangProject, org.eclipse.core.resources.IProject targetLangProject) Adds a language project conversion task to the queue for asynchronous processing.voidcleanQueue(org.eclipse.core.resources.IProject project) Cleans the conversion queue for the specified project.voidSchedules the asynchronous conversion job.
-
Constructor Details
-
AsyncConverter
Creates a new instance ofAsyncConverterwith the specifiedIConverterEngine.- Parameters:
engine- the converter engine to use, cannot benull.
-
-
Method Details
-
scheduleCompute
public void scheduleCompute()Schedules the asynchronous conversion job. -
addToConvert
public void addToConvert(org.eclipse.core.resources.IProject project, org.eclipse.core.resources.IProject sourceLangProject, org.eclipse.core.resources.IProject targetLangProject) Adds a language project conversion task to the queue for asynchronous processing.- Parameters:
project- the translated project, cannot benull.sourceLangProject- the source language project, cannot benull.targetLangProject- the target language project, cannot benull.
-
cleanQueue
public void cleanQueue(org.eclipse.core.resources.IProject project) Cleans the conversion queue for the specified project.- Parameters:
project- the project for which to clean the conversion queue, cannot benull.
-