|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.intellij.openapi.ui.DialogWrapper
public abstract class DialogWrapper
| Field Summary | |
|---|---|
static int |
CANCEL_EXIT_CODE
The default exit code for "Cancel" action. |
static java.lang.String |
DEFAULT_ACTION
If your action returned by createActions method has non
null value for this key, then the button that corresponds to the action will be the
default button for the dialog. |
static int |
NEXT_USER_EXIT_CODE
If you use your custom exit codes you have have to start them with this constant. |
static int |
OK_EXIT_CODE
The default exit code for "OK" action. |
| Constructor Summary | |
|---|---|
protected |
DialogWrapper(boolean canBeParent)
|
protected |
DialogWrapper(java.awt.Component parent,
boolean canBeParent)
|
protected |
DialogWrapper(Project project,
boolean canBeParent)
Creates modal DialogWrapper. |
| Method Summary | |
|---|---|
void |
addKeyListener(java.awt.event.KeyListener listener)
|
void |
addMouseListener(java.awt.event.MouseListener listener)
|
void |
addMouseListener(java.awt.event.MouseMotionListener listener)
|
void |
centerRelativeToParent()
|
void |
clickDefaultButton()
Programmatically perform a "click" of default dialog's button. |
void |
close(int exitCode)
Closes and disposes the dialog and sets the specified exit code. |
protected javax.swing.Action[] |
createActions()
This is factory method which creates action of dialog. |
protected abstract javax.swing.JComponent |
createCenterPanel()
Factory method. |
protected javax.swing.JComponent |
createContentPane()
|
protected javax.swing.border.Border |
createContentPaneBorder()
Factory method. |
protected void |
createDefaultActions()
|
protected javax.swing.JButton |
createJButtonForAction(javax.swing.Action action)
Creates JButton for the specified action. |
protected javax.swing.Action[] |
createLeftSideActions()
|
protected javax.swing.JComponent |
createNorthPanel()
Factory method. |
protected javax.swing.JComponent |
createSouthPanel()
This is factory method. |
protected javax.swing.JComponent |
createTitlePane()
|
protected void |
dispose()
Dispose the wrapped and releases all resources allocated be the wrapper to help more effecient garbage collection. |
void |
doCancelAction()
This method is invoked by default implementation of "Cancel" action. |
protected void |
doHelpAction()
This method is invoked by default implementation of "Help" action. |
protected void |
doOKAction()
This method is invoked by default implementation of "OK" action. |
protected javax.swing.Action |
getCancelAction()
|
java.awt.Container |
getContentPane()
|
java.lang.String |
getDimensionKey()
|
protected java.lang.String |
getDimensionServiceKey()
This is factory method. |
int |
getExitCode()
|
protected javax.swing.Action |
getHelpAction()
|
float |
getHorizontalStretch()
|
java.awt.Point |
getInitialLocation()
|
java.awt.Point |
getLocation()
|
protected javax.swing.Action |
getOKAction()
|
java.awt.Window |
getOwner()
|
javax.swing.JComponent |
getPreferredFocusedComponent()
|
java.awt.Dimension |
getPreferredSize()
|
javax.swing.JRootPane |
getRootPane()
|
java.awt.Dimension |
getSize()
|
java.lang.String |
getTitle()
|
float |
getVerticalStretch()
|
java.awt.Window |
getWindow()
|
protected void |
init()
|
boolean |
isModalProgress()
|
boolean |
isOK()
|
boolean |
isOKActionEnabled()
|
protected boolean |
isProgressDialog()
|
void |
isResizable()
|
boolean |
isShowing()
|
boolean |
isVisible()
|
void |
pack()
|
void |
repaint()
|
protected void |
setButtonsAlignment(int alignment)
Sets horizontal alignment of dialog's the buttons. |
void |
setButtonsMargin(java.awt.Insets insets)
Sets margine for command buttons ("OK", "Cance", "Help"). |
protected void |
setCancelButtonIcon(javax.swing.Icon icon)
|
protected void |
setCancelButtonText(java.lang.String text)
|
void |
setCrossClosesWindow(boolean crossClosesWindow)
|
protected void |
setHorizontalStretch(float hStretch)
|
void |
setLocation(int x,
int y)
|
void |
setLocation(java.awt.Point p)
|
void |
setModal(boolean modal)
|
protected void |
setOKActionEnabled(boolean isEnabled)
|
protected void |
setOKButtonIcon(javax.swing.Icon icon)
|
protected void |
setOKButtonText(java.lang.String text)
|
void |
setResizable(boolean resizable)
|
void |
setSize(int width,
int height)
|
void |
setTitle(java.lang.String title)
|
void |
setUndecorated(boolean undecorated)
|
protected void |
setVerticalStretch(float vStretch)
|
boolean |
shouldCloseOnCross()
|
void |
show()
|
void |
toBack()
|
void |
toFront()
|
void |
validate()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int OK_EXIT_CODE
public static final int CANCEL_EXIT_CODE
public static final int NEXT_USER_EXIT_CODE
public static final java.lang.String DEFAULT_ACTION
createActions method has non
null value for this key, then the button that corresponds to the action will be the
default button for the dialog. It's true if you don't change this behaviour
of createJButtonForAction(Action) method.
| Constructor Detail |
|---|
protected DialogWrapper(Project project,
boolean canBeParent)
DialogWrapper. The currently active window will be the dialog's parent.
project - parent window for the dialog will be calculated based on focused window for the
specified project. This parameter can be null. In this case parent window
will be suggested based on current focused window.canBeParent - specifies whether the dialog can be parent for other windows. This parameter is used
by WindowManager.protected DialogWrapper(boolean canBeParent)
protected DialogWrapper(java.awt.Component parent,
boolean canBeParent)
parent - parent component whicg is used to canculate heavy weight window ancestor.
parent cannot be null and must be showing.| Method Detail |
|---|
protected void createDefaultActions()
public void setUndecorated(boolean undecorated)
public final void addMouseListener(java.awt.event.MouseListener listener)
Component.addMouseListener(java.awt.event.MouseListener)public final void addMouseListener(java.awt.event.MouseMotionListener listener)
Component.addMouseMotionListener(java.awt.event.MouseMotionListener)public final void addKeyListener(java.awt.event.KeyListener listener)
Component.addKeyListener(java.awt.event.KeyListener)public final void close(int exitCode)
protected javax.swing.border.Border createContentPaneBorder()
(8,8,8,8) insets. The subclasses can
retirn null in overridden methods. In this case there will be no
any border in the content pane.
protected javax.swing.JComponent createSouthPanel()
createActions()
and createJButtonForAction(Action) methods to construct the panel.
protected javax.swing.JButton createJButtonForAction(javax.swing.Action action)
JButton for the specified action. If the button has not null
value for DialogWrapper.DEFAULT_ACTION key then the created button will be the
default one for the dialog.
DEFAULT_ACTIONprotected javax.swing.JComponent createTitlePane()
protected javax.swing.JComponent createNorthPanel()
null
value. In this case there will be no input panel.
protected abstract javax.swing.JComponent createCenterPanel()
null
value. In this case there will be no options panel.
public void toFront()
Window.toFront()public void toBack()
Window.toBack()protected void dispose()
dispose.
public void doCancelAction()
CANCEL_EXIT_CODE. This is convenient place to override functionality of "Cancel" action.
Note that the method does nothing if "Cancel" action isn't enabled.
public void clickDefaultButton()
protected void doOKAction()
OK_EXIT_CODE. This is convenient place to override functionality of "OK" action.
Note that the method does nothing if "OK" action isn't enabled.
public boolean shouldCloseOnCross()
true means that cross performs hide or dispose of the dialog.protected javax.swing.Action[] createActions()
JButton which is created by createJButtonForAction(Action)
method. These buttons are places into panel which is created by createButtonsPanel
method. Therefore you have anough ways to customise the dialog by ovverriding of
createActions(), createButtonsPanel() and
createJButtonForAction(Action) methods. By default the createActions()
method returns "OK" and "Cancel" action.
createSouthPanel(),
createJButtonForAction(javax.swing.Action)protected javax.swing.Action[] createLeftSideActions()
protected javax.swing.Action getOKAction()
doOKAction() method.doOKAction()protected javax.swing.Action getCancelAction()
doCancelAction() method.doCancelAction()protected javax.swing.Action getHelpAction()
doHelpAction() method.doHelpAction()protected boolean isProgressDialog()
public final boolean isModalProgress()
public java.awt.Container getContentPane()
JDialog.getContentPane()public void validate()
Container.validate()public void repaint()
Component.repaint()protected java.lang.String getDimensionServiceKey()
null then the component does not require installation
into dimension service. This default implementation returns null.
public final java.lang.String getDimensionKey()
public int getExitCode()
public javax.swing.JComponent getPreferredFocusedComponent()
public final float getHorizontalStretch()
1.0fpublic final float getVerticalStretch()
1.0fprotected final void setHorizontalStretch(float hStretch)
protected final void setVerticalStretch(float vStretch)
public java.awt.Window getOwner()
Window.getOwner()public java.awt.Window getWindow()
public javax.swing.JRootPane getRootPane()
JDialog.getRootPane()public java.awt.Dimension getSize()
Component.getSize()public java.lang.String getTitle()
Dialog.getTitle()protected void init()
protected javax.swing.JComponent createContentPane()
public void pack()
Window.pack()public java.awt.Dimension getPreferredSize()
protected final void setButtonsAlignment(int alignment)
alignment - alignment of the buttons. Acceptable values are
SwingConstants.CENTER and SwingConstants.RIGHT.
The SwingConstants.RIGHT is the default value.
java.lang.IllegalArgumentException - if alignment isn't acceptablepublic final void setButtonsMargin(java.awt.Insets insets)
public final void setCrossClosesWindow(boolean crossClosesWindow)
protected final void setCancelButtonIcon(javax.swing.Icon icon)
protected final void setCancelButtonText(java.lang.String text)
public void setModal(boolean modal)
protected void setOKActionEnabled(boolean isEnabled)
protected final void setOKButtonIcon(javax.swing.Icon icon)
protected final void setOKButtonText(java.lang.String text)
protected void doHelpAction()
public boolean isOK()
public boolean isOKActionEnabled()
public boolean isVisible()
Component.isVisible()public boolean isShowing()
Window.isShowing()
public void setSize(int width,
int height)
Component.setSize(int, int)public void setTitle(java.lang.String title)
Dialog.setTitle(java.lang.String)public void isResizable()
Dialog.isResizable()public void setResizable(boolean resizable)
Dialog.setResizable(boolean)public java.awt.Point getLocation()
Component.getLocation()public void setLocation(java.awt.Point p)
Component.setLocation(Point)
public void setLocation(int x,
int y)
Component.setLocation(int,int)public void centerRelativeToParent()
public void show()
public java.awt.Point getInitialLocation()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||