Package com._1c.g5.v8.dt.common.ui
Class CommonUI
java.lang.Object
org.eclipse.core.runtime.Plugin
org.eclipse.ui.plugin.AbstractUIPlugin
com._1c.g5.v8.dt.common.ui.CommonUI
- All Implemented Interfaces:
org.osgi.framework.BundleActivator
public class CommonUI
extends org.eclipse.ui.plugin.AbstractUIPlugin
Activator.
- See Also:
-
AbstractUIPlugin
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
3 dots 16x16 image resource used to show on dialog selection buttonsstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Arrow down 16x16 image resource used to show on combo buttonsstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Search 16x16 image resource used to show on search buttonsstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static CommonUI
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Executes the given runnable asynchronously on a UI thread associated with the given viewer.static void
asyncRefresh
(StructuredViewer viewer, Object element) Asynchronously refreshes the element of given viewer.static void
asyncRefresh
(Viewer viewer) Asynchronously refreshes the given viewer.static void
clearSelectionOnRightClick
(org.eclipse.swt.widgets.Control control) Adds a mouse listener that clears selection for the given control if the mouse down event coordinates corresponds to empty space of the control.static org.eclipse.core.runtime.IStatus
createErrorStatus
(String msg, Throwable e) static org.eclipse.ui.navigator.INavigatorContentService
Creates DT navigator content service.static org.eclipse.ui.navigator.INavigatorContentService
Creates DT navigator content service for the given viewer.static org.eclipse.core.runtime.IStatus
org.eclipse.swt.graphics.Image
getBundledImage
(String path) static org.eclipse.swt.graphics.Image
getCheckedStateImage
(CommonUI.CheckState checkState) Gets check state image.static org.eclipse.swt.graphics.Image
getCheckedStateImage
(Boolean state) Gets the check state image fromBoolean
.org.eclipse.swt.graphics.Color
getColor
(org.eclipse.swt.graphics.RGB rgb) Returns color for given rgb.static org.eclipse.swt.graphics.Image
static org.eclipse.jface.resource.ImageDescriptor
getImageDescriptor
(String path) ProvidesImageDescriptor
by image pathstatic CommonUI
protected void
initializeImageRegistry
(org.eclipse.jface.resource.ImageRegistry reg) static void
log
(org.eclipse.core.runtime.IStatus status) static void
runDeferredLayouts
(org.eclipse.swt.widgets.Display display) Runs deferred layout for the given display.void
start
(org.osgi.framework.BundleContext context) void
stop
(org.osgi.framework.BundleContext context) static void
Executes the given runnable synchronously on the UI thread associated with the given viewer.static void
syncRefresh
(Viewer viewer) Synchronously refreshes the given viewer.static void
syncUpdateSelection
(Viewer viewer, ISelection selection) Synchronously updates the selection of the given viewer.Methods inherited from class org.eclipse.ui.plugin.AbstractUIPlugin
createImageRegistry, getDialogSettings, getImageRegistry, getPreferenceStore, getWorkbench, imageDescriptorFromPlugin, initializeDefaultPluginPreferences, initializeDefaultPreferences, loadDialogSettings, loadPreferenceStore, refreshPluginActions, saveDialogSettings, savePreferenceStore, shutdown, startup
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getBundle, getLog, getPluginPreferences, getStateLocation, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, toString
-
Field Details
-
PLUGIN_ID
- See Also:
-
IMG_3_DOTS
3 dots 16x16 image resource used to show on dialog selection buttons- See Also:
-
IMG_ARROW_DOWN
Arrow down 16x16 image resource used to show on combo buttons- See Also:
-
IMG_SEARCH
Search 16x16 image resource used to show on search buttons- See Also:
-
IMG_CLEAR
- See Also:
-
IMG_ARROW_DOWN_SMALL
- See Also:
-
IMG_TYPE
- See Also:
-
IMG_REFRESH
- See Also:
-
V8_ICONS
- See Also:
-
IMG_FORM_CMD
- See Also:
-
IMG_FORM_PARAM
- See Also:
-
IMG_FORM_ELEMENT
- See Also:
-
IMG_GROUP_ELEMENT
- See Also:
-
IMG_COMMANDBAR_ELEMENT
- See Also:
-
IMG_CONTEXT_MENU
- See Also:
-
IMG_BUTTON_ELEMENT
- See Also:
-
IMG_FIELD_ELEMENT
- See Also:
-
IMG_ADDITION_ELEMENT
- See Also:
-
IMG_ADDITION_SEARCH_STRING_ELEMENT
- See Also:
-
IMG_ADDITION_SEARCH_CONTROL_ELEMENT
- See Also:
-
IMG_ADDITION_VIEWSTATUS_ELEMENT
- See Also:
-
IMG_DECORATION_ELEMENT
- See Also:
-
IMG_TABLE_ELEMENT
- See Also:
-
IMG_DELETE_BUTTON
- See Also:
-
T_OBJ16
- See Also:
-
T_WIZBAN
- See Also:
-
IMG_OBJ_PROPERTY
- See Also:
-
IMG_OBJ_COMPONENT
- See Also:
-
IMG_EXTENDED_TOOLTIP
- See Also:
-
IMG_FORM_USAGE_PROPERTY
- See Also:
-
IMG_FORM_REGISTRED_ELEMENT
- See Also:
-
MD_WIZARD_OPEN_LOCALIZED_DIALOG
- See Also:
-
IMG_NEW_WIZ
- See Also:
-
OVR_FIELD_ERR
- See Also:
-
OVR_FIELD_WARN
- See Also:
-
SHOT
- See Also:
-
OBJS_CHECK_STATE_ENABLE_SELECTED
- See Also:
-
OBJS_CHECK_STATE_DISABLE_SELECTED
- See Also:
-
OBJS_CHECK_STATE_ENABLE_UNSELECTED
- See Also:
-
OBJS_CHECK_STATE_DISABLE_UNSELECTED
- See Also:
-
OBJS_CHECK_STATE_ENABLE_GRAYED
- See Also:
-
OBJS_CHECK_STATE_DISABLE_GRAYED
- See Also:
-
IMG_ARRAW_ADD
- See Also:
-
IMG_ARRAW_ADD_ALL
- See Also:
-
IMG_ARRAW_REMOVE
- See Also:
-
IMG_ARRAW_REMOVE_ALL
- See Also:
-
IMG_MOVE_UP
- See Also:
-
IMG_MOVE_DOWN
- See Also:
-
IMG_VIEW_MESSAGE_ERROR
- See Also:
-
IMG_VIEW_MESSAGE_INFO
- See Also:
-
IMG_VIEW_MESSAGE_WARNING
- See Also:
-
IMG_VIEW_MESSAGE_DONE
- See Also:
-
IMG_VIEW_MESSAGE_OK
- See Also:
-
IMG_VIEW_MESSAGE_CANCEL
- See Also:
-
instance
-
-
Constructor Details
-
CommonUI
public CommonUI()
-
-
Method Details
-
log
public static void log(org.eclipse.core.runtime.IStatus status) -
createErrorStatus
-
createWarningStatus
-
start
- Specified by:
start
in interfaceorg.osgi.framework.BundleActivator
- Overrides:
start
in classorg.eclipse.ui.plugin.AbstractUIPlugin
- Throws:
Exception
-
stop
- Specified by:
stop
in interfaceorg.osgi.framework.BundleActivator
- Overrides:
stop
in classorg.eclipse.ui.plugin.AbstractUIPlugin
- Throws:
Exception
-
getBundledImage
-
getImage
-
getImageDescriptor
ProvidesImageDescriptor
by image path- Parameters:
path
- the image path, cannot benull
- Returns:
ImageDescriptor
, nevernull
-
getInstance
-
initializeImageRegistry
protected void initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry reg) - Overrides:
initializeImageRegistry
in classorg.eclipse.ui.plugin.AbstractUIPlugin
-
syncRefresh
Synchronously refreshes the given viewer.- Parameters:
viewer
- the viewer to refresh.
-
asyncRefresh
Asynchronously refreshes the given viewer.- Parameters:
viewer
- the viewer to refresh.
-
asyncRefresh
Asynchronously refreshes the element of given viewer.- Parameters:
viewer
- the viewer to refresh the element of.element
- the element to refresh.
-
syncUpdateSelection
Synchronously updates the selection of the given viewer.- Parameters:
viewer
- the viewer to update the selection of.selection
- the new selection.
-
asyncExec
Executes the given runnable asynchronously on a UI thread associated with the given viewer. Execution request is ignored if the viewer's control is disposed or workbench is not running.- Parameters:
viewer
- the viewer to obtain a UI thread from.runnable
- the runnable to execute.
-
syncExec
Executes the given runnable synchronously on the UI thread associated with the given viewer. Execution request is ignored if the viewer's control is disposed or workbench is not running.- Parameters:
viewer
- the viewer to obtain a UI thread from.runnable
- the runnable to execute.
-
runDeferredLayouts
public static void runDeferredLayouts(org.eclipse.swt.widgets.Display display) Runs deferred layout for the given display. Use it as a workaround for the following Eclipse layout bug:- User presses the mouse button on Navigator to select something in it. Eclipse makes call to Shell.setLayoutDeferred(true) to reduce the flickering of the toolbar while updating toolbar actions.
- While updating actions Eclipse also calls layout procedure with SWT.DEFER flag, that increases the number of deferred layout operations for the Shell.
- After that, subsequent call to Shell.setLayoutDeferred(false) will not trigger the replay of deferred layout operations since there were calls with SWT.DEFER flag. Such calls are replayed internally by the Display.runDeferredLayouts() on each attempt to process Display event queue events.
- DND subsystem disables the event processing while the mouse button is down. So the Display.runDeferredLayouts() call will not be made until user will release the mouse button.
- Eclipse totally disables the layout processing while user holds the mouse button down.
- Parameters:
display
- display to run deferred layouts for.
-
getCheckedStateImage
Gets check state image.- Parameters:
checkState
- the check state- Returns:
- the image, may be
null
-
getCheckedStateImage
Gets the check state image fromBoolean
.- Parameters:
state
-true
to get the checked image,false
to get the unchecked image,null
to get the grayed/mixed/indeterminate image.- Returns:
- the image, may not be
null
-
clearSelectionOnRightClick
public static void clearSelectionOnRightClick(org.eclipse.swt.widgets.Control control) Adds a mouse listener that clears selection for the given control if the mouse down event coordinates corresponds to empty space of the control.- Parameters:
control
- the control, can beTable
orTree
instance only.- Throws:
IllegalArgumentException
- if the given control is notTable
orTree
.
-
getColor
public org.eclipse.swt.graphics.Color getColor(org.eclipse.swt.graphics.RGB rgb) Returns color for given rgb. User should not dispose returned color.- Parameters:
rgb
- - rgb to get color.- Returns:
- color for given rgb. Can't return
null
.
-