Package org.omegat.gui.main
Class MainWindow
java.lang.Object
org.omegat.gui.main.MainWindow
- All Implemented Interfaces:
IMainWindow
The main window of OmegaT application (unless the application is started in
consoleMode).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDockable(com.vlsolutions.swing.docking.Dockable pane) Add new dockable pane into application frame.voiddisplayErrorRB(Throwable ex, String errorKey, Object... params) Display error.voiddisplayWarningRB(String warningKey, Object... params) Display warning.voiddisplayWarningRB(String warningKey, String supercedesKey, Object... params) Same asIMainWindow.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.static voidinsert current fuzzy match or selection at cursor positionstatic voidreplace entire edit area with active fuzzy match or selectionGet main application font.Get application frame.Retrieves current cursor of windowcom.vlsolutions.swing.docking.DockingDesktopRetrieve main docking desktop.Retrieve main manu instance.voidlockUI()Lock UI for long-term operations.voidRestores the main window layout to the default values.voidSave the main window layout.voidSets cursor of windowintshowConfirmDialog(Object message, String title, int optionType, int messageType) shows a confirm dialog.voidshowErrorDialogRB(String title, String message, Object... args) Show message in an ErrorDialogvoidshowLengthMessage(String messageText) Show message in length label.voidshowLockInsertMessage(String messageText, String toolTip) Show message indicating the state of the Lock cursor and Insert/overwrite modevoidshowMessageDialog(String message) Shows message to uservoidshowProgressMessage(String messageText) Show message in progress bar.voidshowStatusMessageRB(String messageKey, Object... params) Show message in status bar from resource bundle by key.voidshowTimedStatusMessageRB(String messageKey, Object... params) Same asIMainWindow.showStatusMessageRB(String, Object...)but this will clear the message after ten seconds.voidunlockUI()Unlock UI after locking.
-
Field Details
-
Constructor Details
-
MainWindow
Creates new form MainWindow- Throws:
IOException
-
-
Method Details
-
resetDesktopLayout
public void resetDesktopLayout()Description copied from interface:IMainWindowRestores the main window layout to the default values.- Specified by:
resetDesktopLayoutin interfaceIMainWindow
-
saveDesktopLayout
public void saveDesktopLayout()Description copied from interface:IMainWindowSave the main window layout.- Specified by:
saveDesktopLayoutin interfaceIMainWindow
-
getApplicationFrame
Description copied from interface:IMainWindowGet application frame.- Specified by:
getApplicationFramein interfaceIMainWindow
-
getApplicationFont
Description copied from interface:IMainWindowGet main application font.- Specified by:
getApplicationFontin interfaceIMainWindow
-
getMainMenu
Description copied from interface:IMainWindowRetrieve main manu instance.- Specified by:
getMainMenuin interfaceIMainWindow
-
addDockable
public void addDockable(com.vlsolutions.swing.docking.Dockable pane) Description copied from interface:IMainWindowAdd new dockable pane into application frame. This method called on application startup.- Specified by:
addDockablein interfaceIMainWindow- Parameters:
pane- dockable pane
-
setCursor
Description copied from interface:IMainWindowSets cursor of window- Specified by:
setCursorin interfaceIMainWindow- Parameters:
cursor- the new cursor
-
getCursor
Description copied from interface:IMainWindowRetrieves current cursor of window- Specified by:
getCursorin interfaceIMainWindow- Returns:
- the current cursor
-
getSelectedText
- Specified by:
getSelectedTextin interfaceIMainWindow
-
doInsertTrans
public static void doInsertTrans()insert current fuzzy match or selection at cursor position -
doRecycleTrans
public static void doRecycleTrans()replace entire edit area with active fuzzy match or selection -
showStatusMessageRB
Description copied from interface:IMainWindowShow message in status bar from resource bundle by key.- Specified by:
showStatusMessageRBin interfaceIMainWindow- Parameters:
messageKey- message key in resource bundleparams- message parameters for formatting
-
showTimedStatusMessageRB
Description copied from interface:IMainWindowSame asIMainWindow.showStatusMessageRB(String, Object...)but this will clear the message after ten seconds.- Specified by:
showTimedStatusMessageRBin interfaceIMainWindow- Parameters:
messageKey- message key in resource bundleparams- message parameters for formatting
-
showProgressMessage
Description copied from interface:IMainWindowShow message in progress bar. Progress bar shows the translation progress: nr. of segments/words etc translated/to do.- Specified by:
showProgressMessagein interfaceIMainWindow- Parameters:
messageText- message text
-
showLengthMessage
Description copied from interface:IMainWindowShow message in length label. Length label shows length (in nr of characters) of current segment- Specified by:
showLengthMessagein interfaceIMainWindow- Parameters:
messageText- message text
-
showLockInsertMessage
Description copied from interface:IMainWindowShow message indicating the state of the Lock cursor and Insert/overwrite mode- Specified by:
showLockInsertMessagein interfaceIMainWindow- Parameters:
messageText- message text
-
displayWarningRB
Description copied from interface:IMainWindowDisplay warning.- Specified by:
displayWarningRBin interfaceIMainWindow- Parameters:
warningKey- warning message key in resource bundleparams- warning text parameters
-
displayWarningRB
Description copied from interface:IMainWindowSame asIMainWindow.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:
displayWarningRBin interfaceIMainWindow- Parameters:
warningKey- warning message key in resource bundlesupercedesKey- the key of the warning dialog to close, if still openparams- warning text parameters
-
displayErrorRB
Description copied from interface:IMainWindowDisplay error.- Specified by:
displayErrorRBin interfaceIMainWindow- Parameters:
ex- exception to showerrorKey- error message key in resource bundleparams- error text parameters
-
lockUI
public void lockUI()Description copied from interface:IMainWindowLock UI for long-term operations.- Specified by:
lockUIin interfaceIMainWindow
-
unlockUI
public void unlockUI()Description copied from interface:IMainWindowUnlock UI after locking.- Specified by:
unlockUIin interfaceIMainWindow
-
showErrorDialogRB
Description copied from interface:IMainWindowShow message in an ErrorDialog- Specified by:
showErrorDialogRBin interfaceIMainWindow- Parameters:
title- title of dialog. message key in resource bundle of title that is to be displayedmessage- message key in resource bundle of message that is to be displayedargs- arguments of the resource bundle message
-
showConfirmDialog
public int showConfirmDialog(Object message, String title, int optionType, int messageType) throws HeadlessException shows a confirm dialog. For a GUI main window, this can be implemented as JOptionPane.showConfirmDialog- Specified by:
showConfirmDialogin interfaceIMainWindow- Parameters:
message- the Object to displaytitle- 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_OPTIONmessageType- 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:
HeadlessException- if GraphicsEnvironment.isHeadless returns true- See Also:
-
showMessageDialog
Description copied from interface:IMainWindowShows message to user- Specified by:
showMessageDialogin interfaceIMainWindow- Parameters:
message- the message to show
-
getDesktop
public com.vlsolutions.swing.docking.DockingDesktop getDesktop()Description copied from interface:IMainWindowRetrieve main docking desktop.- Specified by:
getDesktopin interfaceIMainWindow
-