com.togethersoft.openapi.util.ui
Class TextAreaDialog


public class TextAreaDialog
implements ActionListener

Presents dialof box with a textarea field on the top and two buttons on the bottom:
OK and CANCEL. It is possible only to get/set text in text area.

Author:
TogetherSoft
Since: Together 4.0

Field Summary
 final static intCANCEL
          Returned by show method if Cancel or Close button pressed.
 private intmyCurrentCaretPosition
           
 private JDialogmyDialog
           
 private booleanmyReadOnly
           
 private intmyResult
           
 private StringmyText
           
 private JTextAreamyTextArea
           
 private StringmyTitle
           
 final static intOK
          Returned by show method if Ok button pressed.

Constructor Summary
TextAreaDialog(String title, String text)
          Constructs new dialog with specified title and text.
TextAreaDialog(String title, String text, boolean readOnly)
           

Method Summary
 voidactionPerformed(ActionEvent evt)
          Actions handling
 StringgetText()
          Get text from the textarea.
 voidsetCaretPosition(int position)
           
 voidsetText(String text)
          Sets specified text into the textarea.
 intshow(Component parent)
          Paints this dialog box and adds default action listeners to the buttons.
 private voidshowReadOnly()
           

Field Detail

CANCEL

public final static int CANCEL
Returned by show method if Cancel or Close button pressed.

myCurrentCaretPosition

private int myCurrentCaretPosition

myDialog

private JDialog myDialog

myReadOnly

private boolean myReadOnly

myResult

private int myResult

myText

private String myText

myTextArea

private JTextArea myTextArea

myTitle

private String myTitle

OK

public final static int OK
Returned by show method if Ok button pressed.
Constructor Detail

TextAreaDialog

public TextAreaDialog(String title, String text)
Constructs new dialog with specified title and text.
Parameters:
title Title of this dialog box.
text Text to be placed into textarea. Can contains \n and \r symbols.

TextAreaDialog

public TextAreaDialog(String title, String text, boolean readOnly)
Method Detail

actionPerformed

public void actionPerformed(ActionEvent evt)
Actions handling

getText

public String getText()
Get text from the textarea.

setCaretPosition

public void setCaretPosition(int position)
Since:
Together 5.0

setText

public void setText(String text)
Sets specified text into the textarea.

show

public int show(Component parent)
Paints this dialog box and adds default action listeners to the buttons.
Returns: OK if button Ok pressed or CANCEL if button Cancel pressed.

showReadOnly

private void showReadOnly()

Association Links

to Class java.lang.String

to Class java.lang.String

to Class javax.swing.JTextArea

to Class javax.swing.JDialog