Autopsy
4.19.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
|
Inherits SwingWorker< TranslateTextTask.TranslateResult, Void >.
Inherited by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.OnTranslation, and org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.ExtractAndTranslateTextTask.
Classes | |
class | TranslateResult |
Public Member Functions | |
TranslateTextTask (boolean translateText, String fileDescriptor) | |
TranslateResult | doInBackground () throws InterruptedException |
void | done () |
Protected Member Functions | |
void | onErrorDisplay (String text, ComponentOrientation orientation, int font) |
void | onProgressDisplay (String text, ComponentOrientation orientation, int font) |
abstract void | onTextDisplay (String text, ComponentOrientation orientation, int font) |
abstract String | retrieveText () throws IOException, InterruptedException, IllegalStateException |
String | translate (String input) throws NoServiceProviderException, TranslationException |
Private Member Functions | |
TranslateResult | translateRetrievedText (String fileText) throws InterruptedException |
Private Attributes | |
final String | contentDescriptor |
final boolean | translateText |
Static Private Attributes | |
static final Logger | logger = Logger.getLogger(TranslatedTextViewer.class.getName()) |
This is an abstract class for translating text and displaying to the user.
Definition at line 39 of file TranslateTextTask.java.
org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.TranslateTextTask | ( | boolean | translateText, |
String | fileDescriptor | ||
) |
This is the main constructor for the TranslateTextTask.
translateText | whether or not to translate text |
fileDescriptor | the content descriptor for the item being translated (used for logging errors) |
Definition at line 89 of file TranslateTextTask.java.
References org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.translateText.
TranslateResult org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.doInBackground | ( | ) | throws InterruptedException |
Definition at line 142 of file TranslateTextTask.java.
References org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.TranslateResult.error(), org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.retrieveText(), org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.TranslateResult.success(), and org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.translateRetrievedText().
void org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.done | ( | ) |
Definition at line 203 of file TranslateTextTask.java.
References org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.TranslateResult.getErrorMessage(), org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.TranslateResult.getResult(), org.sleuthkit.autopsy.coreutils.TextUtil.getTextDirection(), org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.TranslateResult.isSuccessful(), org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.onErrorDisplay(), and org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.onTextDisplay().
|
protected |
When an error result is received, this method is called. This method can be overridden depending on the scenario but defaults to just displaying using onTextDisplay.
text | the text of the error |
orientation | the orientation for the error |
font | the font style of the error |
Definition at line 130 of file TranslateTextTask.java.
References org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.onTextDisplay().
Referenced by org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.done().
|
protected |
When a progress result is received, this method is called. This method can be overridden depending on the scenario, but defaults to just displaying using onTextDisplay.
text | the text of the status update |
orientation | the orientation for the status |
font | the font style of the status |
Definition at line 118 of file TranslateTextTask.java.
References org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.onTextDisplay().
Referenced by org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.translateRetrievedText().
|
abstractprotected |
This method should be overridden when a translated text result is received.
text | the text to display |
orientation | the orientation of the text |
font | the font style (returns plain) |
Referenced by org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.done(), org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.onErrorDisplay(), and org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.onProgressDisplay().
|
abstractprotected |
This method retrieves the original text content to be translated.
IOException | |
InterruptedException | |
IllegalStateException |
Referenced by org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.doInBackground().
|
protected |
This method passes the translation off to the translation service provider.
input | text to be translated |
Definition at line 238 of file TranslateTextTask.java.
References org.sleuthkit.autopsy.texttranslation.TextTranslationService.getInstance(), and org.sleuthkit.autopsy.texttranslation.TextTranslationService.translate().
Referenced by org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.translateRetrievedText().
|
private |
This is the final step in the translation swing worker prior to being done(); translates the text if needed.
fileText | the text to translate |
InterruptedException | if operation is canclled, an interrupted exception is thrown |
Definition at line 175 of file TranslateTextTask.java.
References org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.TranslateResult.error(), org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.onProgressDisplay(), org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.TranslateResult.success(), and org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.translate().
Referenced by org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.doInBackground().
|
private |
Definition at line 44 of file TranslateTextTask.java.
|
staticprivate |
Definition at line 41 of file TranslateTextTask.java.
|
private |
Definition at line 43 of file TranslateTextTask.java.
Referenced by org.sleuthkit.autopsy.texttranslation.ui.TranslateTextTask.TranslateTextTask().
Copyright © 2012-2021 Basis Technology. Generated on: Fri Aug 6 2021
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.