Class MetaSelectionLine<T extends IHopMetadata>

  • All Implemented Interfaces:
    org.eclipse.swt.graphics.Drawable

    @GuiPlugin
    public class MetaSelectionLine<T extends IHopMetadata>
    extends org.eclipse.swt.widgets.Composite
    The goal of this composite is to add a line on a dialog which contains: - A label (for example: Database connection) - A Combo Variable selection (editable ComboBox, for example containing all connection values in the MetaStore) - New and Edit buttons (The latter opens up a generic Metadata editor)
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(String item)  
      void addModifyListener​(org.eclipse.swt.events.ModifyListener lsMod)  
      void addSelectionListener​(org.eclipse.swt.events.SelectionListener lsDef)  
      void addToConnectionLine​(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.widgets.Control previous, T selected, org.eclipse.swt.events.ModifyListener lsMod)
      Adds the connection line for the given parent and previous control, and returns a meta selection manager control
      void addTraverseListener​(org.eclipse.swt.events.TraverseListener tl)  
      protected boolean editMetadata()
      We look at the managed class name, add Dialog to it and then simply us that class to edit the dialog.
      void editMetadataElement()  
      void fillItems()
      Look up the object names from the metadata and populate the items in the combobox with it.
      org.eclipse.swt.custom.CCombo getComboWidget()  
      static String getEditIcon​(Object guiPluginObject)  
      int getItemCount()  
      String[] getItems()  
      org.eclipse.swt.widgets.Label getLabelWidget()  
      Class<T> getManagedClass()
      Gets managedClass
      MetadataManager<T> getManager()
      Gets manager
      IHopMetadataProvider getMetadataProvider()
      Gets metadataProvider
      int getSelectionIndex()  
      IVariables getSpace()
      Gets variables
      String getText()  
      IVariables getVariables()
      Gets variables
      ComboVar getwCombo()
      Gets wCombo
      org.eclipse.swt.widgets.Label getwLabel()
      Gets wLabel
      org.eclipse.swt.widgets.ToolBar getwToolBar()
      Gets wToolBar
      T loadSelectedElement()
      Load the selected element and return it.
      protected void manageMetadata()  
      void newMetadataElement()  
      void remove​(int index)  
      void removeAll()  
      void select​(int index)  
      void setEnabled​(boolean flag)  
      boolean setFocus()  
      void setItems​(String[] items)  
      void setText​(String name)  
      void viewInPerspective()  
      • Methods inherited from class org.eclipse.swt.widgets.Composite

        changed, checkSubclass, computeSize, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, redraw, setBackgroundMode, 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, 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, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, 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, dispose, 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

      • MetaSelectionLine

        public MetaSelectionLine​(IVariables variables,
                                 IHopMetadataProvider metadataProvider,
                                 Class<T> managedClass,
                                 org.eclipse.swt.widgets.Composite parentComposite,
                                 int flags,
                                 String labelText,
                                 String toolTipText,
                                 boolean leftAlignedLabel)
      • MetaSelectionLine

        public MetaSelectionLine​(IVariables variables,
                                 IHopMetadataProvider metadataProvider,
                                 Class<T> managedClass,
                                 org.eclipse.swt.widgets.Composite parentComposite,
                                 int flags,
                                 String labelText,
                                 String toolTipText,
                                 boolean leftAlignedLabel,
                                 boolean negativeMargin)
    • Method Detail

      • getEditIcon

        public static String getEditIcon​(Object guiPluginObject)
      • newMetadataElement

        @GuiToolbarElement(root="MetaSelectionLine-Toolbar",
                           id="10020-metadata-new",
                           toolTip="i18n::MetadataElement.New.Tooltip",
                           image="ui/images/new.svg")
        public void newMetadataElement()
      • viewInPerspective

        @GuiToolbarElement(root="MetaSelectionLine-Toolbar",
                           id="10030-metadata-perspective",
                           toolTip="i18n::MetadataElement.View.Tooltip",
                           image="ui/images/metadata.svg")
        public void viewInPerspective()
      • manageMetadata

        protected void manageMetadata()
      • editMetadata

        protected boolean editMetadata()
        We look at the managed class name, add Dialog to it and then simply us that class to edit the dialog.
      • fillItems

        public void fillItems()
                       throws HopException
        Look up the object names from the metadata and populate the items in the combobox with it.
        Throws:
        HopException - In case something went horribly wrong.
      • loadSelectedElement

        public T loadSelectedElement()
        Load the selected element and return it. In case of errors, log them to LogChannel.UI
        Returns:
        The selected element or null if it doesn't exist or there was an error
      • addToConnectionLine

        public void addToConnectionLine​(org.eclipse.swt.widgets.Composite parent,
                                        org.eclipse.swt.widgets.Control previous,
                                        T selected,
                                        org.eclipse.swt.events.ModifyListener lsMod)
        Adds the connection line for the given parent and previous control, and returns a meta selection manager control
        Parameters:
        parent - the parent composite object
        previous - the previous control
      • addModifyListener

        public void addModifyListener​(org.eclipse.swt.events.ModifyListener lsMod)
      • addSelectionListener

        public void addSelectionListener​(org.eclipse.swt.events.SelectionListener lsDef)
      • setText

        public void setText​(String name)
      • getText

        public String getText()
      • setItems

        public void setItems​(String[] items)
      • add

        public void add​(String item)
      • getItems

        public String[] getItems()
      • getItemCount

        public int getItemCount()
      • removeAll

        public void removeAll()
      • remove

        public void remove​(int index)
      • select

        public void select​(int index)
      • getSelectionIndex

        public int getSelectionIndex()
      • setEnabled

        public void setEnabled​(boolean flag)
        Overrides:
        setEnabled in class org.eclipse.swt.widgets.Control
      • setFocus

        public boolean setFocus()
        Overrides:
        setFocus in class org.eclipse.swt.widgets.Composite
      • addTraverseListener

        public void addTraverseListener​(org.eclipse.swt.events.TraverseListener tl)
        Overrides:
        addTraverseListener in class org.eclipse.swt.widgets.Control
      • getComboWidget

        public org.eclipse.swt.custom.CCombo getComboWidget()
      • getLabelWidget

        public org.eclipse.swt.widgets.Label getLabelWidget()
      • getMetadataProvider

        public IHopMetadataProvider getMetadataProvider()
        Gets metadataProvider
        Returns:
        value of metadataProvider
      • getSpace

        public IVariables getSpace()
        Gets variables
        Returns:
        value of variables
      • getManagedClass

        public Class<T> getManagedClass()
        Gets managedClass
        Returns:
        value of managedClass
      • getVariables

        public IVariables getVariables()
        Gets variables
        Returns:
        value of variables
      • getManager

        public MetadataManager<T> getManager()
        Gets manager
        Returns:
        value of manager
      • getwLabel

        public org.eclipse.swt.widgets.Label getwLabel()
        Gets wLabel
        Returns:
        value of wLabel
      • getwCombo

        public ComboVar getwCombo()
        Gets wCombo
        Returns:
        value of wCombo
      • getwToolBar

        public org.eclipse.swt.widgets.ToolBar getwToolBar()
        Gets wToolBar
        Returns:
        value of wToolBar