Class DefaultUIProvider

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addDisposeListener​(ECPDisposable.DisposeListener listener)
      Adds a ECPDisposable.DisposeListener to this instance.
      org.eclipse.swt.widgets.Control createAddRepositoryUI​(org.eclipse.swt.widgets.Composite parent, ECPProperties repositoryProperties, org.eclipse.swt.widgets.Text repositoryNameText, org.eclipse.swt.widgets.Text repositoryLabelText, org.eclipse.swt.widgets.Text repositoryDescriptionText)
      The UIProvider can return its provider specific UI to allow the user to fill in provider specific data during the creation of an Repository.
      org.eclipse.swt.widgets.Control createCheckoutUI​(org.eclipse.swt.widgets.Composite parent, ECPCheckoutSource checkoutSource, ECPProperties projectProperties)
      The UIProvider can return a provider specific UI to allow the user to fill in provider specific data for a checkout.
      org.eclipse.swt.widgets.Control createNewProjectUI​(org.eclipse.swt.widgets.Composite parent, CompositeStateObserver observer, ECPProperties projectProperties)
      The UIProvider can return a provider specific UI to allow the user to fill in provider specific data for the creation of a new project.
      void dispose()
      Disposes the current instance.
      protected void doDispose()
      Subclasses can override.
      void fillContextMenu​(org.eclipse.jface.action.IMenuManager manager, ECPContainer context, java.lang.Object[] elements)
      Allows the UIProvider to fill the context menu specifically.
      java.lang.Object getAdapter​(java.lang.Class adapterType)
      Returns an object which is an instance of the given class associated with this object.
      <T> T getAdapter​(java.lang.Object adaptable, java.lang.Class<T> adapterType)
      java.lang.String getDescription()
      Return the description.
      org.eclipse.swt.graphics.Image getImage​(java.lang.Object element)
      Returns the image for an element.
      java.lang.String getLabel()
      Returns the label.
      InternalProvider getProvider()
      Returns the corresponding Provider for this UI Provider.
      java.lang.String getText​(java.lang.Object element)
      Returns the name for an element.
      java.lang.String getType()
      This return the type of the object.
      boolean isDisposed()
      Whether this instance is already disposed.
      protected boolean populateNewRoot​(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.jface.action.IMenuManager manager)  
      void removeDisposeListener​(ECPDisposable.DisposeListener listener)
      Removed a ECPDisposable.DisposeListener from this instance.
      void setDescription​(java.lang.String description)
      Sets the description.
      void setLabel​(java.lang.String label)
      Sets the label.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Comparable

        compareTo
    • Constructor Detail

      • DefaultUIProvider

        public DefaultUIProvider​(java.lang.String name)
        Constructor of a DefaultUIProvider.
        Parameters:
        name - the name for this UIProvider
    • Method Detail

      • getType

        public java.lang.String getType()
        This return the type of the object.
        Specified by:
        getType in class Element
        Returns:
        the type
      • setLabel

        public final void setLabel​(java.lang.String label)
        Sets the label.
        Specified by:
        setLabel in interface InternalRegistryElement
        Parameters:
        label - the Label to set
      • setDescription

        public final void setDescription​(java.lang.String description)
        Sets the description.
        Specified by:
        setDescription in interface InternalRegistryElement
        Parameters:
        description - the Description to set
      • getAdapter

        public <T> T getAdapter​(java.lang.Object adaptable,
                                java.lang.Class<T> adapterType)
        Specified by:
        getAdapter in interface AdapterProvider
      • getAdapter

        public java.lang.Object getAdapter​(java.lang.Class adapterType)
        Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.

        This implementation of the method declared by IAdaptable passes the request along to the platform's adapter manager; roughly Platform.getAdapterManager().getAdapter(this, adapter). Subclasses may override this method (however, if they do so, they should invoke the method on their superclass to ensure that the Platform's adapter manager is consulted).

        Specified by:
        getAdapter in interface org.eclipse.core.runtime.IAdaptable
        Parameters:
        adapterType - the class to adapt to
        Returns:
        the adapted object or null
        See Also:
        IAdaptable.getAdapter(Class)
      • isDisposed

        public final boolean isDisposed()
        Whether this instance is already disposed.
        Specified by:
        isDisposed in interface ECPDisposable
        Returns:
        true if already disposed, false otherwise.
      • dispose

        public final void dispose()
        Disposes the current instance.
        Specified by:
        dispose in interface ECPDisposable
      • doDispose

        protected void doDispose()
        Subclasses can override.
      • getText

        public java.lang.String getText​(java.lang.Object element)
        Returns the name for an element.
        Specified by:
        getText in interface UIProvider
        Parameters:
        element - the object to return the name for
        Returns:
        the name of this element
      • getImage

        public org.eclipse.swt.graphics.Image getImage​(java.lang.Object element)
        Returns the image for an element.
        Specified by:
        getImage in interface UIProvider
        Parameters:
        element - the object to return the image for
        Returns:
        the name of this element
      • fillContextMenu

        public void fillContextMenu​(org.eclipse.jface.action.IMenuManager manager,
                                    ECPContainer context,
                                    java.lang.Object[] elements)
        Allows the UIProvider to fill the context menu specifically.
        Specified by:
        fillContextMenu in interface UIProvider
        Parameters:
        manager - the IMenuManager to fill
        context - the current selected ECPContainer
        elements - the selected elements
      • createAddRepositoryUI

        public org.eclipse.swt.widgets.Control createAddRepositoryUI​(org.eclipse.swt.widgets.Composite parent,
                                                                     ECPProperties repositoryProperties,
                                                                     org.eclipse.swt.widgets.Text repositoryNameText,
                                                                     org.eclipse.swt.widgets.Text repositoryLabelText,
                                                                     org.eclipse.swt.widgets.Text repositoryDescriptionText)
        The UIProvider can return its provider specific UI to allow the user to fill in provider specific data during the creation of an Repository.
        Specified by:
        createAddRepositoryUI in interface UIProvider
        Parameters:
        parent - the Composite to fill
        repositoryProperties - the ECPProperties of the repository to create
        repositoryNameText - the Text widget handling the repository name
        repositoryLabelText - the Text widget handling the repository label
        repositoryDescriptionText - the Text widget handling the repository description
        Returns:
        the created control
      • createCheckoutUI

        public org.eclipse.swt.widgets.Control createCheckoutUI​(org.eclipse.swt.widgets.Composite parent,
                                                                ECPCheckoutSource checkoutSource,
                                                                ECPProperties projectProperties)
        The UIProvider can return a provider specific UI to allow the user to fill in provider specific data for a checkout.
        Specified by:
        createCheckoutUI in interface UIProvider
        Parameters:
        parent - the Composite to fill
        checkoutSource - the Object to checkout
        projectProperties - the ECPProperties of the project to create
        Returns:
        the created control
      • createNewProjectUI

        public org.eclipse.swt.widgets.Control createNewProjectUI​(org.eclipse.swt.widgets.Composite parent,
                                                                  CompositeStateObserver observer,
                                                                  ECPProperties projectProperties)
        The UIProvider can return a provider specific UI to allow the user to fill in provider specific data for the creation of a new project.
        Specified by:
        createNewProjectUI in interface UIProvider
        Parameters:
        parent - the Composite to fill
        observer - the observer
        projectProperties - the ECPProperties of the project to create
        Returns:
        the created control
      • populateNewRoot

        protected boolean populateNewRoot​(org.eclipse.emf.ecore.resource.Resource resource,
                                          org.eclipse.jface.action.IMenuManager manager)