Class ConsoleWindow

  • All Implemented Interfaces:
    IMainWindow

    public class ConsoleWindow
    extends java.lang.Object
    implements IMainWindow
    The main window of OmegaT application, if the program is started in consoleMode.
    • Constructor Summary

      Constructors 
      Constructor Description
      ConsoleWindow()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addDockable​(com.vlsolutions.swing.docking.Dockable pane)
      Add new dockable pane into application frame.
      void displayErrorRB​(java.lang.Throwable ex, java.lang.String errorKey, java.lang.Object... params)
      Display error.
      void displayWarningRB​(java.lang.String message, java.lang.Object... args)
      Display warning.
      void displayWarningRB​(java.lang.String message, java.lang.String supercedesKey, java.lang.Object... args)
      Same as IMainWindow.displayWarningRB(String, Object...) but this will close the previous dialog if the dialog is still open and the supplied supercedesKey matches the previous dialog's key.
      java.awt.Font getApplicationFont()
      Get main application font.
      javax.swing.JFrame getApplicationFrame()
      Get application frame.
      java.awt.Cursor getCursor()
      Retrieves current cursor of window
      com.vlsolutions.swing.docking.DockingDesktop getDesktop()
      Retrieve main docking desktop.
      IMainMenu getMainMenu()
      Retrieve main manu instance.
      void lockUI()
      Lock UI for long-term operations.
      void setCursor​(java.awt.Cursor cursor)
      Sets cursor of window
      int showConfirmDialog​(java.lang.Object message, java.lang.String title, int optionType, int messageType)
      shows a confirm dialog.
      void showErrorDialogRB​(java.lang.String title, java.lang.String message, java.lang.Object... args)
      Show message in an ErrorDialog
      void showLengthMessage​(java.lang.String messageText)
      Show message in length label.
      void showLockInsertMessage​(java.lang.String messageText, java.lang.String toolTip)
      Show message indicating the state of the Lock cursor and Insert/overwrite mode
      void showMessageDialog​(java.lang.String message)
      Shows message to user
      void showProgressMessage​(java.lang.String messageText)
      Show message in progress bar.
      void showStatusMessageRB​(java.lang.String messageKey, java.lang.Object... params)
      Show message in status bar from resource bundle by key.
      void showTimedStatusMessageRB​(java.lang.String messageKey, java.lang.Object... params)
      Same as IMainWindow.showStatusMessageRB(String, Object...) but this will clear the message after ten seconds.
      void unlockUI()
      Unlock UI after locking.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConsoleWindow

        public ConsoleWindow()
    • Method Detail

      • displayErrorRB

        public void displayErrorRB​(java.lang.Throwable ex,
                                   java.lang.String errorKey,
                                   java.lang.Object... params)
        Display error.
        Specified by:
        displayErrorRB in interface IMainWindow
        Parameters:
        ex - exception to show
        errorKey - error message key in resource bundle
        params - error text parameters
      • showStatusMessageRB

        public void showStatusMessageRB​(java.lang.String messageKey,
                                        java.lang.Object... params)
        Show message in status bar from resource bundle by key. Nothing is shown in quiet mode.
        Specified by:
        showStatusMessageRB in interface IMainWindow
        Parameters:
        messageKey - message key in resource bundle
        params - message parameters for formatting
      • displayWarningRB

        public void displayWarningRB​(java.lang.String message,
                                     java.lang.Object... args)
        Description copied from interface: IMainWindow
        Display warning.
        Specified by:
        displayWarningRB in interface IMainWindow
        Parameters:
        message - warning message key in resource bundle
        args - warning text parameters
      • displayWarningRB

        public void displayWarningRB​(java.lang.String message,
                                     java.lang.String supercedesKey,
                                     java.lang.Object... args)
        Description copied from interface: IMainWindow
        Same as IMainWindow.displayWarningRB(String, Object...) but this will close the previous dialog if the dialog is still open and the supplied supercedesKey matches the previous dialog's key.
        Specified by:
        displayWarningRB in interface IMainWindow
        Parameters:
        message - warning message key in resource bundle
        supercedesKey - the key of the warning dialog to close, if still open
        args - warning text parameters
      • showErrorDialogRB

        public void showErrorDialogRB​(java.lang.String title,
                                      java.lang.String message,
                                      java.lang.Object... args)
        Show message in an ErrorDialog
        Specified by:
        showErrorDialogRB in interface IMainWindow
        Parameters:
        title - title of dialog. message key in resource bundle of title that is to be displayed
        message - message key in resource bundle of message that is to be displayed
        args - arguments of the resource bundle message
      • addDockable

        public void addDockable​(com.vlsolutions.swing.docking.Dockable pane)
        Description copied from interface: IMainWindow
        Add new dockable pane into application frame. This method called on application startup.
        Specified by:
        addDockable in interface IMainWindow
        Parameters:
        pane - dockable pane
      • lockUI

        public void lockUI()
        Description copied from interface: IMainWindow
        Lock UI for long-term operations.
        Specified by:
        lockUI in interface IMainWindow
      • showLengthMessage

        public void showLengthMessage​(java.lang.String messageText)
        Description copied from interface: IMainWindow
        Show message in length label. Length label shows length (in nr of characters) of current segment
        Specified by:
        showLengthMessage in interface IMainWindow
        Parameters:
        messageText - message text
      • showProgressMessage

        public void showProgressMessage​(java.lang.String messageText)
        Description copied from interface: IMainWindow
        Show message in progress bar. Progress bar shows the translation progress: nr. of segments/words etc translated/to do.
        Specified by:
        showProgressMessage in interface IMainWindow
        Parameters:
        messageText - message text
      • unlockUI

        public void unlockUI()
        Description copied from interface: IMainWindow
        Unlock UI after locking.
        Specified by:
        unlockUI in interface IMainWindow
      • getDesktop

        public com.vlsolutions.swing.docking.DockingDesktop getDesktop()
        Description copied from interface: IMainWindow
        Retrieve main docking desktop.
        Specified by:
        getDesktop in interface IMainWindow
      • getCursor

        public java.awt.Cursor getCursor()
        Description copied from interface: IMainWindow
        Retrieves current cursor of window
        Specified by:
        getCursor in interface IMainWindow
        Returns:
        the current cursor
      • setCursor

        public void setCursor​(java.awt.Cursor cursor)
        Description copied from interface: IMainWindow
        Sets cursor of window
        Specified by:
        setCursor in interface IMainWindow
        Parameters:
        cursor - the new cursor
      • showConfirmDialog

        public int showConfirmDialog​(java.lang.Object message,
                                     java.lang.String title,
                                     int optionType,
                                     int messageType)
                              throws java.awt.HeadlessException
        Description copied from interface: IMainWindow
        shows a confirm dialog. For a GUI main window, this can be implemented as JOptionPane.showConfirmDialog
        Specified by:
        showConfirmDialog in interface IMainWindow
        Parameters:
        message - the Object to display
        title - the title string for the dialog (can be null)
        optionType - an integer designating the JOptionPane options available on the dialog: YES_NO_OPTION, YES_NO_CANCEL_OPTION, or OK_CANCEL_OPTION
        messageType - an integer designating the kind of message this is; primarily used to determine the icon from the pluggable Look and Feel: (JOptionPane ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
        Returns:
        an integer indicating the option selected by the user
        Throws:
        java.awt.HeadlessException - if GraphicsEnvironment.isHeadless returns true
      • showMessageDialog

        public void showMessageDialog​(java.lang.String message)
        Description copied from interface: IMainWindow
        Shows message to user
        Specified by:
        showMessageDialog in interface IMainWindow
        Parameters:
        message - the message to show
      • showLockInsertMessage

        public void showLockInsertMessage​(java.lang.String messageText,
                                          java.lang.String toolTip)
        Description copied from interface: IMainWindow
        Show message indicating the state of the Lock cursor and Insert/overwrite mode
        Specified by:
        showLockInsertMessage in interface IMainWindow
        Parameters:
        messageText - message text