Class 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
    • Field Summary

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

        handle
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static org.eclipse.swt.custom.CTabItem addTab​(org.eclipse.swt.custom.CTabFolder tabFolder, String text)
      Add new tab
      void addTreeForSort​(TreeViewer treeViewer)
      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 dispose()  
      static void enableMouseDoubleClickEdit​(TreeViewer viewer)
      Enable mouse double click edit
      QlEditor getActiveQlEditor()
      Get active QL editor
      org.eclipse.core.resources.IProject getContextProject()  
      String getDefultTemplateName()
      Get default template name
      int getMode()
      Get current query wizard mode
      QueryWizardSource getQuerySchemaSource()  
      String getQuerySchemaTextAndErrors​(StringBuilder errors)
      Get formatted query text and existing errors
      String getQueryText()
      Return query text
      QueryTextResultProcessing.ResultProcessingParams getResultProcessingParams()
      Get result processing parameters
      org.eclipse.emf.transaction.TransactionalEditingDomain getTransactionDomain()
      Get transaction domain
      org.eclipse.core.commands.operations.UndoContext getUndoContext()
      Get undo context for query schema
      void hideQueriesAndOperatorsCombo​(boolean showQueries, boolean showOperators)
      Hide query and operators combo
      boolean isSourcesSorted()
      Returns true if items is sorted in sources tree.
      void notifyClose()
      Call after use control
      void refreshModel()
      Refresh query schema after changes
      void refreshWizard()
      Refreshing changed controls
      void setActiveQlEditor​(QlEditor qlEditor)
      Set active QL editor
      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 updateUndoRedoButtons()
      Update undo and redo buttons after model changes
      boolean validate()
      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 interface org.eclipse.swt.graphics.Drawable

        isAutoScalable
    • Constructor Detail

      • 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)
        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.
    • Method Detail

      • 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 -
      • 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
      • 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
      • isSourcesSorted

        public boolean isSourcesSorted()
        Returns true if items is sorted in sources tree.
        Returns:
        true if items is sorted in sources tree.
      • 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