Bug 166015 Refactor designer actions to eclipse command framework
Eclipse command framework provide a more explicit way to manage UI actions contributions, we can take it's advantage to make our actions code more clean and maintainable.
UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/views/actions/RevertToTemplateAction.java
if ( obj instanceof IStructuredSelection )
		{
			IStructuredSelection selection = (IStructuredSelection) obj;
			if ( selection.size( ) != 1 )
			{
				return null;
			}
			obj = selection.getFirstElement( );
		}
		if ( obj instanceof DesignElementHandle )
		{
			return (DesignElementHandle) obj;
		}
		return null;
	}
	public boolean isEnabled( )
	{
		if ( getSelectedElement( ) == null )
		{
			return false;
		}
		return super.isEnabled( )
				&& getSelectedElement( ).canTransformToTemplate( )
				&& getSelectedElement( ).isTemplateParameterValue( )
				
			
				&& !( getSelectedElement( ).getRoot( ) instanceof LibraryHandle );
	}
}