Class DebugPopup
- java.lang.Object
-
- org.eclipse.jface.window.Window
-
- org.eclipse.jface.dialogs.PopupDialog
-
- org.eclipse.debug.ui.DebugPopup
-
- All Implemented Interfaces:
IShellProvider
- Direct Known Subclasses:
InspectPopupDialog
public abstract class DebugPopup extends PopupDialog
APopupDialogthat is automatically positioned relative to a specified anchor point. The popup can be dismissed in the same manor as all popup dialogs, but additionally allows clients the option of specifying a command id that can be used to persist the contents of the dialog.Clients may subclass this.
- Since:
- 3.2
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
Window.IExceptionHandler
-
-
Field Summary
-
Fields inherited from class org.eclipse.jface.dialogs.PopupDialog
HOVER_SHELLSTYLE, INFOPOPUP_SHELLSTYLE, INFOPOPUPRESIZE_SHELLSTYLE, POPUP_HORIZONTALSPACING, POPUP_IMG_MENU, POPUP_IMG_MENU_DISABLED, POPUP_MARGINHEIGHT, POPUP_MARGINWIDTH, POPUP_VERTICALSPACING
-
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK, resizeHasOccurred
-
-
Constructor Summary
Constructors Constructor Description DebugPopup(Shell parent, Point anchor, String commandId)Constructs a new popup dialog of typePopupDialog.INFOPOPUPRESIZE_SHELLSTYLE
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanclose()Closes this window, disposes its shell, and removes this window from its window manager (if it has one).protected abstract ControlcreateDialogArea(Composite parent)Creates and returns the contents of the dialog (the area below the title area and above the info text area.protected StringgetActionText()Returns the text to be shown as the action performed when this dialog's persist command is invoked, ornull.protected StringgetCommandId()Returns the command id to be used for persisting the contents of the dialog.protected IDialogSettingsgetDialogSettings()Gets the dialog settings that should be used for remembering the bounds of the dialog.protected StringgetInfoText()Returns the text to be shown in the popups's information area.protected PointgetInitialLocation(Point initialSize)Returns the initial location to use for the shell based upon the current selection in the viewer.intopen()Opens this window, creating it first if it has not yet been created.protected voidpersist()Persists the contents of the dialog.protected booleanwasPersisted()Returns whether the command handler was invoked to persist this popup's result.-
Methods inherited from class org.eclipse.jface.dialogs.PopupDialog
adjustBounds, applyBackgroundColor, applyForegroundColor, configureShell, createContents, createInfoTextArea, createTitleControl, createTitleMenuArea, fillDialogMenu, getBackground, getBackgroundColorExclusions, getDefaultLocation, getDefaultSize, getFocusControl, getForeground, getForegroundColorExclusions, getInitialSize, getPersistBounds, getPersistLocation, getPersistSize, hasInfoArea, hasTitleArea, saveDialogBounds, setInfoText, setTabOrder, setTitleText, showDialogMenu
-
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, create, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, initializeBounds, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
-
-
-
-
Constructor Detail
-
DebugPopup
public DebugPopup(Shell parent, Point anchor, String commandId)
Constructs a new popup dialog of typePopupDialog.INFOPOPUPRESIZE_SHELLSTYLE- Parameters:
parent- The parent shellanchor- point at which to anchor the popup dialog in Display coordinate space. Since 3.3,nullcan be specified to use a default anchor pointcommandId- The command id to be used for persistence of the dialog, ornull
-
-
Method Detail
-
getInfoText
protected String getInfoText()
Returns the text to be shown in the popups's information area. May returnnull.By default, if this dialog has a persistence command associated with it, the text displayed is of the form "Press {key-sequence} to {action}". The action text is specified by the method
getActionText().- Returns:
- The text to be shown in the popup's information area or
null
-
getActionText
protected String getActionText()
Returns the text to be shown as the action performed when this dialog's persist command is invoked, ornull.Subclasses should override as necessary.
- Returns:
- the text to be shown as the action performed when this dialog's persist command is invoked
-
getCommandId
protected String getCommandId()
Returns the command id to be used for persisting the contents of the dialog. If the contents should not be persisted, this method should return null.- Returns:
- The command id to be used for persisting the contents of the
dialog or
null
-
persist
protected void persist()
Persists the contents of the dialog. Subclasses should override as required, but also call super.persist().
-
wasPersisted
protected boolean wasPersisted()
Returns whether the command handler was invoked to persist this popup's result.- Returns:
- whether the command handler was invoked to persist this popup's result
-
createDialogArea
protected abstract Control createDialogArea(Composite parent)
Description copied from class:PopupDialogCreates and returns the contents of the dialog (the area below the title area and above the info text area.The
PopupDialogimplementation of this framework method creates and returns a newCompositewith standard margins and spacing.The returned control's layout data must be an instance of
GridData. This method must not modify the parent's layout.Subclasses must override this method but may call
superas in the following example:Composite composite = (Composite) super.createDialogArea(parent); //add controls to composite as necessary return composite;
- Overrides:
createDialogAreain classPopupDialog- Parameters:
parent- the parent composite to contain the dialog area- Returns:
- the dialog area control
-
getInitialLocation
protected Point getInitialLocation(Point initialSize)
Returns the initial location to use for the shell based upon the current selection in the viewer. Bottom is preferred to top, and right is preferred to left, therefore if possible the popup will be located below and to the right of the selection.- Overrides:
getInitialLocationin classPopupDialog- Parameters:
initialSize- the initial size of the shell, as returned bygetInitialSize.- Returns:
- the initial location of the shell
-
getDialogSettings
protected IDialogSettings getDialogSettings()
Description copied from class:PopupDialogGets the dialog settings that should be used for remembering the bounds of the dialog. Subclasses should override this method when they wish to persist the bounds of the dialog.- Overrides:
getDialogSettingsin classPopupDialog- Returns:
- settings the dialog settings used to store the dialog's location
and/or size, or
nullif the dialog's bounds should never be stored.
-
open
public int open()
Description copied from class:PopupDialogOpens this window, creating it first if it has not yet been created.This method is reimplemented for special configuration of PopupDialogs. It never blocks on open, immediately returning
OKif the open is successful, orCANCELif it is not. It provides framework hooks that allow subclasses to set the focus and tab order, and avoids the use ofshell.open()in cases where the focus should not be given to the shell initially.- Overrides:
openin classPopupDialog- Returns:
- the return code
- See Also:
Window.open()
-
close
public boolean close()
Description copied from class:PopupDialogCloses this window, disposes its shell, and removes this window from its window manager (if it has one).This method is extended to save the dialog bounds and initialize widget state so that the widgets can be recreated if the dialog is reopened. This method may be extended (
super.closemust be called).- Overrides:
closein classPopupDialog- Returns:
trueif the window is (or was already) closed, andfalseif it is still open
-
-