Autopsy
4.19.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
|
Inherits JPanel.
Classes | |
interface | ContentComponent |
class | OnTranslation |
class | TranslatablePanelException |
class | TranslatedText |
class | TranslateOption |
Public Member Functions | |
TranslatablePanel (ContentComponent contentComponent) | |
Private Attributes | |
volatile OnTranslation | backgroundTask = null |
final Object | backgroundTaskLock = new Object() |
volatile TranslatedText | cachedTranslated |
final Object | cachedTranslatedLock = new Object() |
String | content |
final ContentComponent | contentComponent |
String | contentDescriptor |
final ExecutorService | executorService = Executors.newSingleThreadExecutor(translationThreadFactory) |
boolean | prevTranslateSelection |
final TextTranslationService | translationService |
final ThreadFactory | translationThreadFactory = new ThreadFactoryBuilder().setNameFormat("translatable-panel-%d").build() |
final ImageIcon | warningIcon = new ImageIcon(TranslatablePanel.class.getResource("/org/sleuthkit/autopsy/images/warning16.png")) |
Static Private Attributes | |
static final ComponentOrientation | DEFAULT_ORIENTATION = ComponentOrientation.LEFT_TO_RIGHT |
static final long | serialVersionUID = 1L |
javax.swing.JLabel | statusLabel |
javax.swing.JComboBox< TranslateOption > | translateComboBox |
javax.swing.JPanel | translationBar |
final void | reset () |
void | setContent (String content, String contentDescriptor) |
TranslatedText | getCachedTranslated () |
void | setCachedTranslated (TranslatedText translated) |
void | cancelPendingTranslation () |
void | runTranslationTask () |
void | clearStatus () |
synchronized void | setStatus (String msg, boolean showWarningIcon) |
void | setTranslationEnabled () |
void | setChildComponentContent (String content) |
synchronized void | setChildComponentContent (String content, ComponentOrientation orientation) |
void | additionalInit (Component rootComponent, String origOptionText, String translatedOptionText) |
void | handleComboBoxChange (TranslateOption translateOption) |
void | initComponents () |
void | translateComboBoxActionPerformed (java.awt.event.ActionEvent evt) |
String | retrieveTranslation (String input) throws TranslationException, NoServiceProviderException |
This is a panel for translation with a subcomponent that allows for translation.
Definition at line 40 of file TranslatablePanel.java.
org.sleuthkit.autopsy.contentviewers.TranslatablePanel.TranslatablePanel | ( | ContentComponent | contentComponent | ) |
Definition at line 194 of file TranslatablePanel.java.
References org.sleuthkit.autopsy.contentviewers.TranslatablePanel.contentComponent, and org.sleuthkit.autopsy.texttranslation.TextTranslationService.getInstance().
|
private |
This method is for items that are programmatically initialized.
Definition at line 351 of file TranslatablePanel.java.
References org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translateComboBox.
|
private |
If a translation worker is running, this is called to cancel the worker.
Definition at line 239 of file TranslatablePanel.java.
References org.sleuthkit.autopsy.contentviewers.TranslatablePanel.backgroundTaskLock.
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.handleComboBoxChange(), org.sleuthkit.autopsy.contentviewers.TranslatablePanel.runTranslationTask(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setContent().
|
private |
This method clears the status bar.
Definition at line 303 of file TranslatablePanel.java.
References org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setStatus().
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.handleComboBoxChange(), org.sleuthkit.autopsy.contentviewers.TranslatablePanel.OnTranslation.onTextDisplay(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setContent().
|
private |
Definition at line 221 of file TranslatablePanel.java.
References org.sleuthkit.autopsy.contentviewers.TranslatablePanel.cachedTranslated, and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.cachedTranslatedLock.
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.handleComboBoxChange().
|
private |
When the combo box choice is selected, this method is fired.
translateOption | the current translate option |
Definition at line 362 of file TranslatablePanel.java.
References org.sleuthkit.autopsy.contentviewers.TranslatablePanel.cancelPendingTranslation(), org.sleuthkit.autopsy.contentviewers.TranslatablePanel.clearStatus(), org.sleuthkit.autopsy.contentviewers.TranslatablePanel.getCachedTranslated(), org.sleuthkit.autopsy.contentviewers.TranslatablePanel.runTranslationTask(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setChildComponentContent().
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translateComboBoxActionPerformed().
|
private |
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
Definition at line 390 of file TranslatablePanel.java.
References org.sleuthkit.autopsy.contentviewers.TranslatablePanel.statusLabel, org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translateComboBox, org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translateComboBoxActionPerformed(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translationBar.
final void org.sleuthkit.autopsy.contentviewers.TranslatablePanel.reset | ( | ) |
This resets the component to an empty state and sets the translation bar visibility based on whether there is a provider.
Definition at line 266 of file TranslatablePanel.java.
References org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setContent().
Referenced by org.sleuthkit.autopsy.contentviewers.artifactviewers.MessageArtifactViewer.resetComponent().
|
protected |
This is where actual translation takes place allowed to be overridden for the sake of varying translatable content (i.e. html, rtf, etc).
input | the input content |
TranslationException | |
NoServiceProviderException |
Definition at line 296 of file TranslatablePanel.java.
References org.sleuthkit.autopsy.texttranslation.TextTranslationService.translate().
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.OnTranslation.translate().
|
private |
This runs a translation worker to translate the text.
Definition at line 251 of file TranslatablePanel.java.
References org.sleuthkit.autopsy.contentviewers.TranslatablePanel.backgroundTaskLock, and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.cancelPendingTranslation().
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.handleComboBoxChange().
|
private |
translated | the translated text to be cached |
Definition at line 230 of file TranslatablePanel.java.
References org.sleuthkit.autopsy.contentviewers.TranslatablePanel.cachedTranslatedLock.
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.OnTranslation.onTextDisplay(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setContent().
|
private |
The child component provided in the constructor will have its content set to the string provided.
content | the content to display in the child component |
Definition at line 328 of file TranslatablePanel.java.
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.handleComboBoxChange(), org.sleuthkit.autopsy.contentviewers.TranslatablePanel.OnTranslation.onTextDisplay(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setContent().
|
private |
The child component provided in the constructor will have its content set to the string provided.
content | the content to display in the child component |
orientation | the orientation for the text |
Definition at line 338 of file TranslatablePanel.java.
References org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setStatus().
void org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setContent | ( | String | content, |
String | contentDescriptor | ||
) |
This method sets the content for the component; this also clears the status.
content | the content for the panel |
contentDescriptor | the content descriptor to be used in error messages |
Definition at line 275 of file TranslatablePanel.java.
References org.sleuthkit.autopsy.contentviewers.TranslatablePanel.cancelPendingTranslation(), org.sleuthkit.autopsy.contentviewers.TranslatablePanel.clearStatus(), org.sleuthkit.autopsy.contentviewers.TranslatablePanel.content, org.sleuthkit.autopsy.contentviewers.TranslatablePanel.contentDescriptor, org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setCachedTranslated(), org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setChildComponentContent(), org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setTranslationEnabled(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translateComboBox.
Referenced by org.sleuthkit.autopsy.contentviewers.artifactviewers.MessageArtifactViewer.configureTextArea(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.reset().
|
private |
This sets the status bar message.
msg | the status bar message to show |
showWarningIcon | whether that status is a warning |
Definition at line 312 of file TranslatablePanel.java.
References org.sleuthkit.autopsy.contentviewers.TranslatablePanel.statusLabel.
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.clearStatus(), org.sleuthkit.autopsy.contentviewers.TranslatablePanel.OnTranslation.onErrorDisplay(), org.sleuthkit.autopsy.contentviewers.TranslatablePanel.OnTranslation.onProgressDisplay(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setChildComponentContent().
|
private |
This method sets the translation bar visibility based on whether or not there is a provided.
Definition at line 320 of file TranslatablePanel.java.
References org.sleuthkit.autopsy.texttranslation.TextTranslationService.hasProvider(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translateComboBox.
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setContent().
|
private |
Definition at line 425 of file TranslatablePanel.java.
References org.sleuthkit.autopsy.contentviewers.TranslatablePanel.handleComboBoxChange(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translateComboBox.
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.initComponents().
|
private |
Definition at line 190 of file TranslatablePanel.java.
|
private |
Definition at line 183 of file TranslatablePanel.java.
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.cancelPendingTranslation(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.runTranslationTask().
|
private |
Definition at line 189 of file TranslatablePanel.java.
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.getCachedTranslated().
|
private |
Definition at line 182 of file TranslatablePanel.java.
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.getCachedTranslated(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setCachedTranslated().
|
private |
Definition at line 185 of file TranslatablePanel.java.
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.OnTranslation.retrieveText(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setContent().
|
private |
Definition at line 177 of file TranslatablePanel.java.
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.TranslatablePanel().
|
private |
Definition at line 186 of file TranslatablePanel.java.
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setContent().
|
staticprivate |
Definition at line 173 of file TranslatablePanel.java.
|
private |
Definition at line 180 of file TranslatablePanel.java.
|
private |
Definition at line 187 of file TranslatablePanel.java.
|
staticprivate |
Definition at line 172 of file TranslatablePanel.java.
|
private |
Definition at line 430 of file TranslatablePanel.java.
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.initComponents(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setStatus().
|
private |
Definition at line 431 of file TranslatablePanel.java.
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.additionalInit(), org.sleuthkit.autopsy.contentviewers.TranslatablePanel.initComponents(), org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setContent(), org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setTranslationEnabled(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translateComboBoxActionPerformed().
|
private |
Definition at line 432 of file TranslatablePanel.java.
Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.initComponents().
|
private |
Definition at line 178 of file TranslatablePanel.java.
|
private |
Definition at line 179 of file TranslatablePanel.java.
|
private |
Definition at line 175 of file TranslatablePanel.java.
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.