Package com.nomagic.magicdraw.core
Class GUILog
- java.lang.Object
-
- com.nomagic.magicdraw.core.GUILog
-
@OpenApiAll public class GUILog extends java.lang.ObjectUtility class for displaying messages, questions, warnings and dialogs. It also used to output some text into Message Window.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGUILog.DefaultURLActionHandlerDefault implementation for URLActionHandlerstatic interfaceGUILog.URLActionHandlerAn URL handler
-
Field Summary
Fields Modifier and Type Field Description private static com.nomagic.magicdraw.ui.dialogs.OutOfMemoryDlgmOutOfMemoryDialogUsed for out of memory error displaying.private static byte[]TEMPUsed for out of memory handling.
-
Constructor Summary
Constructors Modifier Constructor Description protectedGUILog()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddHyperlinkedText(java.lang.String text, java.util.Map<java.lang.String,java.lang.Runnable> callbacks)Display text with hyperlinks.static java.util.Map<java.lang.String,java.lang.Runnable>addURLCallBack(java.util.Map<java.lang.String,java.lang.Runnable> map, java.lang.String string, java.lang.String href)Adds callback to open href to the map.voidclearLog()Clear message window.voidclearMessageWindow()Clear message window.static java.lang.StringcreateActionURL(NMAction action)An utility method to create URL to some action.static java.lang.StringcreateActionURLWithText(NMAction action)An utility method to create URL to some action withstatic java.lang.StringcreateActionURLWithText(NMAction action, java.lang.String text)An utility method to create URL to some action withprivate static Notification.ContextgetContext()private static java.awt.WindowgetDialogOwner()java.lang.StringgetLoggedMessages()An utility method get all logged messages (This GUILog class provides a method to get the LogDialog, but the LogDialog is not part of the OpenAPI and therefore not accessible by code that will want to use it.)private com.nomagic.magicdraw.ui.dialogs.OutOfMemoryDlggetOutOfMemoryDialog()voidlog(Notification notification, boolean openWindow)Logs notificationvoidlog(java.lang.String msg)Writes message to message window.voidlog(java.lang.String msg, boolean open)Writes message to log window.voidlogNotification(java.lang.String text, NotificationSeverity severity, Notification.Context context)Logs notificationvoidlogNotification(java.lang.String title, java.lang.String text, HRefRunnable[] actions, NotificationSeverity severity, Notification.Context context)Logs notificationvoidlogNotification(java.lang.String title, java.lang.String text, NotificationSeverity severity, Notification.Context context)Logs notificationvoidopenLog()Opens message window.voidopenMessageWindow()Opens message window.booleanshowCustomizedQuestion(java.lang.String msg, java.lang.String okLabelKey, java.lang.String cancelLabelKey, java.lang.String title, java.lang.String icon)Show customized Cancel/Ok question in a model dialogvoidshowError(java.awt.Dialog parent, java.lang.String msg)Method shows Error dialog.voidshowError(java.awt.Dialog parent, java.lang.String message, java.lang.Throwable throwable)Method shows Error and stack trace dialogvoidshowError(java.awt.Frame parent, java.lang.String msg)Method shows Error dialog.voidshowError(java.awt.Frame parent, java.lang.String msg, java.lang.String title)Shows error dialogvoidshowError(java.awt.Frame parent, java.lang.String message, java.lang.Throwable throwable)Method shows Error and stack trace dialog.voidshowError(java.awt.Window parent, java.lang.String msg)Method shows Error dialog.voidshowError(java.awt.Window parent, java.lang.String msg, java.lang.String title)Shows error dialogvoidshowError(java.awt.Window parent, java.lang.String message, java.lang.Throwable exc)Method shows Error and stack trace dialog.voidshowError(java.lang.String msg)Shows the error dialog with given messagevoidshowError(java.lang.String msg, java.lang.String title)Shows the error dialog with given message and titlevoidshowError(java.lang.String message, java.lang.Throwable throwable)Method shows Error and stack trace dialogprivate static intshowErrorDialogWithRetryButton(java.lang.String message, java.lang.String title, java.lang.Throwable throwable, java.lang.String[] buttonLabels)voidshowErrorWithHelp(java.lang.String message, java.lang.String helpID)Shows the error dialog with given message.intshowErrorWithRetry(java.lang.String message, java.lang.String title, java.lang.Throwable exp)Method shows Error and stack trace dialog with Submit, Export, Cancel and Retry buttons.intshowErrorWithRetryButtonAsTheDefault(java.lang.String message, java.lang.String title, java.lang.Throwable exp)Method shows Error and stack trace dialog with theRetrybutton being the default and the first one in the array of buttons.voidshowHTMLError(java.awt.Frame parent, java.lang.String message, java.lang.Throwable throwable)Method shows Error as html text and stack trace dialogvoidshowHTMLError(java.awt.Window parent, java.lang.String message, java.lang.Throwable throwable)Method shows Error as html text and stack trace dialogvoidshowHTMLError(java.lang.String message, java.lang.Throwable throwable)Method shows Error as html text and stack trace dialogvoidshowHTMLMessage(java.lang.String msg, GUILog.URLActionHandler handler)Shows the message dialog with given message.voidshowHTMLMessage(java.lang.String msg, java.lang.String helpID, GUILog.URLActionHandler handler)Shows the message dialog with given message.voidshowHTMLMessage(java.lang.String msg, java.lang.String title, java.lang.String helpID, GUILog.URLActionHandler handler)Shows the message dialog with given message.voidshowHTMLMessage(java.lang.String msg, java.lang.String title, java.lang.String helpID, GUILog.URLActionHandler handler, java.lang.String icon)Shows the message dialog with given message.intshowHTMLQuestion(java.lang.String msg, java.lang.String yesLabel, java.lang.String noLabel, java.lang.String cancelLabel, java.lang.String title, java.lang.String icon)Shows html dialogs with given button textstatic java.lang.StringshowInputTextDialog(java.lang.String title, java.lang.String message)Show dialog for text input.voidshowMessage(java.awt.Dialog parent, java.lang.String msg)Shows the message dialog with the given message.voidshowMessage(java.awt.Window parent, java.lang.String msg)Shows the message dialog with the given message.voidshowMessage(java.lang.String msg)Shows the message dialog with given message.voidshowMessage(java.lang.String msg, java.lang.String helpID)Shows the message dialog with the given message.booleanshowMessage(java.lang.String msg, java.lang.String checkBoxMsg, boolean checkBoxValue)Shows the message dialog with given message.voidshowMessage(java.lang.String msg, java.lang.String title, java.lang.String helpID)Shows the message dialog with given message.voidshowMessage(java.lang.String msg, java.lang.String title, java.lang.String helpID, java.lang.String icon)Shows the message dialog with given message.voidshowMessageWithShowNextTime(java.lang.String msg, java.lang.String property_id)Shows the message dialog with given message and with label to show next time.voidshowOutOfMemoryError(java.lang.String message)Display out of memory error.booleanshowQuestion(java.lang.String msg)Shows the yes-no dialog dialog with given message.intshowQuestion(java.lang.String msg, boolean cancel)Shows the yes-no dialog dialog with given message.intshowQuestion(java.lang.String msg, boolean cancel, java.lang.String dialogTitle)Shows the yes-no dialog with given message.intshowQuestion(java.lang.String msg, boolean cancel, java.lang.String dialogTitle, java.lang.String defaultAction)Shows the yes-no dialog with given message.booleanshowQuestion(java.lang.String msg, java.lang.String helpID)Shows the yes-no-help dialog dialog with given message.intshowQuestion(java.lang.String msg, java.lang.String yesLabel, java.lang.String noLabel, java.lang.String cancelLabel, java.lang.String icon)Shows dialogs with given button textintshowQuestion(java.lang.String msg, java.lang.String yesLabel, java.lang.String noLabel, java.lang.String cancelLabel, java.lang.String title, java.lang.String icon)Shows dialogs with given button textintshowQuestionForAll(java.lang.String msg)Shows the yes-no-all dialog dialog with given message.intshowQuestionForAll(java.lang.String msg, boolean cancel)Shows the yes-no-all dialog dialog with given message.intshowQuestionForAll(java.lang.String msg, boolean yesToAll, boolean cancel)Shows the yes-no-all dialog dialog with given message.booleanshowQuestionOkCancel(java.lang.String msg)Shows the ok-cancel dialog dialog with given message.booleanshowQuestionWithHelp(java.lang.String msg, java.lang.String okLabelKey, java.lang.String title, java.lang.String helpID)Show customized Ok/Cancel/Help question in a modal dialog.booleanshowQuestionWithHelp(java.lang.String msg, java.lang.String notificationMsg, java.lang.String okLabelKey, java.lang.String title, java.lang.String helpID)Show customized Ok/Cancel/Help question in a modal dialog.intshowRetryQuestion(java.lang.String msg)Shows the yes-no dialog dialog with given messagevoidshowWarning(java.lang.String msg)Shows the warning dialog with given message.voidshowWarning(java.lang.String msg, java.lang.String title)Shows the warning dialog with given message and title.booleanshowWarning(java.lang.String msg, java.lang.String checkBoxMsg, boolean checkBoxValue)Shows the warning dialog with given message.voidshowWarning(java.lang.String msg, java.lang.String title, java.lang.String okLabelKey)Shows the warning dialog with given message, title and button.booleanshowWarningQuestion(java.lang.String msg, java.lang.String okLabelKey, java.lang.String title)Show customized Cancel/Ok question in a modal dialog.booleanshowWarningQuestion(java.lang.String msg, java.lang.String okLabelKey, java.lang.String cancelLabelKey, java.lang.String title)Show customized Cancel/Ok question in a model dialogbooleanshowYesNoHelp(java.lang.String msg, java.lang.String helpID, java.lang.String title, java.lang.String icon)Shows the yes-no-help dialog with given message.static java.lang.StringwrapForHeyperlinkText(java.lang.String text)Deprecated.Misspelled - usewrapForHyperlinkText(String)static java.lang.StringwrapForHyperlinkText(java.lang.String str)Helper method to wrap given string into string suitable to use for hyperlinked log.voidwriteLogText(java.lang.String msg, boolean open)Writes message to log window.
-
-
-
Method Detail
-
showError
public void showError(@CheckForNull java.awt.Dialog parent, java.lang.String msg)Method shows Error dialog.- Parameters:
parent- parent of error dialogmsg- Error message
-
showError
public void showError(@CheckForNull java.awt.Frame parent, java.lang.String msg)Method shows Error dialog.- Parameters:
parent- parent of error dialogmsg- Error message
-
showError
public void showError(@CheckForNull java.awt.Window parent, java.lang.String msg)Method shows Error dialog.- Parameters:
parent- parent of error dialogmsg- Error message
-
showError
public void showError(@CheckForNull java.awt.Frame parent, java.lang.String msg, java.lang.String title)Shows error dialog- Parameters:
parent- the parent of error dialogmsg- the error messagetitle- the dialog title
-
showError
public void showError(@CheckForNull java.awt.Window parent, java.lang.String msg, java.lang.String title)Shows error dialog- Parameters:
parent- the parent of error dialogmsg- the error messagetitle- the dialog title
-
showError
public void showError(@CheckForNull java.awt.Frame parent, java.lang.String message, java.lang.Throwable throwable)Method shows Error and stack trace dialog.- Parameters:
parent- parent of error dialogmessage- error messagethrowable- throwable provides stack trace to display
-
showError
public void showError(java.awt.Dialog parent, java.lang.String message, @CheckForNull java.lang.Throwable throwable)Method shows Error and stack trace dialog- Parameters:
parent- parent of error dialogmessage- error messagethrowable- throwable provides stack trace to display
-
showError
public void showError(@CheckForNull java.awt.Window parent, java.lang.String message, @CheckForNull java.lang.Throwable exc)Method shows Error and stack trace dialog.- Parameters:
parent- parent of error dialogmessage- error messageexc- throwable provides stack trace to display
-
showError
public void showError(java.lang.String msg)
Shows the error dialog with given message- Parameters:
msg- error message
-
showError
public void showError(java.lang.String msg, java.lang.String title)Shows the error dialog with given message and title- Parameters:
msg- error messagetitle- the dialog title
-
showError
public void showError(java.lang.String message, @CheckForNull java.lang.Throwable throwable)Method shows Error and stack trace dialog- Parameters:
message- error message.throwable- throwable provides stack trace to display
-
showHTMLError
public void showHTMLError(java.lang.String message, @CheckForNull java.lang.Throwable throwable)Method shows Error as html text and stack trace dialog- Parameters:
message- error messagethrowable- throwable provides stack trace to display
-
showHTMLError
public void showHTMLError(@CheckForNull java.awt.Frame parent, java.lang.String message, java.lang.Throwable throwable)Method shows Error as html text and stack trace dialog- Parameters:
parent- parent of error dialogmessage- error messagethrowable- throwable provides stack trace to display
-
showHTMLError
public void showHTMLError(@CheckForNull java.awt.Window parent, java.lang.String message, @CheckForNull java.lang.Throwable throwable)Method shows Error as html text and stack trace dialog- Parameters:
parent- parent of error dialogmessage- error messagethrowable- throwable provides stack trace to display
-
showErrorWithRetry
public int showErrorWithRetry(java.lang.String message, java.lang.String title, java.lang.Throwable exp)Method shows Error and stack trace dialog with Submit, Export, Cancel and Retry buttons. If Retry button is pressed then method returnsDialogConstants.OK, if Cancel -DialogConstants.CANCEL.- Parameters:
message- error messagetitle- dialog titleexp- throwable provides stack trace to display- Returns:
- pressed button identifier
-
showErrorWithRetryButtonAsTheDefault
public int showErrorWithRetryButtonAsTheDefault(java.lang.String message, java.lang.String title, java.lang.Throwable exp)Method shows Error and stack trace dialog with theRetrybutton being the default and the first one in the array of buttons. IfRetrybutton is pressed then method returnsDialogConstants.OK, ifCancel-DialogConstants.CANCEL.- Parameters:
message- error messagetitle- dialog titleexp- stack trace to display- Returns:
- pressed button identifier
-
showMessage
public void showMessage(java.lang.String msg)
Shows the message dialog with given message.- Parameters:
msg- message text
-
showHTMLMessage
public void showHTMLMessage(java.lang.String msg, @CheckForNull GUILog.URLActionHandler handler)Shows the message dialog with given message.- Parameters:
msg- message texthandler- handler
-
showMessage
public void showMessage(java.lang.String msg, @CheckForNull java.lang.String helpID)Shows the message dialog with the given message.- Parameters:
msg- message texthelpID- help item ID in help system
-
showHTMLMessage
public void showHTMLMessage(java.lang.String msg, @CheckForNull java.lang.String helpID, @CheckForNull GUILog.URLActionHandler handler)Shows the message dialog with given message.- Parameters:
msg- message text.helpID- help item ID in help systemhandler- handler
-
showMessage
public void showMessage(java.lang.String msg, java.lang.String title, @CheckForNull java.lang.String helpID, java.lang.String icon)Shows the message dialog with given message.- Parameters:
msg- message texttitle- title of the dialoghelpID- help item ID in help systemicon- path to icon image (for example "/com/company/icon.gif")
-
showMessage
public void showMessage(java.lang.String msg, java.lang.String title, @CheckForNull java.lang.String helpID)Shows the message dialog with given message.- Parameters:
msg- message texttitle- title of the dialoghelpID- help item ID in help system
-
showHTMLMessage
public void showHTMLMessage(java.lang.String msg, java.lang.String title, @CheckForNull java.lang.String helpID, @CheckForNull GUILog.URLActionHandler handler)Shows the message dialog with given message.- Parameters:
msg- message text.title- title of the dialog.helpID- help item ID in help systemhandler- url action handler
-
showHTMLMessage
public void showHTMLMessage(java.lang.String msg, java.lang.String title, @CheckForNull java.lang.String helpID, @CheckForNull GUILog.URLActionHandler handler, java.lang.String icon)Shows the message dialog with given message.- Parameters:
msg- message texttitle- title of the dialoghelpID- help item ID in help systemhandler- url action handlericon- path to icon image (for example "/com/company/icon.gif")
-
showMessage
public boolean showMessage(java.lang.String msg, java.lang.String checkBoxMsg, boolean checkBoxValue)Shows the message dialog with given message. Shows another message with a checkbox before like "Show next time" option.- Parameters:
msg- message text.checkBoxMsg- check box messagecheckBoxValue- check box state- Returns:
- check box state
-
showMessage
public void showMessage(java.awt.Dialog parent, java.lang.String msg)Shows the message dialog with the given message.- Parameters:
parent- dialog parentmsg- message text
-
showMessage
public void showMessage(java.awt.Window parent, java.lang.String msg)Shows the message dialog with the given message.- Parameters:
parent- dialog parentmsg- message text
-
showMessageWithShowNextTime
public void showMessageWithShowNextTime(java.lang.String msg, java.lang.String property_id)Shows the message dialog with given message and with label to show next time.- Parameters:
msg- message textproperty_id- registered invisible property id in the GeneralOptions with default value true- See Also:
GeneralOptionsGroup
-
showQuestion
public boolean showQuestion(java.lang.String msg)
Shows the yes-no dialog dialog with given message.- Parameters:
msg- message of question.- Returns:
- true if answer was yes.
-
showQuestion
public int showQuestion(java.lang.String msg, boolean cancel)Shows the yes-no dialog dialog with given message.- Parameters:
cancel- true if cancel button neededmsg- message of question.- Returns:
- result constant form DialogConstants.
- See Also:
DialogConstants
-
showInputTextDialog
public static java.lang.String showInputTextDialog(java.lang.String title, java.lang.String message)Show dialog for text input.- Parameters:
title- dialog title.message- message to show in dialog.- Returns:
- entered text.
-
showQuestion
public int showQuestion(java.lang.String msg, boolean cancel, java.lang.String dialogTitle)Shows the yes-no dialog with given message.- Parameters:
cancel- true if cancel button needed.msg- message of question.dialogTitle- title of the dialog.- Returns:
- result constant form DialogConstants.
- See Also:
DialogConstants
-
showQuestion
public int showQuestion(java.lang.String msg, boolean cancel, java.lang.String dialogTitle, @CheckForNull java.lang.String defaultAction)Shows the yes-no dialog with given message.- Parameters:
cancel- true if cancel button needed.msg- message of question.dialogTitle- title of the dialog.defaultAction- default selected action (button) in the question dialog.- Returns:
- result constant form DialogConstants.
- See Also:
DialogConstants
-
showQuestion
public int showQuestion(java.lang.String msg, java.lang.String yesLabel, java.lang.String noLabel, @CheckForNull java.lang.String cancelLabel, java.lang.String icon)Shows dialogs with given button text- Parameters:
msg- message of question.yesLabel- label key in dialog resources used instead of "Yes" text.noLabel- label key in dialog resources used instead of "No" text.cancelLabel- label key in dialog resources used instead of "Cancel" text, can be null.icon- path to icon image (for example "/com/company/icon.gif")- Returns:
- result constant form DialogConstants.
- See Also:
DialogConstants
-
showQuestion
public int showQuestion(java.lang.String msg, java.lang.String yesLabel, java.lang.String noLabel, @CheckForNull java.lang.String cancelLabel, java.lang.String title, java.lang.String icon)Shows dialogs with given button text- Parameters:
msg- message of question.yesLabel- label key in dialog resources used instead of "Yes" text.noLabel- label key in dialog resources used instead of "No" text.cancelLabel- label key in dialog resources used instead of "Cancel" text, can be null.title- title of the dialog.icon- path to icon image (for example "/com/company/icon.gif")- Returns:
- result constant form DialogConstants.
- See Also:
DialogConstants
-
showHTMLQuestion
public int showHTMLQuestion(java.lang.String msg, java.lang.String yesLabel, java.lang.String noLabel, @CheckForNull java.lang.String cancelLabel, java.lang.String title, java.lang.String icon)Shows html dialogs with given button text- Parameters:
msg- message of question.yesLabel- label key in dialog resources used instead of "Yes" text.noLabel- label key in dialog resources used instead of "No" text.cancelLabel- label key in dialog resources used instead of "Cancel" text, can be null.title- title of the dialog.icon- path to icon image (for example "/com/company/icon.gif")- Returns:
- result constant form DialogConstants.
- See Also:
DialogConstants
-
showQuestionOkCancel
public boolean showQuestionOkCancel(java.lang.String msg)
Shows the ok-cancel dialog dialog with given message.- Parameters:
msg- message of question.- Returns:
- result constant form DialogConstants.
- See Also:
DialogConstants
-
showQuestion
public boolean showQuestion(java.lang.String msg, java.lang.String helpID)Shows the yes-no-help dialog dialog with given message.- Parameters:
msg- message of question.helpID- help item ID in help system- Returns:
- true if answer was yes.
-
showYesNoHelp
public boolean showYesNoHelp(java.lang.String msg, java.lang.String helpID, java.lang.String title, java.lang.String icon)Shows the yes-no-help dialog with given message.- Parameters:
msg- message of question.helpID- help item ID in help systemtitle- titleicon- path to icon image (for example "/com/company/icon.gif")- Returns:
- true if answer was yes.
-
showQuestionForAll
public int showQuestionForAll(java.lang.String msg)
Shows the yes-no-all dialog dialog with given message.- Parameters:
msg- message text.- Returns:
- result constant form DialogConstants.
- See Also:
DialogConstants
-
showQuestionForAll
public int showQuestionForAll(java.lang.String msg, boolean cancel)Shows the yes-no-all dialog dialog with given message.- Parameters:
msg- messagecancel- true if cancel button needed- Returns:
- one of the result constants in DialogConstants.
- See Also:
DialogConstants
-
showQuestionForAll
public int showQuestionForAll(java.lang.String msg, boolean yesToAll, boolean cancel)Shows the yes-no-all dialog dialog with given message.- Parameters:
msg- messageyesToAll- true if Yes to ALL button neededcancel- true if cancel button needed- Returns:
- one of the result constants in DialogConstants.
- See Also:
DialogConstants
-
showRetryQuestion
public int showRetryQuestion(java.lang.String msg)
Shows the yes-no dialog dialog with given message- Parameters:
msg- Message Text- Returns:
- one of the result constants in DialogConstants.
- See Also:
DialogConstants
-
showWarning
public void showWarning(java.lang.String msg)
Shows the warning dialog with given message.- Parameters:
msg- warning text.
-
showWarning
public void showWarning(java.lang.String msg, java.lang.String title)Shows the warning dialog with given message and title.- Parameters:
msg- warning text.title- warning title
-
showWarning
public void showWarning(java.lang.String msg, java.lang.String title, java.lang.String okLabelKey)Shows the warning dialog with given message, title and button.- Parameters:
msg- warning text.title- warning titleokLabelKey- button label
-
showWarning
public boolean showWarning(java.lang.String msg, java.lang.String checkBoxMsg, boolean checkBoxValue)Shows the warning dialog with given message. Shows another message with a checkbox before like "Show next time" option.- Parameters:
msg- message text.checkBoxMsg- check box messagecheckBoxValue- check box state- Returns:
- check box state
-
log
public void log(Notification notification, boolean openWindow)
Logs notification- Parameters:
notification- notificationopenWindow- flag, if true opens notification window
-
logNotification
public void logNotification(@CheckForNull java.lang.String text, NotificationSeverity severity, Notification.Context context)Logs notification- Parameters:
text- notification textseverity- notification severitycontext- notification context
-
logNotification
public void logNotification(@CheckForNull java.lang.String title, @CheckForNull java.lang.String text, NotificationSeverity severity, Notification.Context context)Logs notification- Parameters:
title- notification titletext- notification textseverity- notification severitycontext- notification context
-
logNotification
public void logNotification(@CheckForNull java.lang.String title, @CheckForNull java.lang.String text, @CheckForNull HRefRunnable[] actions, NotificationSeverity severity, Notification.Context context)Logs notification- Parameters:
title- notification titletext- notification textseverity- notification severityactions- list of actionscontext- notification context
-
openMessageWindow
public void openMessageWindow()
Opens message window.
-
openLog
public void openLog()
Opens message window.
-
clearLog
public void clearLog()
Clear message window.
-
clearMessageWindow
public void clearMessageWindow()
Clear message window.
-
log
public void log(java.lang.String msg)
Writes message to message window.- Parameters:
msg- message text.
-
log
public void log(java.lang.String msg, boolean open)Writes message to log window.- Parameters:
msg- message text.open- true if closed window should be reopened.
-
getContext
private static Notification.Context getContext()
-
writeLogText
public void writeLogText(java.lang.String msg, boolean open)Writes message to log window.- Parameters:
msg- message text.open- true if closed window should be reopened.
-
showOutOfMemoryError
public void showOutOfMemoryError(java.lang.String message)
Display out of memory error.- Parameters:
message- message
-
getOutOfMemoryDialog
private com.nomagic.magicdraw.ui.dialogs.OutOfMemoryDlg getOutOfMemoryDialog()
-
showErrorWithHelp
public void showErrorWithHelp(java.lang.String message, java.lang.String helpID)Shows the error dialog with given message.- Parameters:
message- message texthelpID- help item ID in help system
-
addHyperlinkedText
public void addHyperlinkedText(java.lang.String text, java.util.Map<java.lang.String,java.lang.Runnable> callbacks)Display text with hyperlinks. Each hyperlink must have entry in callback. Hyperlink in the text must be surrounded by <A> </A> tags. Callback is taken from the parameter callbacks using hyperlink text as key.- Parameters:
text- text with hyperlinks for example "Best modeling <A>hyperlink text to display</A> tool." text can contain any number of href.callbacks- map where is mapped hyperlinked text to the callback runnable. Map must contain String key and Runnable value.- See Also:
wrapForHyperlinkText(String)
-
wrapForHyperlinkText
public static java.lang.String wrapForHyperlinkText(java.lang.String str)
Helper method to wrap given string into string suitable to use for hyperlinked log. Simply wrap with <A></A> tags- Parameters:
str- target string for hyperlink- Returns:
- string wrapped into <A></A>
- See Also:
addHyperlinkedText(String, java.util.Map)
-
wrapForHeyperlinkText
@Deprecated public static java.lang.String wrapForHeyperlinkText(java.lang.String text)
Deprecated.Misspelled - usewrapForHyperlinkText(String)Wrap text for hyperlink- Parameters:
text- text to wrap- Returns:
- wrapped text
-
addURLCallBack
public static java.util.Map<java.lang.String,java.lang.Runnable> addURLCallBack(@CheckForNull java.util.Map<java.lang.String,java.lang.Runnable> map, java.lang.String string, java.lang.String href)Adds callback to open href to the map. call back is used inaddHyperlinkedText(String, Map)- Parameters:
map- map to which callback isstring- text fragment which is hyper linkhref- reference- Returns:
- map with url call backs
-
createActionURL
public static java.lang.String createActionURL(@Nonnull NMAction action)An utility method to create URL to some action.- Parameters:
action- action- Returns:
- url to this action
-
createActionURLWithText
public static java.lang.String createActionURLWithText(NMAction action)
An utility method to create URL to some action with- Parameters:
action- action- Returns:
- url to this action
-
createActionURLWithText
public static java.lang.String createActionURLWithText(NMAction action, java.lang.String text)
An utility method to create URL to some action with- Parameters:
action- actiontext- url text- Returns:
- url to this action
-
getLoggedMessages
public java.lang.String getLoggedMessages()
An utility method get all logged messages (This GUILog class provides a method to get the LogDialog, but the LogDialog is not part of the OpenAPI and therefore not accessible by code that will want to use it.)- Returns:
- the messages visible in the LogDialog
-
showQuestionWithHelp
public boolean showQuestionWithHelp(java.lang.String msg, @CheckForNull java.lang.String notificationMsg, java.lang.String okLabelKey, java.lang.String title, java.lang.String helpID)Show customized Ok/Cancel/Help question in a modal dialog.- Parameters:
msg- message to shownotificationMsg- notification message to show if silent mode is onokLabelKey- label key in DialogResource.properties for the Ok buttontitle- dialog titlehelpID- help item ID in help system- Returns:
- true - if Ok was pressed, false - if cancel.
-
showQuestionWithHelp
public boolean showQuestionWithHelp(java.lang.String msg, java.lang.String okLabelKey, java.lang.String title, java.lang.String helpID)Show customized Ok/Cancel/Help question in a modal dialog.- Parameters:
msg- message to showokLabelKey- label key in DialogResource.properties for the Ok buttontitle- dialog titlehelpID- help item ID in help system- Returns:
- true - if Ok was pressed, false - if cancel.
-
showWarningQuestion
public boolean showWarningQuestion(java.lang.String msg, java.lang.String okLabelKey, java.lang.String title)Show customized Cancel/Ok question in a modal dialog.- Parameters:
msg- message to showokLabelKey- label key in DialogResource.properties for the Ok buttontitle- dialog title- Returns:
- true - if Ok was pressed, false - if cancel.
-
showWarningQuestion
public boolean showWarningQuestion(java.lang.String msg, java.lang.String okLabelKey, java.lang.String cancelLabelKey, java.lang.String title)Show customized Cancel/Ok question in a model dialog- Parameters:
msg- the message to showokLabelKey- the label key in DialogResource.properties for the Ok buttoncancelLabelKey- the label key in DialogResource.properties for the Cancel buttontitle- the dialog title- Returns:
trueif Ok was pressed,falseotherwise
-
showCustomizedQuestion
public boolean showCustomizedQuestion(java.lang.String msg, java.lang.String okLabelKey, java.lang.String cancelLabelKey, java.lang.String title, java.lang.String icon)Show customized Cancel/Ok question in a model dialog- Parameters:
msg- the message to showokLabelKey- the label key in DialogResource.properties for the Ok buttoncancelLabelKey- the label key in DialogResource.properties for the Cancel buttontitle- the dialog titleicon- the dialog icon- Returns:
trueif Ok was pressed,falseotherwise
-
showErrorDialogWithRetryButton
private static int showErrorDialogWithRetryButton(java.lang.String message, java.lang.String title, java.lang.Throwable throwable, java.lang.String[] buttonLabels)
-
getDialogOwner
@CheckForNull private static java.awt.Window getDialogOwner()
-
-