Package org.eclipse.emf.ecp.spi.ui
Class DefaultUIProvider
- java.lang.Object
-
- org.eclipse.emf.ecp.internal.core.util.Element
-
- org.eclipse.emf.ecp.spi.ui.DefaultUIProvider
-
- All Implemented Interfaces:
java.lang.Comparable<ECPElement>,org.eclipse.core.runtime.IAdaptable,ECPElement,AdapterProvider,ECPDisposable,InternalRegistryElement,UIProvider
- Direct Known Subclasses:
CDOUIProvider,EMFStoreUIProvider,WorkspaceUIProvider
public class DefaultUIProvider extends Element implements UIProvider
- Since:
- 1.1
- Author:
- Eike Stepper, Eugen Neufeld
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.emf.ecp.spi.core.util.ECPDisposable
ECPDisposable.DisposeListener
-
-
Field Summary
-
Fields inherited from interface org.eclipse.emf.ecp.spi.ui.UIProvider
EMF_LABEL_PROVIDER, TYPE
-
-
Constructor Summary
Constructors Constructor Description DefaultUIProvider(java.lang.String name)Constructor of aDefaultUIProvider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDisposeListener(ECPDisposable.DisposeListener listener)Adds aECPDisposable.DisposeListenerto this instance.org.eclipse.swt.widgets.ControlcreateAddRepositoryUI(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.ControlcreateCheckoutUI(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.ControlcreateNewProjectUI(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.voiddispose()Disposes the current instance.protected voiddoDispose()Subclasses can override.voidfillContextMenu(org.eclipse.jface.action.IMenuManager manager, ECPContainer context, java.lang.Object[] elements)Allows the UIProvider to fill the context menu specifically.java.lang.ObjectgetAdapter(java.lang.Class adapterType)Returns an object which is an instance of the given class associated with this object.<T> TgetAdapter(java.lang.Object adaptable, java.lang.Class<T> adapterType)java.lang.StringgetDescription()Return the description.org.eclipse.swt.graphics.ImagegetImage(java.lang.Object element)Returns the image for an element.java.lang.StringgetLabel()Returns the label.InternalProvidergetProvider()Returns the corresponding Provider for this UI Provider.java.lang.StringgetText(java.lang.Object element)Returns the name for an element.java.lang.StringgetType()This return the type of the object.booleanisDisposed()Whether this instance is already disposed.protected booleanpopulateNewRoot(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.jface.action.IMenuManager manager)voidremoveDisposeListener(ECPDisposable.DisposeListener listener)Removed aECPDisposable.DisposeListenerfrom this instance.voidsetDescription(java.lang.String description)Sets the description.voidsetLabel(java.lang.String label)Sets the label.-
Methods inherited from class org.eclipse.emf.ecp.internal.core.util.Element
compareTo, equals, getName, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.emf.ecp.core.util.ECPElement
getName
-
-
-
-
Constructor Detail
-
DefaultUIProvider
public DefaultUIProvider(java.lang.String name)
Constructor of aDefaultUIProvider.- Parameters:
name- the name for thisUIProvider
-
-
Method Detail
-
getType
public java.lang.String getType()
This return the type of the object.
-
getProvider
public InternalProvider getProvider()
Returns the corresponding Provider for this UI Provider.- Specified by:
getProviderin interfaceUIProvider- Returns:
- the corresponding
InternalProvider
-
getLabel
public final java.lang.String getLabel()
Returns the label.- Specified by:
getLabelin interfaceInternalRegistryElement- Returns:
- the label
-
setLabel
public final void setLabel(java.lang.String label)
Sets the label.- Specified by:
setLabelin interfaceInternalRegistryElement- Parameters:
label- the Label to set
-
getDescription
public final java.lang.String getDescription()
Return the description.- Specified by:
getDescriptionin interfaceInternalRegistryElement- Returns:
- the description
-
setDescription
public final void setDescription(java.lang.String description)
Sets the description.- Specified by:
setDescriptionin interfaceInternalRegistryElement- Parameters:
description- the Description to set
-
getAdapter
public <T> T getAdapter(java.lang.Object adaptable, java.lang.Class<T> adapterType)- Specified by:
getAdapterin interfaceAdapterProvider
-
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. Returnsnullif no such object can be found.This implementation of the method declared by
IAdaptablepasses the request along to the platform's adapter manager; roughlyPlatform.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:
getAdapterin interfaceorg.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:
isDisposedin interfaceECPDisposable- Returns:
- true if already disposed, false otherwise.
-
dispose
public final void dispose()
Disposes the current instance.- Specified by:
disposein interfaceECPDisposable
-
addDisposeListener
public final void addDisposeListener(ECPDisposable.DisposeListener listener)
Adds aECPDisposable.DisposeListenerto this instance.- Specified by:
addDisposeListenerin interfaceECPDisposable- Parameters:
listener- the listener to add
-
removeDisposeListener
public final void removeDisposeListener(ECPDisposable.DisposeListener listener)
Removed aECPDisposable.DisposeListenerfrom this instance.- Specified by:
removeDisposeListenerin interfaceECPDisposable- Parameters:
listener- the listener to remove
-
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:
getTextin interfaceUIProvider- 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:
getImagein interfaceUIProvider- 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:
fillContextMenuin interfaceUIProvider- Parameters:
manager- theIMenuManagerto fillcontext- the current selectedECPContainerelements- 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:
createAddRepositoryUIin interfaceUIProvider- Parameters:
parent- theCompositeto fillrepositoryProperties- theECPPropertiesof the repository to createrepositoryNameText- theTextwidget handling the repository namerepositoryLabelText- theTextwidget handling the repository labelrepositoryDescriptionText- theTextwidget 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:
createCheckoutUIin interfaceUIProvider- Parameters:
parent- theCompositeto fillcheckoutSource- the Object to checkoutprojectProperties- theECPPropertiesof 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:
createNewProjectUIin interfaceUIProvider- Parameters:
parent- theCompositeto fillobserver- the observerprojectProperties- theECPPropertiesof 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)
-
-