Class DebugElementDialog
java.lang.Object
org.eclipse.jface.window.Window
org.eclipse.jface.dialogs.PopupDialog
org.eclipse.debug.ui.DebugPopup
com._1c.g5.v8.dt.internal.debug.ui.hover.DebugElementDialog
- All Implemented Interfaces:
org.eclipse.jface.window.IShellProvider
- Direct Known Subclasses:
PendingAwareInspectPopupDialog
public class DebugElementDialog
extends org.eclipse.debug.ui.DebugPopup
Support UI class for creating debug element dialog. Contains tree viewer with debug element presentation. Can be
used to create dialog to show 1C:Enterprise runtime debug value or expression.
Created debug element dialog viewer also have popup menu with id: com._1c.g5.v8.dt.debug.ui.menu.hoverPopup
.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Popup menu ID.protected static final String
Inspect popup sash weightsprotected org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer
Inheritable variables tree viewerFields 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
ConstructorsConstructorDescriptionDebugElementDialog
(org.eclipse.swt.widgets.Shell shell, org.eclipse.swt.graphics.Point anchor, String commandId) Creates the content of the debug element dialog. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Checks, that content of the dialog is already created.org.eclipse.swt.widgets.Control
createContents
(org.eclipse.swt.widgets.Composite parent) protected org.eclipse.swt.widgets.Control
createDialogArea
(org.eclipse.swt.widgets.Composite parent) protected org.eclipse.swt.widgets.Control
createTitleControl
(org.eclipse.swt.widgets.Composite parent) protected org.eclipse.swt.widgets.Control
createTitleMenuArea
(org.eclipse.swt.widgets.Composite parent) protected void
Disables tree editing on user actions - adds events ignoring flagvoid
dispose()
Disposes of the current debug element dialog.org.eclipse.swt.widgets.Control
Returns the background control of the debug element dialog.org.eclipse.debug.core.model.IDebugElement
Returns current input debug element.protected org.eclipse.swt.graphics.Point
getInitialLocation
(org.eclipse.swt.graphics.Point initialSize) org.eclipse.swt.graphics.Point
boolean
boolean
int[]
Returns the relative weights of each child in the sash form if this dialog: first element in an array is the tree weight second element in an array is the details weightprotected org.eclipse.debug.ui.AbstractDebugView
Attempts to find an appropriate view to emulate, this will either be the variables view or the expressions view.void
initSashWeights
(int tree, int details) Set the relative weights of each child in the sash form if this dialog.boolean
Checks whether the dialog is focusedboolean
Returns whether this debug element dialog is already disposed.protected void
populateMenu
(org.eclipse.jface.action.MenuManager manager, org.eclipse.debug.ui.AbstractDebugView emulateView) Populate the menu of the debug element dialog.void
saveDialogBounds
(org.eclipse.swt.widgets.Shell shell) void
setBackground
(org.eclipse.swt.graphics.Color background) Sets the debug element dialog background color to the color specified by the argument, or to the default system color for the control, if the argument isnull
.void
setFocus()
Causes the debug element dialog to have the focus on the created model viewer.void
setForeground
(org.eclipse.swt.graphics.Color foreground) Sets the debug element dialog foreground color to the color specified by the argument, or to the default system color for the control, if the argument isnull
.void
setInput
(org.eclipse.debug.core.model.IDebugElement element) Sets the input of the debug element dialog.protected void
Updates the dialog detail pane.Methods inherited from class org.eclipse.debug.ui.DebugPopup
close, getActionText, getCommandId, getDialogSettings, getInfoText, open, persist, wasPersisted
Methods inherited from class org.eclipse.jface.dialogs.PopupDialog
adjustBounds, applyBackgroundColor, applyForegroundColor, configureShell, createInfoTextArea, fillDialogMenu, getBackground, getBackgroundColorExclusions, getDefaultLocation, getDefaultSize, getFocusControl, getForeground, getForegroundColorExclusions, hasInfoArea, hasTitleArea, 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
-
Field Details
-
POPUP_DEBUG_MENU_ID
Popup menu ID. Value is "com._1c.g5.v8.dt.debug.ui.menu.hoverPopup".- See Also:
-
PREF_INSPECT_POPUP_SASH_WEIGHTS
Inspect popup sash weights- See Also:
-
viewer
protected org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer viewerInheritable variables tree viewer
-
-
Constructor Details
-
DebugElementDialog
public DebugElementDialog(org.eclipse.swt.widgets.Shell shell, org.eclipse.swt.graphics.Point anchor, String commandId) Creates the content of the debug element dialog. Method must be invoked before others methods of this class.- Parameters:
shell
- the parent shell, cannot benull
anchor
- point at which to anchor the popup in Display coordinates, can benull
, then default location should be usedcommandId
- the command id to be used for persistence of the dialog (possiblynull
)
-
-
Method Details
-
createContents
public org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent) - Overrides:
createContents
in classorg.eclipse.jface.dialogs.PopupDialog
-
setInput
public void setInput(org.eclipse.debug.core.model.IDebugElement element) Sets the input of the debug element dialog.Only
IVariable
orIWatchExpression
are supported. Otherwise method will do nothing.- Parameters:
input
- the input of the debug element dialog to set, cannot benull
-
getElement
public org.eclipse.debug.core.model.IDebugElement getElement()Returns current input debug element. Can returnnull
if none element is shown by this dialog now.- Returns:
- current input debug element or
null
if none
-
setForeground
public void setForeground(org.eclipse.swt.graphics.Color foreground) Sets the debug element dialog foreground color to the color specified by the argument, or to the default system color for the control, if the argument isnull
.- Parameters:
foreground
- the color to set ornull
to set default
-
setBackground
public void setBackground(org.eclipse.swt.graphics.Color background) Sets the debug element dialog background color to the color specified by the argument, or to the default system color for the control, if the argument isnull
.- Parameters:
background
- the color to set ornull
to set default
-
setFocus
public void setFocus()Causes the debug element dialog to have the focus on the created model viewer. -
initSashWeights
public void initSashWeights(int tree, int details) Set the relative weights of each child in the sash form if this dialog.- Parameters:
tree
- the tree weight, must be greater than zerodetails
- the details weight, must be greater than zero
-
getBackgroundControl
public org.eclipse.swt.widgets.Control getBackgroundControl()Returns the background control of the debug element dialog.- Returns:
- the background control of the debug element dialog
-
getSashWeights
public int[] getSashWeights()Returns the relative weights of each child in the sash form if this dialog:- first element in an array is the tree weight
- second element in an array is the details weight
Can be used to store weights for later reuse.
- Returns:
- the relative weights of each child in the sash form if this dialog, never
null
-
dispose
public void dispose()Disposes of the current debug element dialog. -
saveDialogBounds
public void saveDialogBounds(org.eclipse.swt.widgets.Shell shell) - Overrides:
saveDialogBounds
in classorg.eclipse.jface.dialogs.PopupDialog
-
isDisposed
public boolean isDisposed()Returns whether this debug element dialog is already disposed.- Returns:
- whether this debug element dialog is already disposed
-
getPersistLocation
public boolean getPersistLocation()- Overrides:
getPersistLocation
in classorg.eclipse.jface.dialogs.PopupDialog
-
getPersistSize
public boolean getPersistSize()- Overrides:
getPersistSize
in classorg.eclipse.jface.dialogs.PopupDialog
-
getInitialSize
public org.eclipse.swt.graphics.Point getInitialSize()- Overrides:
getInitialSize
in classorg.eclipse.jface.dialogs.PopupDialog
-
isDialogFocused
public boolean isDialogFocused()Checks whether the dialog is focused- Returns:
- whether the dialog is focused
-
createDialogArea
protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent) - Specified by:
createDialogArea
in classorg.eclipse.debug.ui.DebugPopup
-
createTitleControl
protected org.eclipse.swt.widgets.Control createTitleControl(org.eclipse.swt.widgets.Composite parent) - Overrides:
createTitleControl
in classorg.eclipse.jface.dialogs.PopupDialog
-
getInitialLocation
protected org.eclipse.swt.graphics.Point getInitialLocation(org.eclipse.swt.graphics.Point initialSize) - Overrides:
getInitialLocation
in classorg.eclipse.debug.ui.DebugPopup
-
checkContent
protected void checkContent()Checks, that content of the dialog is already created.- Throws:
IllegalArgumentException
- if content is not created yet
-
populateMenu
protected void populateMenu(org.eclipse.jface.action.MenuManager manager, org.eclipse.debug.ui.AbstractDebugView emulateView) Populate the menu of the debug element dialog.- Parameters:
manager
- the menu manager to populate, cannot benull
emulateView
- the debug view to emulate ornull
if none
-
getViewToEmulate
protected org.eclipse.debug.ui.AbstractDebugView getViewToEmulate()Attempts to find an appropriate view to emulate, this will either be the variables view or the expressions view.- Returns:
- a view to emulate or
null
-
updateDetailPane
protected void updateDetailPane()Updates the dialog detail pane. -
createTitleMenuArea
protected org.eclipse.swt.widgets.Control createTitleMenuArea(org.eclipse.swt.widgets.Composite parent) - Overrides:
createTitleMenuArea
in classorg.eclipse.jface.dialogs.PopupDialog
-
disableTreeElementsEditing
protected void disableTreeElementsEditing()Disables tree editing on user actions - adds events ignoring flag
-