Autopsy  4.7.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
org.sleuthkit.autopsy.corecomponents.TextPrompt Class Reference

Inherits JLabel, FocusListener, and DocumentListener.

Classes

enum  Show
 

Public Member Functions

 TextPrompt (String text, JTextComponent component)
 
 TextPrompt (String text, JTextComponent component, Show show)
 
void changeAlpha (float alpha)
 
void changeAlpha (int alpha)
 
void changedUpdate (DocumentEvent e)
 
void changeStyle (int style)
 
void focusGained (FocusEvent e)
 
void focusLost (FocusEvent e)
 
Show getShow ()
 
boolean getShowPromptOnce ()
 
void insertUpdate (DocumentEvent e)
 
void removeUpdate (DocumentEvent e)
 
void setShow (Show show)
 
void setShowPromptOnce (boolean showPromptOnce)
 

Private Member Functions

void checkForPrompt ()
 

Private Attributes

JTextComponent component
 
Document document
 
int focusLost
 
Show show
 
boolean showPromptOnce
 

Detailed Description

The TextPrompt class will display a prompt over top of a text component when the Document of the text field is empty. The Show property is used to determine the visibility of the prompt.

The Font and foreground Color of the prompt will default to those properties of the parent text component. You are free to change the properties after class construction. From: https://tips4java.wordpress.com/2009/11/29/text-prompt/

Definition at line 20 of file TextPrompt.java.

Constructor & Destructor Documentation

org.sleuthkit.autopsy.corecomponents.TextPrompt.TextPrompt ( String  text,
JTextComponent  component 
)
org.sleuthkit.autopsy.corecomponents.TextPrompt.TextPrompt ( String  text,
JTextComponent  component,
Show  show 
)

Member Function Documentation

void org.sleuthkit.autopsy.corecomponents.TextPrompt.changeAlpha ( float  alpha)

Convenience method to change the alpha value of the current foreground Color to the specifice value.

Parameters
alphavalue in the range of 0 - 1.0.

Definition at line 66 of file TextPrompt.java.

void org.sleuthkit.autopsy.corecomponents.TextPrompt.changeAlpha ( int  alpha)

Convenience method to change the alpha value of the current foreground Color to the specifice value.

Parameters
alphavalue in the range of 0 - 255.

Definition at line 76 of file TextPrompt.java.

void org.sleuthkit.autopsy.corecomponents.TextPrompt.changedUpdate ( DocumentEvent  e)

Definition at line 204 of file TextPrompt.java.

void org.sleuthkit.autopsy.corecomponents.TextPrompt.changeStyle ( int  style)

Convenience method to change the style of the current Font. The style values are found in the Font class. Common values might be: Font.BOLD, Font.ITALIC and Font.BOLD + Font.ITALIC.

Parameters
stylevalue representing the the new style of the Font.

Definition at line 95 of file TextPrompt.java.

void org.sleuthkit.autopsy.corecomponents.TextPrompt.checkForPrompt ( )
private
void org.sleuthkit.autopsy.corecomponents.TextPrompt.focusGained ( FocusEvent  e)
void org.sleuthkit.autopsy.corecomponents.TextPrompt.focusLost ( FocusEvent  e)
Show org.sleuthkit.autopsy.corecomponents.TextPrompt.getShow ( )

Get the Show property

Returns
the Show property.

Definition at line 104 of file TextPrompt.java.

References org.sleuthkit.autopsy.corecomponents.TextPrompt.show.

boolean org.sleuthkit.autopsy.corecomponents.TextPrompt.getShowPromptOnce ( )

Get the showPromptOnce property

Returns
the showPromptOnce property.

Definition at line 128 of file TextPrompt.java.

References org.sleuthkit.autopsy.corecomponents.TextPrompt.showPromptOnce.

void org.sleuthkit.autopsy.corecomponents.TextPrompt.insertUpdate ( DocumentEvent  e)
void org.sleuthkit.autopsy.corecomponents.TextPrompt.removeUpdate ( DocumentEvent  e)
void org.sleuthkit.autopsy.corecomponents.TextPrompt.setShow ( Show  show)

Set the prompt Show property to control when the promt is shown. Valid values are:

Show.AWLAYS (default) - always show the prompt Show.Focus_GAINED - show the prompt when the component gains focus (and hide the prompt when focus is lost) Show.Focus_LOST - show the prompt when the component loses focus (and hide the prompt when focus is gained)

Parameters
showa valid Show enum

Definition at line 119 of file TextPrompt.java.

References org.sleuthkit.autopsy.corecomponents.TextPrompt.show.

Referenced by org.sleuthkit.autopsy.corecomponents.TextPrompt.TextPrompt().

void org.sleuthkit.autopsy.corecomponents.TextPrompt.setShowPromptOnce ( boolean  showPromptOnce)

Show the prompt once. Once the component has gained/lost focus once, the prompt will not be shown again.

Parameters
showPromptOncewhen true the prompt will only be shown once, otherwise it will be shown repeatedly.

Definition at line 139 of file TextPrompt.java.

References org.sleuthkit.autopsy.corecomponents.TextPrompt.showPromptOnce.

Member Data Documentation

JTextComponent org.sleuthkit.autopsy.corecomponents.TextPrompt.component
private
Document org.sleuthkit.autopsy.corecomponents.TextPrompt.document
private

Definition at line 31 of file TextPrompt.java.

int org.sleuthkit.autopsy.corecomponents.TextPrompt.focusLost
private

Definition at line 35 of file TextPrompt.java.

Show org.sleuthkit.autopsy.corecomponents.TextPrompt.show
private
boolean org.sleuthkit.autopsy.corecomponents.TextPrompt.showPromptOnce
private

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

Copyright © 2012-2016 Basis Technology. Generated on: Mon Jun 18 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.