Package org.omegat.gui.main
Interface IMainWindow
- All Known Implementing Classes:
ConsoleWindow,MainWindow
public interface IMainWindow
Interface for access to main window functionality.
-
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 asdisplayWarningRB(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.Get main application font.Get application frame.Retrieves current cursor of windowcom.vlsolutions.swing.docking.DockingDesktopRetrieve main docking desktop.Retrieve main manu instance.default StringvoidlockUI()Lock UI for long-term operations.default voidRestores the main window layout to the default values.default 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(@Nullable String messageKey, Object... params) Show message in status bar from resource bundle by key.voidshowTimedStatusMessageRB(String messageKey, Object... params) Same asshowStatusMessageRB(String, Object...)but this will clear the message after ten seconds.voidunlockUI()Unlock UI after locking.
-
Method Details
-
getApplicationFrame
JFrame getApplicationFrame()Get application frame. -
lockUI
void lockUI()Lock UI for long-term operations. -
unlockUI
void unlockUI()Unlock UI after locking. -
getApplicationFont
Font getApplicationFont()Get main application font. -
showStatusMessageRB
Show message in status bar from resource bundle by key.- Parameters:
messageKey- message key in resource bundleparams- message parameters for formatting
-
showTimedStatusMessageRB
Same asshowStatusMessageRB(String, Object...)but this will clear the message after ten seconds.- Parameters:
messageKey- message key in resource bundleparams- message parameters for formatting
-
showProgressMessage
Show message in progress bar. Progress bar shows the translation progress: nr. of segments/words etc translated/to do.- Parameters:
messageText- message text
-
showLengthMessage
Show message in length label. Length label shows length (in nr of characters) of current segment- Parameters:
messageText- message text
-
showLockInsertMessage
Show message indicating the state of the Lock cursor and Insert/overwrite mode- Parameters:
messageText- message text
-
displayWarningRB
Display warning.- Parameters:
warningKey- warning message key in resource bundleparams- warning text parameters
-
displayWarningRB
Same asdisplayWarningRB(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.- Parameters:
warningKey- warning message key in resource bundlesupercedesKey- the key of the warning dialog to close, if still openparams- warning text parameters
-
displayErrorRB
Display error.- Parameters:
ex- exception to showerrorKey- error message key in resource bundleparams- error text parameters
-
showErrorDialogRB
Show message in an ErrorDialog- Parameters:
message- message key in resource bundle of message that is to be displayedargs- arguments of the resource bundle messagetitle- title of dialog. message key in resource bundle of title that is to be displayed
-
showConfirmDialog
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- 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
-
showMessageDialog
Shows message to user- Parameters:
message- the message to show
-
addDockable
void addDockable(com.vlsolutions.swing.docking.Dockable pane) Add new dockable pane into application frame. This method called on application startup.- Parameters:
pane- dockable pane
-
setCursor
Sets cursor of window- Parameters:
cursor- the new cursor
-
getCursor
Cursor getCursor()Retrieves current cursor of window- Returns:
- the current cursor
-
getSelectedText
-
getMainMenu
IMainMenu getMainMenu()Retrieve main manu instance. -
getDesktop
com.vlsolutions.swing.docking.DockingDesktop getDesktop()Retrieve main docking desktop. -
resetDesktopLayout
default void resetDesktopLayout()Restores the main window layout to the default values. -
saveDesktopLayout
default void saveDesktopLayout()Save the main window layout.
-