Class QueryWizardControl

java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
com._1c.g5.v8.dt.qw.ui.controls.QueryWizardControl
All Implemented Interfaces:
Observer, org.eclipse.swt.graphics.Drawable

public class QueryWizardControl extends org.eclipse.swt.widgets.Composite implements Observer
Control for query wizard
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Drag&Drop event types
    static enum 
    Tab type
  • Field Summary

    Fields inherited from class org.eclipse.swt.widgets.Control

    handle
  • Constructor Summary

    Constructors
    Constructor
    Description
    QueryWizardControl(int mode, org.eclipse.core.resources.IProject project, org.eclipse.swt.widgets.Composite parent, int style, String queryText, QueryWizard parentQueryWizardDlg, QueryWizardControl parentQueryWizardControl, QueryTextResultProcessing.ResultProcessingParams processingParams, boolean editable, IBmNavigatorOrderIndexManager bmNavigatorOrderIndexManager, IConfigurationProvider configurationProvider, IV8ProjectManager v8ProjectManager, IQlCachedScopeProvider cachedScopeProvider, IBmModelManager bmModelManager)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.eclipse.swt.custom.CTabItem
    addTab(org.eclipse.swt.custom.CTabFolder tabFolder, String text)
    Add new tab
    void
    Add tree for sort
    static org.eclipse.swt.widgets.Composite
    createTreeChangingButtons(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.events.SelectionAdapter[] selectionAdapters)
    Create tree changing buttons (< << > >>)
    static org.eclipse.swt.widgets.Composite
    createTreeChangingButtons(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.events.SelectionAdapter[] selectionAdapters, boolean withToolBar)
    Create tree changing buttons (< << > >>)
    void
     
    static void
    Enable mouse double click edit
    Get active QL editor
     
     
    org.eclipse.core.resources.IProject
     
    Get default template name
    int
    Get current query wizard mode
     
    Get formatted query text and existing errors
    Return query text
    Get result processing parameters
    org.eclipse.emf.transaction.TransactionalEditingDomain
    Get transaction domain
    org.eclipse.core.commands.operations.UndoContext
    Get undo context for query schema
     
    void
    hideQueriesAndOperatorsCombo(boolean showQueries, boolean showOperators)
    Hide query and operators combo
    boolean
    Returns true if tables are shown for parent configuration.
    boolean
    Returns true if tables are shown for parent (extended) configuration
    boolean
    Returns true if items is sorted in sources tree.
    void
    Call after use control
    void
    Refresh query schema after changes
    void
    Refreshing changed controls
    void
    Set active QL editor
    void
     
    void
    setShowExtendedFields(boolean isShowExtendedFields)
    Show tables for parent (extended) configuration
    void
    setShowTablesForChange(boolean isShowTablesForChange)
    Show tables for change
    void
    setSortedSources(boolean isSourcesSorted)
    Sort items in trees
    static void
    setTabFolderCurrentTab(org.eclipse.swt.custom.CTabFolder tabFolder, QueryWizardControl.TabsType tabType)
    Set current tab
    void
    update(Observable observable, Object type)
     
    void
    Update undo and redo buttons after model changes
    boolean
    Validate query and show message with error to user, if exist

    Methods inherited from class org.eclipse.swt.widgets.Composite

    changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toString

    Methods inherited from class org.eclipse.swt.widgets.Scrollable

    computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar

    Methods inherited from class org.eclipse.swt.widgets.Control

    addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update

    Methods inherited from class org.eclipse.swt.widgets.Widget

    addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.swt.graphics.Drawable

    isAutoScalable
  • Constructor Details

    • QueryWizardControl

      public QueryWizardControl(int mode, org.eclipse.core.resources.IProject project, org.eclipse.swt.widgets.Composite parent, int style, String queryText, QueryWizard parentQueryWizardDlg, QueryWizardControl parentQueryWizardControl, QueryTextResultProcessing.ResultProcessingParams processingParams, boolean editable, IBmNavigatorOrderIndexManager bmNavigatorOrderIndexManager, IConfigurationProvider configurationProvider, IV8ProjectManager v8ProjectManager, IQlCachedScopeProvider cachedScopeProvider, IBmModelManager bmModelManager)
      Parameters:
      mode - - query wizard mode type (QueryWizardMode)
      project - project
      parent - parent composite
      style - style
      queryText - query text
      parentQueryWizardDlg - parent dialog
      parentQueryWizardControl - - parent query wizard for nested query
      processingParams - - parameters for result processing. Can be null.
      editable - the editable state, true if this control is editable, false otherwise
      bmNavigatorOrderIndexManager - - service to get IBmNavigatorOrderIndexProvider. Cannot be null.
      configurationProvider - - service to get configuration using eObject. Cannot be null.
      v8ProjectManager - - service to get IV8Project. Cannot be null.
      cachedScopeProvider - IQlCachedScopeProvider service reference. Cannot be null.
      bmModelManager - IBmModelManager service reference. Cannot be null.
  • Method Details

    • addTab

      public static org.eclipse.swt.custom.CTabItem addTab(org.eclipse.swt.custom.CTabFolder tabFolder, String text)
      Add new tab
      Parameters:
      tabFolder - - parent tab folder control tab folder
      text - header tab text
      Returns:
      new tab
    • enableMouseDoubleClickEdit

      public static void enableMouseDoubleClickEdit(TreeViewer viewer)
      Enable mouse double click edit
      Parameters:
      viewer - tree
    • createTreeChangingButtons

      public static org.eclipse.swt.widgets.Composite createTreeChangingButtons(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.events.SelectionAdapter[] selectionAdapters)
      Create tree changing buttons (< << > >>)
      Parameters:
      parent - composite
      selectionAdapters -
      Returns:
      new buttons panel
    • createTreeChangingButtons

      public static org.eclipse.swt.widgets.Composite createTreeChangingButtons(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.events.SelectionAdapter[] selectionAdapters, boolean withToolBar)
      Create tree changing buttons (< << > >>)
      Parameters:
      parent - composite
      selectionAdapters -
      withToolBar - create empty tool bar
      Returns:
      new buttons panel
    • setTabFolderCurrentTab

      public static void setTabFolderCurrentTab(org.eclipse.swt.custom.CTabFolder tabFolder, QueryWizardControl.TabsType tabType)
      Set current tab
      Parameters:
      tabFolder - - parent tab folder control
      index -
    • update

      public void update(Observable observable, Object type)
      Specified by:
      update in interface Observer
    • notifyClose

      public void notifyClose()
      Call after use control
    • refreshWizard

      public void refreshWizard()
      Refreshing changed controls
    • refreshModel

      public void refreshModel()
      Refresh query schema after changes
    • getQueryText

      public String getQueryText()
      Return query text
      Returns:
      query text
    • getQuerySchemaSource

      public QueryWizardSource getQuerySchemaSource()
      Returns:
      query schema source
    • getContextProject

      public org.eclipse.core.resources.IProject getContextProject()
      Returns:
      current IProject
    • getV8ProjectManager

      public IV8ProjectManager getV8ProjectManager()
      Returns:
      IV8ProjectManager, never null
    • getBmModelManager

      public IBmModelManager getBmModelManager()
      Returns:
      the bmModelManager
    • setBmModelManager

      public void setBmModelManager(IBmModelManager bmModelManager)
      Parameters:
      bmModelManager - the bmModelManager to set
    • getCachedScopeProvider

      public IQlCachedScopeProvider getCachedScopeProvider()
      Returns:
      IQlCachedScopeProvider, never null
    • updateUndoRedoButtons

      public void updateUndoRedoButtons()
      Update undo and redo buttons after model changes
    • getMode

      public int getMode()
      Get current query wizard mode
      Returns:
      combination of QueryWizardMode flags
    • validate

      public boolean validate()
      Validate query and show message with error to user, if exist
      Returns:
      true if query is valid
    • getQuerySchemaTextAndErrors

      public String getQuerySchemaTextAndErrors(StringBuilder errors)
      Get formatted query text and existing errors
      Parameters:
      errors - - errors in query schema
      Returns:
      formatted query text
    • hideQueriesAndOperatorsCombo

      public void hideQueriesAndOperatorsCombo(boolean showQueries, boolean showOperators)
      Hide query and operators combo
      Parameters:
      showQueries - - show queries combo
      showOperators - - show operators combo
    • getActiveQlEditor

      public QlEditor getActiveQlEditor()
      Get active QL editor
      Returns:
      active QL editor. Can be null.
    • setActiveQlEditor

      public void setActiveQlEditor(QlEditor qlEditor)
      Set active QL editor
      Parameters:
      qlEditor - - QL editor
    • addTreeForSort

      public void addTreeForSort(TreeViewer treeViewer)
      Add tree for sort
      Parameters:
      treeViewer - - tree viewer to add comparator to. Cannot be null.
    • setSortedSources

      public void setSortedSources(boolean isSourcesSorted)
      Sort items in trees
      Parameters:
      isSourcesSorted - - is sorted sources
    • setShowTablesForChange

      public void setShowTablesForChange(boolean isShowTablesForChange)
      Show tables for change
      Parameters:
      isShowTablesForChange - - tables are shown for change
    • setShowExtendedFields

      public void setShowExtendedFields(boolean isShowExtendedFields)
      Show tables for parent (extended) configuration
      Parameters:
      isShowExtendedFields - - tables are shown for parent (extended) configuration
    • isSourcesSorted

      public boolean isSourcesSorted()
      Returns true if items is sorted in sources tree.
      Returns:
      true if items is sorted in sources tree.
    • isShowTablesForChange

      public boolean isShowTablesForChange()
      Returns true if tables are shown for parent (extended) configuration
      Returns:
      true if tables are shown for parent (extended) configuration
    • isShowExtendedFields

      public boolean isShowExtendedFields()
      Returns true if tables are shown for parent configuration.
      Returns:
      true if tables are shown for parent configuration.
    • getResultProcessingParams

      public QueryTextResultProcessing.ResultProcessingParams getResultProcessingParams()
      Get result processing parameters
      Returns:
      result processing parameters. Return null, if query wizard is running not in result processing mode.
    • getDefultTemplateName

      public String getDefultTemplateName()
      Get default template name
      Returns:
    • getUndoContext

      public org.eclipse.core.commands.operations.UndoContext getUndoContext()
      Get undo context for query schema
      Returns:
      - undo context for current query schema
    • getTransactionDomain

      public org.eclipse.emf.transaction.TransactionalEditingDomain getTransactionDomain()
      Get transaction domain
      Returns:
      transaction domain
    • dispose

      public void dispose()
      Overrides:
      dispose in class org.eclipse.swt.widgets.Widget