Package com._1c.g5.v8.dt.dcs.ui.util
Class DcsUiUtil
- java.lang.Object
-
- com._1c.g5.v8.dt.dcs.ui.util.DcsUiUtil
-
public class DcsUiUtil extends Object
Вспомогательные функции наборов данных.
-
-
Constructor Summary
Constructors Constructor Description DcsUiUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addContextMenuToViewer(TableEx table, String contextMenuId, String contextId)
Creates context menu forTableExViewer
,TableExTreeViewer
viewerstatic void
addContextMenuToViewer(org.eclipse.ui.IWorkbenchPartSite site, ColumnViewer viewer, TableEx table, String contextMenuId, String contextId)
Creates context menu forTableExViewer
,TableExTreeViewer
viewerstatic void
copyTypeQualifiers(TypeDescription srcType, TypeDescription destType)
Copy type qualifiersstatic org.eclipse.swt.widgets.Composite
createBorderComposite(org.eclipse.swt.widgets.Composite parent)
Creates and returns border composite.static TableExViewerColumn
createColumn(TableExViewerColumn group, int groupStyle, int width, String text)
Create viewer's columnstatic TableExViewerColumn
createColumn(ColumnViewer viewer, int groupStyle, int width, String text)
Create viewer's columnstatic org.eclipse.jface.action.Action
createDropDownMenu(String imageSymbolicName, org.eclipse.jface.action.IAction... commands)
Creates dropdown menu buttonstatic DataCompositionSchema
createSchema(IV8Project v8project)
Create schema objectstatic DataCompositionSchemaControlContext
getActualControlContext()
Gets actualDataCompositionSchemaControlContext
for form dynamic list dialog.static int
getAlias(org.eclipse.emf.ecore.EObject obj)
Получить текущий вариант встроенного языкаstatic String
getCurrentLanguageCode(IV8Project v8project)
Get code of current languagestatic DataCompositionSchemaEditor
getEditor()
Get current dcs editorstatic EditorPage
getEditorActivePage()
Get active dcs editor pagestatic String
getNextName(String template, List<? extends org.eclipse.emf.ecore.EObject> items, org.eclipse.emf.ecore.EStructuralFeature nameFeature)
Get next name for object (Field1, Field2...)static IDcsSettingsProvider
getSettingsProvider()
Get current setting providerstatic String
getTemplateName(String name)
Выделить шаблонную часть имени без цифр (например, из НаборДанных1 выделить НаборДанных)static void
renameDataSet(org.eclipse.swt.widgets.Shell shell, IBmEditingContext editingContext, DataCompositionSchema schema, DataSet dataSet)
Переименовать набор данныхstatic void
setActualControlContext(DataCompositionSchemaControlContext actualContext)
Sets actualDataCompositionSchemaControlContext
for form dynamic list dialogstatic void
setSettingsProvider(IDcsSettingsProvider settingsProvider)
Set current settings provider
-
-
-
Method Detail
-
renameDataSet
public static void renameDataSet(org.eclipse.swt.widgets.Shell shell, IBmEditingContext editingContext, DataCompositionSchema schema, DataSet dataSet)
Переименовать набор данных- Parameters:
shell
- окно редактораeditingContext
- the BM editing contextschema
- модель скдdataSet
- набор данных
-
getTemplateName
public static String getTemplateName(String name)
Выделить шаблонную часть имени без цифр (например, из НаборДанных1 выделить НаборДанных)- Parameters:
name
- имя- Returns:
- шаблонная часть
-
getNextName
public static String getNextName(String template, List<? extends org.eclipse.emf.ecore.EObject> items, org.eclipse.emf.ecore.EStructuralFeature nameFeature)
Get next name for object (Field1, Field2...)- Parameters:
template
- name template, can't be nullitems
- sibling objects, can't be nullnameFeature
- name feature, can't be null- Returns:
- name, never null
-
getAlias
public static int getAlias(org.eclipse.emf.ecore.EObject obj)
Получить текущий вариант встроенного языка- Parameters:
obj
- объект модели- Returns:
- текущий вариант
-
getCurrentLanguageCode
public static String getCurrentLanguageCode(IV8Project v8project)
Get code of current language- Parameters:
v8project
- the V8 project- Returns:
- code
-
getSettingsProvider
public static IDcsSettingsProvider getSettingsProvider()
Get current setting provider- Returns:
IDcsSettingsProvider
object
-
setSettingsProvider
public static void setSettingsProvider(IDcsSettingsProvider settingsProvider)
Set current settings provider- Parameters:
settingsProvider
-IDcsSettingsProvider
object
-
getActualControlContext
public static DataCompositionSchemaControlContext getActualControlContext()
Gets actualDataCompositionSchemaControlContext
for form dynamic list dialog. Important thatDataCompositionSchemaEditor
does not call methodsetActualControlContext(DataCompositionSchemaControlContext)
- Returns:
- actual
DataCompositionSchemaControlContext
for form dynamic list dialog, can benull
if dynamic list dialog is not open
-
setActualControlContext
public static void setActualControlContext(DataCompositionSchemaControlContext actualContext)
Sets actualDataCompositionSchemaControlContext
for form dynamic list dialog- Parameters:
actualContext
- actualDataCompositionSchemaControlContext
for form dynamic list dialog, cannot benull
-
createDropDownMenu
public static org.eclipse.jface.action.Action createDropDownMenu(String imageSymbolicName, org.eclipse.jface.action.IAction... commands)
Creates dropdown menu button- Parameters:
imageSymbolicName
- menu image, can't be nullcommands
- menu commands, can't be null- Returns:
- dropdown menu button, never null
-
addContextMenuToViewer
public static void addContextMenuToViewer(org.eclipse.ui.IWorkbenchPartSite site, ColumnViewer viewer, TableEx table, String contextMenuId, String contextId)
Creates context menu forTableExViewer
,TableExTreeViewer
viewer- Parameters:
site
- editor's site, can't benull
viewer
- viewer, can't benull
table
-TableEx
viewer's table, can't benull
contextMenuId
- context menu id, can benull
contextId
- context id, can't benull
-
addContextMenuToViewer
public static void addContextMenuToViewer(TableEx table, String contextMenuId, String contextId)
Creates context menu forTableExViewer
,TableExTreeViewer
viewer- Parameters:
table
-TableEx
viewer's table, can't benull
contextMenuId
- context menu id, can't benull
contextId
- context id, can't benull
-
createColumn
public static TableExViewerColumn createColumn(ColumnViewer viewer, int groupStyle, int width, String text)
Create viewer's column- Parameters:
viewer
- parent viewer, can't benull
groupStyle
- column stylewidth
- widthtext
- title, can benull
- Returns:
- column
-
createColumn
public static TableExViewerColumn createColumn(TableExViewerColumn group, int groupStyle, int width, String text)
Create viewer's column- Parameters:
group
- parent column, can't benull
groupStyle
- column stylewidth
- widthtext
- title, can benull
- Returns:
- column
-
createSchema
public static DataCompositionSchema createSchema(IV8Project v8project)
Create schema object- Parameters:
v8project
- the V8 project, can't be null- Returns:
- schema, never null
-
getEditor
public static DataCompositionSchemaEditor getEditor()
Get current dcs editor- Returns:
- dcs editor, can be null
-
getEditorActivePage
public static EditorPage getEditorActivePage()
Get active dcs editor page- Returns:
- page or null if editor is null
-
copyTypeQualifiers
public static void copyTypeQualifiers(TypeDescription srcType, TypeDescription destType)
Copy type qualifiers- Parameters:
srcType
- - source type, not nulldestType
- - destination type, not null
-
createBorderComposite
public static org.eclipse.swt.widgets.Composite createBorderComposite(org.eclipse.swt.widgets.Composite parent)
Creates and returns border composite. Use it to paint border around inner control.
Important: User should not change layout of returned composite.
How to use:- create border composite
- create control inside border composite
- created control will have border around it
new List(createBorderComposite(Composite parent)
, SWT.NONE) will create list with border around it.
This border supports dark theme (SWT.BORDER does not)- Parameters:
parent
- - parent to create border composite. Cannot benull
.- Returns:
- created border composite. Cannot return
null
.
-
-