Class TextDialog

    • Field Detail

      • m_TextPanel

        protected TextPanel m_TextPanel
        for displaying the text.
    • Constructor Detail

      • TextDialog

        public TextDialog()
        Creates a modeless dialog without a title and without a specified Frame owner.
      • TextDialog

        public TextDialog​(Dialog owner)
        Creates a modeless dialog without a title with the specified Dialog as its owner.
        Parameters:
        owner - the owning dialog
      • TextDialog

        public TextDialog​(Dialog owner,
                          Dialog.ModalityType modality)
        Creates a dialog with the specified owner Dialog and modality.
        Parameters:
        owner - the owning dialog
        modality - the type of modality
      • TextDialog

        public TextDialog​(Dialog owner,
                          String title)
        Creates a modeless dialog with the specified title and with the specified owner dialog.
        Parameters:
        owner - the owning dialog
        title - the title of the dialog
      • TextDialog

        public TextDialog​(Dialog owner,
                          String title,
                          Dialog.ModalityType modality)
        Creates a dialog with the specified title, modality and the specified owner Dialog.
        Parameters:
        owner - the owning dialog
        title - the title of the dialog
        modality - the type of modality
      • TextDialog

        public TextDialog​(Frame owner)
        Creates a modeless dialog without a title with the specified Frame as its owner.
        Parameters:
        owner - the owning frame
      • TextDialog

        public TextDialog​(Frame owner,
                          boolean modal)
        Creates a dialog with the specified owner Frame, modality and an empty title.
        Parameters:
        owner - the owning frame
        modal - whether the dialog is modal or not
      • TextDialog

        public TextDialog​(Frame owner,
                          String title)
        Creates a modeless dialog with the specified title and with the specified owner frame.
        Parameters:
        owner - the owning frame
        title - the title of the dialog
      • TextDialog

        public TextDialog​(Frame owner,
                          String title,
                          boolean modal)
        Creates a dialog with the specified owner Frame, modality and title.
        Parameters:
        owner - the owning frame
        title - the title of the dialog
        modal - whether the dialog is modal or not
    • Method Detail

      • initGUI

        protected void initGUI()
        For initializing the GUI.
        Overrides:
        initGUI in class BaseDialog
      • setDialogTitle

        public void setDialogTitle​(String value)
        Sets the (base) title to use.
        Parameters:
        value - the base title
        See Also:
        TextPanel.setTitle(String)
      • getDialogTitle

        public String getDialogTitle()
        Returns the (base) title in use.
        Returns:
        the base title
        See Also:
        TextPanel.getTitle()
      • setModified

        public void setModified​(boolean value)
        Sets the modified state.
        Parameters:
        value - if true then the content is flagged as modified
      • isModified

        public boolean isModified()
        Returns whether the content has been modified.
        Returns:
        true if the content was modified
      • setContent

        public void setContent​(String value)
        Sets the content to display. Resets the modified state.
        Parameters:
        value - the text
      • getContent

        public String getContent()
        Returns the content to display.
        Returns:
        the text
      • setEditable

        public void setEditable​(boolean value)
        Sets whether the text area is editable or not.
        Parameters:
        value - if true then the text will be editable
      • isEditable

        public boolean isEditable()
        Returns whether the text area is editable or not.
        Returns:
        true if the text is editable
      • setTextFont

        public void setTextFont​(Font value)
        Sets the font of the text area.
        Parameters:
        value - the font to use
      • getTextFont

        public Font getTextFont()
        Returns the font currently in use by the text area.
        Returns:
        the font in use
      • setTabSize

        public void setTabSize​(int value)
        Sets the tab size, i.e., the number of maximum width characters.
        Parameters:
        value - the number of maximum width chars
      • getTabSize

        public int getTabSize()
        Returns the tab size, i.e., the number of maximum width characters.
        Returns:
        the number of maximum width chars
      • setLineWrap

        public void setLineWrap​(boolean value)
        Enables/disables line wrap.
        Parameters:
        value - if true line wrap gets enabled
      • getLineWrap

        public boolean getLineWrap()
        Returns whether line wrap is enabled.
        Returns:
        true if line wrap enabled
      • setUpdateParentTitle

        public void setUpdateParentTitle​(boolean value)
        Sets whether to update the parent's title.
        Parameters:
        value - if true the parent's title will get updated
      • getUpdateParentTitle

        public boolean getUpdateParentTitle()
        Returns whether to update the parent's title.
        Returns:
        true if to update the parent's title
      • setCanOpenFiles

        public void setCanOpenFiles​(boolean value)
        Sets whether the editor can open files.
        Parameters:
        value - if true then the editor can open files as well
      • getCanOpenFiles

        public boolean getCanOpenFiles()
        Returns whether the editor can open files.
        Returns:
        true if the editor can open files
      • open

        public void open​(File file)
        Opens the specified file using UTF-8 and loads/displays the content.
        Parameters:
        file - the file to load
        See Also:
        getCanOpenFiles()
      • open

        public void open​(File file,
                         String encoding)
        Opens the specified file and loads/displays the content.
        Parameters:
        file - the file to load
        encoding - the encoding to use, null for default UTF-8
        See Also:
        getCanOpenFiles()