Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gmf-dev] [GMF - API CHANGE] New return type for IEditCommandRequest #getEditHelperContext()


Description:                
Tighten the contract in the element type API so that the edit helper context is always an IElementType, rather than optionally an EObject or an IElementType.  In the GMF runtime code,  if the edit helper context was an EObject, clients would have to find the IElementType registered for that EObject's EClass.  It is preferable to encapsulate this logic in the request itself, rather than force clients to consider the two different kinds of edit helper context.



1. In org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest:

        /**
         * Gets the edit helper context for this request. The context can be an
         * <code>IElementType</code> or an <code>EObject</code>. It determines
         * which edit helper should be used to find a command to do the work in the
         * request.
         *
         * @return the edit helper context for this request
         */
        public abstract Object getEditHelperContext();


becomes:

        /**
         * Gets the edit helper context for this request. The context is the
         * <code>IElementType</code> whose edit helper will be used to find a
         * command to do the work in the request.
         *
         * @return the edit helper context for this request
         */
        public abstract IElementType getEditHelperContext();



2. In org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest:

public Object getEditContext()

becomes:

public IElementType getEditContext()

and

public void setEditContext(Object editContext)
 
becomes two new methods:

public void setEditContext(EObject editContext)
public void setEditContext(IElementType editContext)


3. In org.eclipse.gmf.runtime.emf.type.core.commands.GetEditContextCommand:

public Object getEditContext()

becomes:

public IElementType getEditContext()

and

public void setEditContext(Object editContext)
 
becomes two new methods:

public void setEditContext(EObject editContext)
public void setEditContext(IElementType editContext)


4. Also, remove this method from org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry, which is no longer needed:

        public IElementType getElementType(Object o)


New API Availability:

Thursday
October 27, 2005 (or when the iteration opens for delivery, whichever comes later)

Old API Removal:

Thursday October 27, 2005 (or when the iteration opens for delivery, whichever comes later)

Tracking:
                       

Bugzilla 112
557

Clients Taken Care Of:
       

gmf, emft-query, emft-ocl, emft-validation

Other Clients Action:
       

Implement and/or use the replacement API.



Back to the top