Package com.nomagic.magicdraw.ui.dialogs
Class MDDialogParentProvider
- java.lang.Object
-
- com.nomagic.magicdraw.ui.dialogs.MDDialogParentProvider
-
- All Implemented Interfaces:
DialogParentProvider
@OpenApiAll public final class MDDialogParentProvider extends java.lang.Object implements DialogParentProvider
Parent provider for the dialogs used in MagicDraw
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.Window
dialogOwner
private java.awt.Frame
fakeParent
private static MDDialogParentProvider
instance
-
Constructor Summary
Constructors Modifier Constructor Description private
MDDialogParentProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.awt.Window
getDialogOwner()
Returns owner window(dialog or frame) for dialogsjava.awt.Window
getDialogOwner(java.awt.Component invoker)
Returns parent window(dialog or frame) for a dialog which will be invoked by given componentjava.awt.Frame
getDialogParent()
Deprecated.usegetDialogOwner()
.java.awt.Frame
getDialogParent(boolean useFake)
Method returns the frame used for dialogs as parent.static MDDialogParentProvider
getProvider()
private static java.awt.Window
getWindowOf(java.awt.Component invoker)
static void
hideFakeParent()
Hides fake parentvoid
setDialogParent(java.awt.Window parent)
Sets the parent for dialogs those will be created in future.
-
-
-
Field Detail
-
fakeParent
private java.awt.Frame fakeParent
-
dialogOwner
@CheckForNull private java.awt.Window dialogOwner
-
instance
private static final MDDialogParentProvider instance
-
-
Method Detail
-
getProvider
public static MDDialogParentProvider getProvider()
- Returns:
- instance of provider
-
getDialogParent
@Deprecated public java.awt.Frame getDialogParent()
Deprecated.usegetDialogOwner()
. Frame is not always a good choice to pass as parent. Parent sometimes should be another dialog, not just a frame.Returns parent frame for dialogs.- Specified by:
getDialogParent
in interfaceDialogParentProvider
- Returns:
- parent
-
getDialogOwner
public java.awt.Window getDialogOwner()
Description copied from interface:DialogParentProvider
Returns owner window(dialog or frame) for dialogs- Specified by:
getDialogOwner
in interfaceDialogParentProvider
- Returns:
- owner window
-
getDialogOwner
public java.awt.Window getDialogOwner(@CheckForNull java.awt.Component invoker)
Description copied from interface:DialogParentProvider
Returns parent window(dialog or frame) for a dialog which will be invoked by given component- Specified by:
getDialogOwner
in interfaceDialogParentProvider
- Parameters:
invoker
- invoker component- Returns:
- owner window of invoker component
-
getWindowOf
@CheckForNull private static java.awt.Window getWindowOf(@CheckForNull java.awt.Component invoker)
-
getDialogParent
@CheckForNull public java.awt.Frame getDialogParent(boolean useFake)
Method returns the frame used for dialogs as parent. If there is no parent returns null.- Parameters:
useFake
- true return fake parent if there is no real parent.- Returns:
- dialog parent frame.
-
setDialogParent
public void setDialogParent(@CheckForNull java.awt.Window parent)
Sets the parent for dialogs those will be created in future.- Parameters:
parent
- the new dialog's parent.
-
hideFakeParent
public static void hideFakeParent()
Hides fake parent
-
-