Class DcsUiUtil

java.lang.Object
com._1c.g5.v8.dt.dcs.ui.util.DcsUiUtil

public class DcsUiUtil extends Object
Вспомогательные функции наборов данных.
  • Constructor Details

    • DcsUiUtil

      public DcsUiUtil()
  • Method Details

    • renameDataSet

      public static void renameDataSet(org.eclipse.swt.widgets.Shell shell, IBmEditingContext editingContext, DataCompositionSchema schema, DataSet dataSet)
      Переименовать набор данных
      Parameters:
      shell - окно редактора
      editingContext - the BM editing context
      schema - модель скд
      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 null
      items - sibling objects, can't be null
      nameFeature - 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()
      Returns:
      actual DataCompositionSchemaControlContext for form dynamic list dialog, can be null if dynamic list dialog is not open
    • setActualControlContext

      public static void setActualControlContext(DataCompositionSchemaControlContext actualContext)
      Sets actual DataCompositionSchemaControlContext for form dynamic list dialog
      Parameters:
      actualContext - actual DataCompositionSchemaControlContext for form dynamic list dialog, cannot be null
    • 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 null
      commands - 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 for TableExViewer, TableExTreeViewer viewer
      Parameters:
      site - editor's site, can't be null
      viewer - viewer, can't be null
      table - TableEx viewer's table, can't be null
      contextMenuId - context menu id, can be null
      contextId - context id, can't be null
    • addContextMenuToViewer

      public static void addContextMenuToViewer(TableEx table, String contextMenuId, String contextId)
      Creates context menu for TableExViewer, TableExTreeViewer viewer
      Parameters:
      table - TableEx viewer's table, can't be null
      contextMenuId - context menu id, can't be null
      contextId - context id, can't be null
    • createColumn

      public static TableExViewerColumn createColumn(ColumnViewer viewer, int groupStyle, int width, String text)
      Create viewer's column
      Parameters:
      viewer - parent viewer, can't be null
      groupStyle - column style
      width - width
      text - title, can be null
      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 be null
      groupStyle - column style
      width - width
      text - title, can be null
      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 null
      destType - - 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
      Example:
      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 be null.
      Returns:
      created border composite. Cannot return null.