Autopsy  4.16.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
Public Member Functions | Private Member Functions | Private Attributes | List of all members
org.sleuthkit.autopsy.centralrepository.CentralRepoCommentDialog.CentralRepoCommentLengthFilter Class Reference

Inherits DocumentFilter.

Public Member Functions

 CentralRepoCommentLengthFilter ()
 
void insertString (FilterBypass filter, int offset, String input, AttributeSet attrSet) throws BadLocationException
 
void remove (FilterBypass filter, int offset, int length) throws BadLocationException
 
void replace (FilterBypass filter, int offset, int length, String input, AttributeSet attrSet) throws BadLocationException
 

Private Member Functions

void updateLabel ()
 

Private Attributes

final Integer MAX_CHARACTERS = 500
 
Integer remainingCharacters = MAX_CHARACTERS
 

Detailed Description

Limits the number of characters that can go into the Comment JTextArea of this Dialog box.

Definition at line 102 of file CentralRepoCommentDialog.java.

Constructor & Destructor Documentation

org.sleuthkit.autopsy.centralrepository.CentralRepoCommentDialog.CentralRepoCommentLengthFilter.CentralRepoCommentLengthFilter ( )

Definition at line 107 of file CentralRepoCommentDialog.java.

Member Function Documentation

void org.sleuthkit.autopsy.centralrepository.CentralRepoCommentDialog.CentralRepoCommentLengthFilter.insertString ( FilterBypass  filter,
int  offset,
String  input,
AttributeSet  attrSet 
) throws BadLocationException

Truncates the insert string if its addition in the Comment dialog box will cause it to go past MAX_CHARACTERS in length.

Parameters
filterFilterBypass that can be used to mutate Document
offsetthe offset into the document to insert the content >= 0. All positions that track change at or after the given location will move.
inputthe string to insert
attrSetthe attributes to associate with the inserted content. This may be null if there are no attributes.
Exceptions
BadLocationExceptionthe given insert position is not a valid position within the document

Definition at line 126 of file CentralRepoCommentDialog.java.

void org.sleuthkit.autopsy.centralrepository.CentralRepoCommentDialog.CentralRepoCommentLengthFilter.remove ( FilterBypass  filter,
int  offset,
int  length 
) throws BadLocationException

Remove the number of characters from the Comment Text box and add back to our remaining count.

Parameters
filterFilterBypass that can be used to mutate Document
offsetthe offset from the beginning >= 0
lengththe number of characters to remove >= 0
Exceptions
BadLocationExceptionsome portion of the removal range was not a valid part of the document. The location in the exception is the first bad position encountered.

Definition at line 145 of file CentralRepoCommentDialog.java.

void org.sleuthkit.autopsy.centralrepository.CentralRepoCommentDialog.CentralRepoCommentLengthFilter.replace ( FilterBypass  filter,
int  offset,
int  length,
String  input,
AttributeSet  attrSet 
) throws BadLocationException

Replace the current text at the offset position with the inputted text. If the offset is the end of the text box, then this functions like an append. Truncate this input if its addition will cause the Comment text box to be > MAX_CHARACTERS in length.

Parameters
filterFilterBypass that can be used to mutate Document
offsetLocation in Document
lengthLength of text to delete
inputText to insert, null indicates no text to insert
attrSetAttributeSet indicating attributes of inserted text, null is legal.
Exceptions
BadLocationExceptionthe given insert position is not a valid position within the document

Definition at line 168 of file CentralRepoCommentDialog.java.

void org.sleuthkit.autopsy.centralrepository.CentralRepoCommentDialog.CentralRepoCommentLengthFilter.updateLabel ( )
private

Updates the remainingCharactersLabel to reflect the current state. If there are no more characters left, a red 0 is displayed in the UI.

Definition at line 186 of file CentralRepoCommentDialog.java.

Member Data Documentation

final Integer org.sleuthkit.autopsy.centralrepository.CentralRepoCommentDialog.CentralRepoCommentLengthFilter.MAX_CHARACTERS = 500
private

Definition at line 104 of file CentralRepoCommentDialog.java.

Integer org.sleuthkit.autopsy.centralrepository.CentralRepoCommentDialog.CentralRepoCommentLengthFilter.remainingCharacters = MAX_CHARACTERS
private

Definition at line 105 of file CentralRepoCommentDialog.java.


The documentation for this class was generated from the following file:

Copyright © 2012-2020 Basis Technology. Generated on: Tue Sep 22 2020
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.