Class InsertInstantiatorDialog

  • All Implemented Interfaces:
    org.eclipse.jface.window.IShellProvider

    public class InsertInstantiatorDialog
    extends org.eclipse.jface.dialogs.Dialog
    Creates a dialog for inserting instantiators.
    Author:
    Holger Eichelberger
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.eclipse.swt.widgets.Button before  
      private org.eclipse.jface.viewers.ComboViewer combo  
      private TreeNode.InsertionPoint insertionPoint  
      private TreeNode node  
      private org.eclipse.jface.viewers.TableViewer params  
      private Script script  
      • Fields inherited from class org.eclipse.jface.dialogs.Dialog

        blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS
      • Fields inherited from class org.eclipse.jface.window.Window

        CANCEL, OK, resizeHasOccurred
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addOperations​(IMetaType type, java.util.TreeMap<java.lang.String,​IMetaOperation> sorter)
      Adds the operations of the given type.
      private void addScript​(Script script, java.util.Set<Script> done, java.util.TreeMap<java.lang.String,​IMetaOperation> sorter)
      Adds a script if not already done as well as its parent scripts.
      protected void configureShell​(org.eclipse.swt.widgets.Shell shell)  
      protected org.eclipse.swt.widgets.Control createDialogArea​(org.eclipse.swt.widgets.Composite parent)  
      private void fillParams​(IMetaOperation op)
      Fills the parameter table.
      protected void okPressed()  
      private java.util.Collection<IMetaOperation> sortedInstantiators()
      Returns the sorted (available) instantiators.
      • Methods inherited from class org.eclipse.jface.dialogs.Dialog

        applyDialogFont, buttonPressed, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonBar, createButtonsForButtonBar, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, isResizable, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
      • Methods inherited from class org.eclipse.jface.window.Window

        canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • combo

        private org.eclipse.jface.viewers.ComboViewer combo
      • script

        private Script script
      • params

        private org.eclipse.jface.viewers.TableViewer params
      • before

        private org.eclipse.swt.widgets.Button before
    • Constructor Detail

      • InsertInstantiatorDialog

        public InsertInstantiatorDialog​(org.eclipse.swt.widgets.Shell parentShell,
                                        Script script,
                                        TreeNode node,
                                        TreeNode.InsertionPoint insertionPoint)
        Default constructor.
        Parameters:
        parentShell - The parent shell.
        script - the script to insert into
        node - the selected node
        insertionPoint - the supported insertion points
    • Method Detail

      • configureShell

        protected void configureShell​(org.eclipse.swt.widgets.Shell shell)
        Overrides:
        configureShell in class org.eclipse.jface.window.Window
      • createDialogArea

        protected org.eclipse.swt.widgets.Control createDialogArea​(org.eclipse.swt.widgets.Composite parent)
        Overrides:
        createDialogArea in class org.eclipse.jface.dialogs.Dialog
      • fillParams

        private void fillParams​(IMetaOperation op)
        Fills the parameter table.
        Parameters:
        op - the operation to fill the parameter table with
      • sortedInstantiators

        private java.util.Collection<IMetaOperation> sortedInstantiators()
        Returns the sorted (available) instantiators.
        Returns:
        the instantiators as operations
      • addScript

        private void addScript​(Script script,
                               java.util.Set<Script> done,
                               java.util.TreeMap<java.lang.String,​IMetaOperation> sorter)
        Adds a script if not already done as well as its parent scripts.
        Parameters:
        script - the script to be added
        done - the already processed scripts (to be modified as a side effect)
        sorter - a sorted signature-operation mapping (to be modified as a side effect)
      • addOperations

        private void addOperations​(IMetaType type,
                                   java.util.TreeMap<java.lang.String,​IMetaOperation> sorter)
        Adds the operations of the given type.
        Parameters:
        type - the type to be added
        sorter - a sorted signature-operation mapping (to be modified as a side effect)
      • okPressed

        protected void okPressed()
        Overrides:
        okPressed in class org.eclipse.jface.dialogs.Dialog